From e31d0c20e411f22a943f1ed5f8b618c529436c59 Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Tue, 25 Apr 2023 15:03:15 -0700 Subject: [lldb] Improve breakpoint management for interactive scripted process This patch improves breakpoint management when doing interactive scripted process debugging. In other to know which process set a breakpoint, we need to do some book keeping on the multiplexer scripted process. When initializing the multiplexer, we will first copy breakpoints that are already set on the driving target. Everytime we launch or resume, we should copy breakpoints from the multiplexer to the driving process. When creating a breakpoint from a child process, it needs to be set both on the multiplexer and on the driving process. We also tag the created breakpoint with the name and pid of the originator process. This patch also implements all the requirement to achieve proper breakpoint management. That involves: - Adding python interator for breakpoints and watchpoints in SBTarget - Add a new `ScriptedProcess.create_breakpoint` python method Differential Revision: https://reviews.llvm.org/D148548 Signed-off-by: Med Ismail Bennani --- lldb/source/Interpreter/ScriptInterpreter.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lldb/source/Interpreter/ScriptInterpreter.cpp') diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp index bb3b769..fb3fa74 100644 --- a/lldb/source/Interpreter/ScriptInterpreter.cpp +++ b/lldb/source/Interpreter/ScriptInterpreter.cpp @@ -80,6 +80,11 @@ ScriptInterpreter::GetDataExtractorFromSBData(const lldb::SBData &data) const { return data.m_opaque_sp; } +lldb::BreakpointSP ScriptInterpreter::GetOpaqueTypeFromSBBreakpoint( + const lldb::SBBreakpoint &breakpoint) const { + return breakpoint.m_opaque_wp.lock(); +} + lldb::ProcessAttachInfoSP ScriptInterpreter::GetOpaqueTypeFromSBAttachInfo( const lldb::SBAttachInfo &attach_info) const { return attach_info.m_opaque_sp; -- cgit v1.1