This is an archive of the discontinued LLVM Phabricator instance.

[lldb/crashlog] Add CrashLogScriptedProcess and resurrect_crashlog method
AbandonedPublic

Authored by mib on Feb 9 2022, 4:28 PM.

Details

Reviewers
JDevlieghere
Summary

This patch introduces a new type of ScriptedProcess: CrashLogScriptedProcess.
It takes advantage of lldb's crashlog parsers and Scripted Processes to
reconstruct a static debugging session with symbolicated stackframes, instead
of just dumping out everything in the user's terminal.

To create a CrashLogScriptedProcess, the user can just import the
crashlog module and run the new resurrect_crashlog command with the
path the crashlog file. This will fetch and load all the libraries that
were used by the crashed thread and re-create all the frames artificially.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>

Diff Detail

Event Timeline

mib created this revision.Feb 9 2022, 4:28 PM
mib requested review of this revision.Feb 9 2022, 4:28 PM
mib updated this revision to Diff 407712.Feb 10 2022, 3:58 PM

Update crash_log_scripted_process.py to stop using get_most_relevant_thread_index

JDevlieghere added inline comments.Feb 11 2022, 2:03 PM
lldb/examples/python/crashlog.py
1098

Do we need this at all if we integrate it in the existing crashlog command?

1301–1302

I expect the scripted process implementation to take the place of the existing interactive mode (D119501) so I don't think we need a new command.

lldb/examples/python/scripted_process/crashlog_scripted_process.py
12

This is an internal link :-)

mib marked 3 inline comments as done.Feb 11 2022, 2:58 PM
mib added inline comments.
lldb/examples/python/crashlog.py
1301–1302

Let's just merge this patch with D119501

mib abandoned this revision.Feb 11 2022, 3:07 PM
mib marked an inline comment as done.