Files
clang-p2996/lldb/tools/lldb-dap/InstructionBreakpoint.cpp
Adrian Vogelsgesang 09c258ef6a [NFC][lldb-dap] Clean-up includes (#113839)
This commit cleans up the includes in the `lldb-dap` subfolder. The main
motivation was that I got annoyed by `clangd` always complaining about
unused includes while working on lldb-dap.
2024-10-28 11:01:57 +01:00

30 lines
1018 B
C++

//===-- InstructionBreakpoint.cpp ------------------------------------*- C++
//-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "InstructionBreakpoint.h"
#include "DAP.h"
#include "JSONUtils.h"
namespace lldb_dap {
// Instruction Breakpoint
InstructionBreakpoint::InstructionBreakpoint(const llvm::json::Object &obj)
: Breakpoint(obj), instructionAddressReference(LLDB_INVALID_ADDRESS), id(0),
offset(GetSigned(obj, "offset", 0)) {
GetString(obj, "instructionReference")
.getAsInteger(0, instructionAddressReference);
instructionAddressReference += offset;
}
void InstructionBreakpoint::SetInstructionBreakpoint() {
bp = g_dap.target.BreakpointCreateByAddress(instructionAddressReference);
id = bp.GetID();
}
} // namespace lldb_dap