[Lldb-commits] [PATCH] D88769: [trace] Scaffold "thread trace dump instructions"
walter erquinigo via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Oct 5 01:08:17 PDT 2020
wallace updated this revision to Diff 296106.
wallace added a comment.
Herald added a subscriber: dexonsmith.
Address comments:
- Created a basic ThreadTrace class instead of using HistoryThread. I'll modify this class later when I add the decoding functionality and refactor the json file parsing logic.
- Renamed offset to start_position, and added a clearer documentation about it. We'll have a current_position in each thread, and we'll print instructions in reverse order chronologically starting at current_position, unless start_position is specified. This matches gdb's implementation and works well with repeat commands, e.g. the user types "thread trace dump instructions" repeatedly showing a continous list of instructions from most recent to oldest.
- Now using DidAttach instead of LoadCore for setting the newly created procesess state to stopped.
- Moved the dump implementation from Target to Thread.
- Fixed the CanDebug function.
- Added a test for "thread trace dump instructions <invalid_thread_index>" and now using the long options instead of the short ones in the tests.
Some notes:
- I think that TraceSettingsParser should be used only when constructing a trace from a json file. In the case of a live process, we can skip it and directly create the trace objects accordingly. So the json parser can assume that the process is defunct.
- I haven't thought of making "thread trace dump" do anything. I'm thinking of having
thread trace info (for general information, including trace size, for example)
thread trace dump instructions
thread trace dump functions
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88769/new/
https://reviews.llvm.org/D88769
Files:
lldb/include/lldb/Target/Target.h
lldb/include/lldb/Target/Thread.h
lldb/include/lldb/Target/Trace.h
lldb/source/Commands/CommandObjectThread.cpp
lldb/source/Commands/Options.td
lldb/source/Plugins/Process/CMakeLists.txt
lldb/source/Plugins/Process/Trace/CMakeLists.txt
lldb/source/Plugins/Process/Trace/ProcessTrace.cpp
lldb/source/Plugins/Process/Trace/ProcessTrace.h
lldb/source/Plugins/Process/Trace/ThreadTrace.cpp
lldb/source/Plugins/Process/Trace/ThreadTrace.h
lldb/source/Target/Target.cpp
lldb/source/Target/Thread.cpp
lldb/source/Target/Trace.cpp
lldb/source/Target/TraceSettingsParser.cpp
lldb/test/API/commands/trace/TestTraceDumpInstructions.py
lldb/test/API/commands/trace/TestTraceLoad.py
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88769.296106.patch
Type: text/x-patch
Size: 27686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201005/c5b8bca9/attachment-0001.bin>
More information about the lldb-commits
mailing list