From c2be702104284cb3facf31124494b9a400296179 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Tue, 2 May 2023 13:41:07 -0700 Subject: Allow scripted thread plans to modify the thread stop description when they are completed. --- .../Python/ScriptInterpreterPython.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp') 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, -- cgit v1.1