diff options
author | Jim Ingham <jingham@apple.com> | 2023-05-02 13:41:07 -0700 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2023-05-03 10:52:12 -0700 |
commit | c2be702104284cb3facf31124494b9a400296179 (patch) | |
tree | 9601dfe2ef698bb9baf177a4078eba79b597f33e /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | |
parent | cd05ffdbb2c303cbf476a3a48b3f67094d428e37 (diff) | |
download | llvm-c2be702104284cb3facf31124494b9a400296179.zip llvm-c2be702104284cb3facf31124494b9a400296179.tar.gz llvm-c2be702104284cb3facf31124494b9a400296179.tar.bz2 |
Allow scripted thread plans to modify the thread stop description when
they are completed.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 3af3c87..a98ac58 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -1743,7 +1743,7 @@ bool ScriptInterpreterPythonImpl::ScriptedThreadPlanIsStale( Locker py_lock(this, Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN); is_stale = LLDBSWIGPythonCallThreadPlan(generic->GetValue(), "is_stale", - nullptr, script_error); + (Event *) nullptr, script_error); if (script_error) return true; } @@ -1760,7 +1760,7 @@ lldb::StateType ScriptInterpreterPythonImpl::ScriptedThreadPlanGetRunState( Locker py_lock(this, Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN); should_step = LLDBSWIGPythonCallThreadPlan( - generic->GetValue(), "should_step", nullptr, script_error); + generic->GetValue(), "should_step", (Event *) nullptr, script_error); if (script_error) should_step = true; } @@ -1769,6 +1769,24 @@ lldb::StateType ScriptInterpreterPythonImpl::ScriptedThreadPlanGetRunState( return lldb::eStateRunning; } +bool +ScriptInterpreterPythonImpl::ScriptedThreadPlanGetStopDescription( + StructuredData::ObjectSP implementor_sp, lldb_private::Stream *stream, + bool &script_error) { + StructuredData::Generic *generic = nullptr; + if (implementor_sp) + generic = implementor_sp->GetAsGeneric(); + if (!generic) { + script_error = true; + return false; + } + Locker py_lock(this, + Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN); + return LLDBSWIGPythonCallThreadPlan(generic->GetValue(), "stop_description", + stream, script_error); +} + + StructuredData::GenericSP ScriptInterpreterPythonImpl::CreateScriptedBreakpointResolver( const char *class_name, const StructuredDataImpl &args_data, |