2018-08-16 17:59:38 +00:00
|
|
|
//===-- FunctionBreakpoint.cpp ----------------------------------*- C++ -*-===//
|
|
|
|
|
//
|
2019-01-19 08:50:56 +00:00
|
|
|
// 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
|
2018-08-16 17:59:38 +00:00
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
#include "FunctionBreakpoint.h"
|
2023-10-19 09:48:54 -07:00
|
|
|
#include "DAP.h"
|
2018-08-16 17:59:38 +00:00
|
|
|
|
2023-10-19 09:48:54 -07:00
|
|
|
namespace lldb_dap {
|
2018-08-16 17:59:38 +00:00
|
|
|
|
|
|
|
|
FunctionBreakpoint::FunctionBreakpoint(const llvm::json::Object &obj)
|
2024-02-13 11:38:02 -05:00
|
|
|
: Breakpoint(obj), functionName(std::string(GetString(obj, "name"))) {}
|
2018-08-16 17:59:38 +00:00
|
|
|
|
|
|
|
|
void FunctionBreakpoint::SetBreakpoint() {
|
|
|
|
|
if (functionName.empty())
|
|
|
|
|
return;
|
2023-10-19 09:48:54 -07:00
|
|
|
bp = g_dap.target.BreakpointCreateByName(functionName.c_str());
|
2024-02-13 11:38:02 -05:00
|
|
|
Breakpoint::SetBreakpoint();
|
2018-08-16 17:59:38 +00:00
|
|
|
}
|
|
|
|
|
|
2023-10-19 09:48:54 -07:00
|
|
|
} // namespace lldb_dap
|