1//===-- FunctionBreakpoint.cpp ----------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "FunctionBreakpoint.h"
10#include "DAP.h"
11
12namespace lldb_dap {
13
14FunctionBreakpoint::FunctionBreakpoint(const llvm::json::Object &obj)
15 : Breakpoint(obj), functionName(std::string(GetString(obj, key: "name"))) {}
16
17void FunctionBreakpoint::SetBreakpoint() {
18 if (functionName.empty())
19 return;
20 bp = g_dap.target.BreakpointCreateByName(symbol_name: functionName.c_str());
21 Breakpoint::SetBreakpoint();
22}
23
24} // namespace lldb_dap
25

source code of lldb/tools/lldb-dap/FunctionBreakpoint.cpp