diff options
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.cpp')
| -rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.cpp index 660edaa0191f..c9bb38d213c9 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.cpp @@ -81,6 +81,32 @@ std::optional<std::string> ScriptedBreakpointPythonInterface::GetShortHelp() { return obj->GetAsString()->GetValue().str(); } +lldb::BreakpointLocationSP ScriptedBreakpointPythonInterface::WasHit( + lldb::StackFrameSP frame_sp, lldb::BreakpointLocationSP bp_loc_sp) { + Status py_error; + lldb::BreakpointLocationSP loc_sp = Dispatch<lldb::BreakpointLocationSP>( + "was_hit", py_error, frame_sp, bp_loc_sp); + + if (py_error.Fail()) + return bp_loc_sp; + + return loc_sp; +} + +std::optional<std::string> +ScriptedBreakpointPythonInterface::GetLocationDescription( + lldb::BreakpointLocationSP bp_loc_sp, lldb::DescriptionLevel level) { + Status error; + StructuredData::ObjectSP obj = + Dispatch("get_location_description", error, bp_loc_sp, level); + + if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, + error)) + return {}; + + return obj->GetAsString()->GetValue().str(); +} + void ScriptedBreakpointPythonInterface::Initialize() { const std::vector<llvm::StringRef> ci_usages = { "breakpoint set -P classname [-k key -v value ...]"}; |
