diff options
| author | jimingham <jingham@apple.com> | 2025-10-09 08:37:21 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-09 08:37:21 -0700 |
| commit | 36bce68b97316363085ae3681e8dde33a62fc9b1 (patch) | |
| tree | a7d732cc45aae98d91fc8747efd27c655ea5c423 /lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h | |
| parent | c4f36758b73fbf651650d8b650347e0ac172795f (diff) | |
Add a scripted way to re-present a stop location (#158128)
This patch adds the notion of "Facade" locations which can be reported
from a ScriptedResolver instead of the actual underlying breakpoint
location for the breakpoint. Also add a "was_hit" method to the scripted
resolver that allows the breakpoint to say which of these "Facade"
locations was hit, and "get_location_description" to provide a
description for the facade locations.
I apologize in advance for the size of the patch. Almost all of what's
here was necessary to (a) make the feature testable and (b) not break
any of the current behavior.
The motivation for this feature is given in the "Providing Facade
Locations" section that I added to the python-reference.rst so I won't
repeat it here.
rdar://152112327
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h')
| -rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h index f769d3d29add..2335b2ef0f17 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h @@ -436,6 +436,10 @@ protected: return python::SWIGBridge::ToSWIGWrapper(arg); } + python::PythonObject Transform(lldb::BreakpointLocationSP arg) { + return python::SWIGBridge::ToSWIGWrapper(arg); + } + python::PythonObject Transform(lldb::ProcessSP arg) { return python::SWIGBridge::ToSWIGWrapper(arg); } @@ -464,10 +468,18 @@ protected: return python::SWIGBridge::ToSWIGWrapper(arg.get()); } + python::PythonObject Transform(lldb::StackFrameSP arg) { + return python::SWIGBridge::ToSWIGWrapper(arg); + } + python::PythonObject Transform(lldb::DataExtractorSP arg) { return python::SWIGBridge::ToSWIGWrapper(arg); } + python::PythonObject Transform(lldb::DescriptionLevel arg) { + return python::SWIGBridge::ToSWIGWrapper(arg); + } + template <typename T, typename U> void ReverseTransform(T &original_arg, U transformed_arg, Status &error) { // If U is not a PythonObject, don't touch it! @@ -574,11 +586,21 @@ ScriptedPythonInterface::ExtractValueFromPythonObject<lldb::StreamSP>( python::PythonObject &p, Status &error); template <> +lldb::StackFrameSP +ScriptedPythonInterface::ExtractValueFromPythonObject<lldb::StackFrameSP>( + python::PythonObject &p, Status &error); + +template <> lldb::BreakpointSP ScriptedPythonInterface::ExtractValueFromPythonObject<lldb::BreakpointSP>( python::PythonObject &p, Status &error); template <> +lldb::BreakpointLocationSP +ScriptedPythonInterface::ExtractValueFromPythonObject< + lldb::BreakpointLocationSP>(python::PythonObject &p, Status &error); + +template <> lldb::ProcessAttachInfoSP ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ProcessAttachInfoSP>(python::PythonObject &p, Status &error); @@ -601,6 +623,11 @@ lldb::ExecutionContextRefSP ScriptedPythonInterface::ExtractValueFromPythonObject< lldb::ExecutionContextRefSP>(python::PythonObject &p, Status &error); +template <> +lldb::DescriptionLevel +ScriptedPythonInterface::ExtractValueFromPythonObject<lldb::DescriptionLevel>( + python::PythonObject &p, Status &error); + } // namespace lldb_private #endif // LLDB_ENABLE_PYTHON |
