[lldb] Use ObjectFileJSON to create modules for interactive crashlogs
authorJonas Devlieghere <jonas@devlieghere.com>
Thu, 13 Apr 2023 23:27:53 +0000 (16:27 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Thu, 13 Apr 2023 23:56:29 +0000 (16:56 -0700)
commit27f27d15f6c90b026eca23b8ee238fdbf772fd80
tree8fd3e01ed2d4b472361cba530f4181ec5bffee6f
parentfcc5f9ef50e18137fd8020127db05a59c3a4015d
[lldb] Use ObjectFileJSON to create modules for interactive crashlogs

Create an artificial module using a JSON object file when we can't
locate the module and dSYM through dsymForUUID (or however
locate_module_and_debug_symbols is implemented). By parsing the symbols
from the crashlog and making them part of the JSON object file, LLDB can
symbolicate frames it otherwise wouldn't be able to, as there is no
module for it.

For non-interactive crashlogs, that never was a problem because we could
simply show the "pre-symbolicated" frame from the input. For interactive
crashlogs, we need a way to pass the symbol information to LLDB so that
it can symbolicate the frames, which is what motivated the JSON object
file format.

Differential revision: https://reviews.llvm.org/D148172
lldb/examples/python/crashlog.py
lldb/examples/python/scripted_process/crashlog_scripted_process.py
lldb/examples/python/symbolication.py
lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/interactive_crashlog/multithread-test.ips
lldb/test/Shell/ScriptInterpreter/Python/Crashlog/skipped_status_interactive_crashlog.test