[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 13 23:59:09 PDT 2020
wallace updated this revision to Diff 298052.
wallace marked 11 inline comments as done.
wallace added a comment.
Changes:
- Changed the callback signature of ForEachInstruction to receive an Expected<load_addr>
- Use Expected more ubiquitously in IntelPTDecoder
- Use MemoryBuffer to read the trace file
- Implemented ProcessTrace::DoReadMemory, which now is used by libipt instead of loading each object file inside libipt
- Made the decoding function a little bit more readable
- Small fixes here and there
Notes:
- I added a small test where a instruction can't be decoded due to missing memory mapping. I'll add later more robust tests.
- I'm also not fond of the ProcessTrace class being implemented in a plugin, however, it seems that all processes are implemented that way and the main method for creating processes Target::CreateProcess relies on plugins for creating the right instance. I could create an overload of that class that receives a callback that creates a specific process class, although it might create an way to unintendendly bypass the existing Target::CreateProcess. Another option is to move the class to lldb core and register the plugin from there, even though it'd be the only class doing that in the codebase. What do you think?
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/Trace.h
lldb/include/lldb/Target/TraceSessionFileParser.h
lldb/include/lldb/Target/TraceThread.h
lldb/include/lldb/lldb-forward.h
lldb/source/Plugins/Process/Trace/ProcessTrace.cpp
lldb/source/Plugins/Process/Trace/ProcessTrace.h
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/ThreadIntelPT.cpp
lldb/source/Plugins/Trace/intel-pt/ThreadIntelPT.h
lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp
lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.h
lldb/source/Target/CMakeLists.txt
lldb/source/Target/Thread.cpp
lldb/source/Target/Trace.cpp
lldb/source/Target/TraceSessionFileParser.cpp
lldb/source/Target/TraceThread.cpp
lldb/test/API/commands/trace/TestTraceDumpInstructions.py
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.298052.patch
Type: text/x-patch
Size: 55394 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201014/e01b6fc1/attachment-0001.bin>
More information about the lldb-commits
mailing list