1 //===-- InstructionBreakpoint.cpp ------------------------------------*- C++
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #include "InstructionBreakpoint.h"
12 #include "JSONUtils.h"
13 #include "lldb/API/SBBreakpoint.h"
14 #include "lldb/API/SBTarget.h"
15 #include "llvm/ADT/StringRef.h"
19 // Instruction Breakpoint
20 InstructionBreakpoint::InstructionBreakpoint(DAP
&d
,
21 const llvm::json::Object
&obj
)
22 : Breakpoint(d
, obj
), instructionAddressReference(LLDB_INVALID_ADDRESS
),
23 offset(GetSigned(obj
, "offset", 0)) {
24 GetString(obj
, "instructionReference")
25 .getAsInteger(0, instructionAddressReference
);
26 instructionAddressReference
+= offset
;
29 void InstructionBreakpoint::SetBreakpoint() {
30 bp
= dap
.target
.BreakpointCreateByAddress(instructionAddressReference
);
31 Breakpoint::SetBreakpoint();
34 } // namespace lldb_dap