[Lldb-commits] [PATCH] D146765: [lldb/crashlog] Load inlined symbol into interactive crashlog
Med Ismail Bennani via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Mar 23 15:19:46 PDT 2023
mib created this revision.
mib added reviewers: JDevlieghere, kastiglione, bulbazord.
mib added a project: LLDB.
Herald added a project: All.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.
Sometimes, crash reports come with inlined symbols. These provide the
exact stacktrace from the user binary.
However, when investigating a crash, it's very likely that the images related
to the crashed thread are not available on the debugging user system or
that the versions don't match. This causes interactive crashlog to show
a degraded backtrace in lldb.
This patch aims to address that issue, by parsing the inlined symbols
from the crash report and load them into lldb's target.
To do, we rely on the new SymbolFileJSON plugin. This patch also changes
a few things:
- Add `SBModuleSpec::SetUUIDFromString` with a typemap.
- Add an overload to `SBTarget::FindModule(const SBModuleSpec&)`.
- Update the thread parsing method in the JSONCrashLogParser to extract the symbol name and address for each stack frame.
- Update the thread and image parsing methods in the TextCrashLogParser to refine the regural expressions. We now have new capture group for the symbol name and the offset.
So now, when parsing the crash report, we build a data structure
containing all the symbol information for each stackframe. Then, after
launching the scripted process for interactive mode, we write a JSON
symbol file for each module, only containing the symbols that it contains.
Finally, we load the json symbol file into lldb, before showing the user
the process status and backtrace.
rdar://97345586
Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D146765
Files:
lldb/bindings/python/python-typemaps.swig
lldb/examples/python/crashlog.py
lldb/include/lldb/API/SBModuleSpec.h
lldb/include/lldb/API/SBTarget.h
lldb/source/API/SBModuleSpec.cpp
lldb/source/API/SBTarget.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146765.507897.patch
Type: text/x-patch
Size: 11045 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230323/3f09a984/attachment.bin>
More information about the lldb-commits
mailing list