[Lldb-commits] [PATCH] D89283: [trace][intel-pt] Implement the basic decoding functionality

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 20 17:44:59 PDT 2020


wallace updated this revision to Diff 299524.
wallace added a comment.
Herald added a subscriber: dang.

Some updates, especially regarding the indexing and dump ordering, which I discussed at lenght with some coworkers:

- I've addressed most of the issues, except for the disassembly and the yaml object files, which I'll do tomorrow.
- I've changed the indexing to have [0] be the oldest instruction, and [N] the most recent one. This matches with most people's expectations on the order of lines in a text file.
- I've changed the instruction dump to be

  thread trace dump instructions --count <> --position <>

  And it prints in reverse order, for example [10] [11] [12] [13] [14]

  And after a repeat command, it prints

  [5] [6] [7] [8] [9]

  and so on

The common feedback I got is that this is the most intuitive way to understand the text.

- I've added a position member to DecodedThread, which in the future we'll move as we perform reverse debugging. For now, it's default value is the end of the trace. I'm using it for the instruction dump.
- Now when there are errors, I'm not printing its index and I'm adding a whitespace, like

  [ 0] 0x40064f [ 1] 0x400540 [ 2] 0x400546 [ 3] 0x40054b [ 4] 0x400510 [ 5] 0x400516 error: no memory mapped at this address 0x7ffff7df1950

  [ 7] 0x400654 [ 8] 0x400657 [ 9] 0x40065a [10] 0x40065f

Also the feedback I got about this is that showing the index of the error can confuse some people, and that the whitespace makes it very clear that there's missing information and that the error is not inoffensive.

- I also made the requested small fixes here and there.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89283/new/

https://reviews.llvm.org/D89283

Files:
  lldb/include/lldb/Target/ProcessTrace.h
  lldb/include/lldb/Target/Trace.h
  lldb/source/Commands/CommandObjectThread.cpp
  lldb/source/Commands/Options.td
  lldb/source/Plugins/Trace/intel-pt/CMakeLists.txt
  lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp
  lldb/source/Plugins/Trace/intel-pt/DecodedThread.h
  lldb/source/Plugins/Trace/intel-pt/IntelPTDecoder.cpp
  lldb/source/Plugins/Trace/intel-pt/IntelPTDecoder.h
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
  lldb/source/Target/ProcessTrace.cpp
  lldb/source/Target/Trace.cpp
  lldb/source/Target/TraceSessionFileParser.cpp
  lldb/test/API/commands/trace/TestTraceDumpInstructions.py
  lldb/test/API/commands/trace/intelpt-trace-multi-file/a.out
  lldb/test/API/commands/trace/intelpt-trace-multi-file/bar.cpp
  lldb/test/API/commands/trace/intelpt-trace-multi-file/bar.h
  lldb/test/API/commands/trace/intelpt-trace-multi-file/foo.cpp
  lldb/test/API/commands/trace/intelpt-trace-multi-file/foo.h
  lldb/test/API/commands/trace/intelpt-trace-multi-file/libbar.so
  lldb/test/API/commands/trace/intelpt-trace-multi-file/libfoo.so
  lldb/test/API/commands/trace/intelpt-trace-multi-file/main.cpp
  lldb/test/API/commands/trace/intelpt-trace-multi-file/multi-file-no-ld.json
  lldb/test/API/commands/trace/intelpt-trace-multi-file/multi-file.trace
  lldb/test/API/commands/trace/intelpt-trace/trace_bad_image.json
  lldb/test/API/commands/trace/intelpt-trace/trace_wrong_cpu.json

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89283.299524.patch
Type: text/x-patch
Size: 44855 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201021/242f3a66/attachment-0001.bin>


More information about the lldb-commits mailing list