diff options
author | Med Ismail Bennani <ismail@bennani.ma> | 2025-08-21 23:16:45 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-21 23:16:45 -0700 |
commit | 595148ab7680cf579bcbe405c5a49dcb791d46ab (patch) | |
tree | ecfd1ba556085d2bdda6022fc8bb266d14f094c4 /lldb/examples/python/crashlog.py | |
parent | 0fff4605922d137252875f072b3fb2973dbf9693 (diff) | |
download | llvm-595148ab7680cf579bcbe405c5a49dcb791d46ab.zip llvm-595148ab7680cf579bcbe405c5a49dcb791d46ab.tar.gz llvm-595148ab7680cf579bcbe405c5a49dcb791d46ab.tar.bz2 |
[lldb/crashlog] Avoid StopAtEntry when launch crashlog in interactive mode (#154651)
In 88f409194, we changed the way the crashlog scripted process was
launched since the previous approach required to parse the file twice,
by stopping at entry, setting the crashlog object in the middle of the
scripted process launch and resuming it.
Since then, we've introduced SBScriptObject which allows to pass any
arbitrary python object accross the SBAPI boundary to another scripted
affordance.
This patch make sure of that to include the parse crashlog object into
the scripted process launch info dictionary, which eliviates the need to
stop at entry.
Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Diffstat (limited to 'lldb/examples/python/crashlog.py')
-rwxr-xr-x | lldb/examples/python/crashlog.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py index bb20f3a..b466be6 100755 --- a/lldb/examples/python/crashlog.py +++ b/lldb/examples/python/crashlog.py @@ -1540,13 +1540,19 @@ def load_crashlog_in_scripted_process(debugger, crashlog_path, options, result): } ) ) + + crashlog_sd = lldb.SBStructuredData() + crashlog_sd.SetGenericValue( + lldb.SBScriptObject(crashlog, lldb.eScriptLanguagePython) + ) + structured_data.SetValueForKey("crashlog", crashlog_sd) + launch_info = lldb.SBLaunchInfo(None) launch_info.SetProcessPluginName("ScriptedProcess") launch_info.SetScriptedProcessClassName( "crashlog_scripted_process.CrashLogScriptedProcess" ) launch_info.SetScriptedProcessDictionary(structured_data) - launch_info.SetLaunchFlags(lldb.eLaunchFlagStopAtEntry) error = lldb.SBError() process = target.Launch(launch_info, error) @@ -1554,9 +1560,6 @@ def load_crashlog_in_scripted_process(debugger, crashlog_path, options, result): if not process or error.Fail(): raise InteractiveCrashLogException("couldn't launch Scripted Process", error) - process.GetScriptedImplementation().set_crashlog(crashlog) - process.Continue() - if not options.skip_status: @contextlib.contextmanager |