aboutsummaryrefslogtreecommitdiff
path: root/lldb/examples/python/crashlog.py
diff options
context:
space:
mode:
authorMed Ismail Bennani <medismail.bennani@gmail.com>2022-03-16 15:44:31 -0700
committerMed Ismail Bennani <medismail.bennani@gmail.com>2022-03-16 15:50:10 -0700
commit0a65112cf710945fa5cfc0d0be6ff84eba5adb3a (patch)
treed348a927a7d7425f7455bafb38d61c4e3f30894c /lldb/examples/python/crashlog.py
parent0c4e9fbf410dc8ba81c814dcf262c739909cf4f2 (diff)
downloadllvm-0a65112cf710945fa5cfc0d0be6ff84eba5adb3a.zip
llvm-0a65112cf710945fa5cfc0d0be6ff84eba5adb3a.tar.gz
llvm-0a65112cf710945fa5cfc0d0be6ff84eba5adb3a.tar.bz2
[lldb/crashlog] Create artificial frames for non-crashed scripted threads
This patch pipes down the `-a|--load-all` crashlog command option to the Scripted Process initializer to load all the images used by crashed process instead of only loading the images related to the crashed thread. This allows us to recreate artificial frames also for the non-crashed scripted threads. rdar://90396265 Differential Revision: https://reviews.llvm.org/D121826 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/examples/python/crashlog.py')
-rwxr-xr-xlldb/examples/python/crashlog.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 939f3fc..aad58c5 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -977,7 +977,7 @@ def SymbolicateCrashLog(crash_log, options):
for error in crash_log.errors:
print(error)
-def load_crashlog_in_scripted_process(debugger, crash_log_file):
+def load_crashlog_in_scripted_process(debugger, crash_log_file, options):
result = lldb.SBCommandReturnObject()
crashlog_path = os.path.expanduser(crash_log_file)
@@ -1010,7 +1010,8 @@ def load_crashlog_in_scripted_process(debugger, crash_log_file):
return
structured_data = lldb.SBStructuredData()
- structured_data.SetFromJSON(json.dumps({ "crashlog_path" : crashlog_path }))
+ structured_data.SetFromJSON(json.dumps({ "crashlog_path" : crashlog_path,
+ "load_all_images": options.load_all_images }))
launch_info = lldb.SBLaunchInfo(None)
launch_info.SetProcessPluginName("ScriptedProcess")
launch_info.SetScriptedProcessClassName("crashlog_scripted_process.CrashLogScriptedProcess")
@@ -1069,7 +1070,9 @@ def CreateSymbolicateCrashLogOptions(
'-a',
action='store_true',
dest='load_all_images',
- help='load all executable images, not just the images found in the crashed stack frames',
+ help='load all executable images, not just the images found in the '
+ 'crashed stack frames, loads stackframes for all the threads in '
+ 'interactive mode.',
default=False)
option_parser.add_option(
'--images',
@@ -1199,7 +1202,8 @@ def SymbolicateCrashLogs(debugger, command_args):
if args:
for crash_log_file in args:
if should_run_in_interactive_mode(options, ci):
- load_crashlog_in_scripted_process(debugger, crash_log_file)
+ load_crashlog_in_scripted_process(debugger, crash_log_file,
+ options)
else:
crash_log = CrashLogParser().parse(debugger, crash_log_file, options.verbose)
SymbolicateCrashLog(crash_log, options)