[Lldb-commits] [PATCH] D87589: [intel-pt] Add the instruction decoding functionality
walter erquinigo via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Sun Sep 13 12:48:26 PDT 2020
wallace created this revision.
wallace added a reviewer: clayborg.
Herald added subscribers: lldb-commits, dang, aaron.ballman, mgorny.
Herald added a reviewer: JDevlieghere.
Herald added a project: LLDB.
wallace requested review of this revision.
Depends on D86670 <https://reviews.llvm.org/D86670>.
This adds the necessary logic that uses libipt (https://github.com/intel/libipt) to decode Intel PT traces.
The basic usage is as follows:
$ trace load /path/to/trace/settings/file.json
$ trace dump -i [-t TID]
$ pid: '2', tid: '22'
$ 4195629
$ 4195625
$ 4195621
...
If no TID is specified, the currently selected thread ID of the current target is used.
Corresponding tests were added.
Note that this diff is just printing the instructions without any additional information, unlike the "disassemble" command. This will be done in a future diff.
Also, in a future diff I'll be analyzing each instruction and reconstructing the stack traces.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D87589
Files:
lldb/include/lldb/Target/Trace.h
lldb/source/Commands/CommandObjectTrace.cpp
lldb/source/Commands/Options.td
lldb/source/Plugins/Trace/intel-pt/CMakeLists.txt
lldb/source/Plugins/Trace/intel-pt/DecodedTrace.cpp
lldb/source/Plugins/Trace/intel-pt/DecodedTrace.h
lldb/source/Plugins/Trace/intel-pt/Decoder.cpp
lldb/source/Plugins/Trace/intel-pt/Decoder.h
lldb/source/Plugins/Trace/intel-pt/IntelPTThread.cpp
lldb/source/Plugins/Trace/intel-pt/IntelPTThread.h
lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.cpp
lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.h
lldb/source/Target/Target.cpp
lldb/source/Target/TraceSettingsParser.cpp
lldb/test/API/commands/trace/TestTraceDump.py
lldb/test/API/commands/trace/intelpt-trace/trace_bad_image.json
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87589.291469.patch
Type: text/x-patch
Size: 32643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200913/a3e62197/attachment-0001.bin>
More information about the lldb-commits
mailing list