diff --git a/lldb/tools/lldb-dap/InstructionBreakpoint.cpp b/lldb/tools/lldb-dap/InstructionBreakpoint.cpp index ddae1a8b20243..89a0983b07809 100644 --- a/lldb/tools/lldb-dap/InstructionBreakpoint.cpp +++ b/lldb/tools/lldb-dap/InstructionBreakpoint.cpp @@ -18,14 +18,16 @@ namespace lldb_dap { InstructionBreakpoint::InstructionBreakpoint( DAP &d, const protocol::InstructionBreakpoint &breakpoint) : Breakpoint(d, breakpoint.condition, breakpoint.hitCondition), - m_instruction_address_reference(LLDB_INVALID_ADDRESS), - m_offset(breakpoint.offset.value_or(0)) { + m_instruction_address_reference(LLDB_INVALID_ADDRESS) { llvm::StringRef instruction_reference(breakpoint.instructionReference); instruction_reference.getAsInteger(0, m_instruction_address_reference); - m_instruction_address_reference += m_offset; + m_instruction_address_reference += breakpoint.offset.value_or(0); } void InstructionBreakpoint::SetBreakpoint() { + lldb::SBMutex lock = m_dap.GetAPIMutex(); + std::lock_guard guard(lock); + m_bp = m_dap.target.BreakpointCreateByAddress(m_instruction_address_reference); Breakpoint::SetBreakpoint(); diff --git a/lldb/tools/lldb-dap/InstructionBreakpoint.h b/lldb/tools/lldb-dap/InstructionBreakpoint.h index a8c8f2113e5eb..578926871f99b 100644 --- a/lldb/tools/lldb-dap/InstructionBreakpoint.h +++ b/lldb/tools/lldb-dap/InstructionBreakpoint.h @@ -33,7 +33,6 @@ class InstructionBreakpoint : public Breakpoint { protected: lldb::addr_t m_instruction_address_reference; - int32_t m_offset; }; } // namespace lldb_dap