[NFC][Coroutines] Use structured binding with llvm::enumerate in CoroSplit (#116879)
[llvm-project.git] / lldb / tools / lldb-dap / FunctionBreakpoint.cpp
blobf266d751833c79fd6cecf9868da38aa8a6fc3fd6
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 //===----------------------------------------------------------------------===//
9 #include "FunctionBreakpoint.h"
10 #include "DAP.h"
11 #include "JSONUtils.h"
13 namespace lldb_dap {
15 FunctionBreakpoint::FunctionBreakpoint(DAP &d, const llvm::json::Object &obj)
16 : Breakpoint(d, obj), functionName(std::string(GetString(obj, "name"))) {}
18 void FunctionBreakpoint::SetBreakpoint() {
19 if (functionName.empty())
20 return;
21 bp = dap.target.BreakpointCreateByName(functionName.c_str());
22 Breakpoint::SetBreakpoint();
25 } // namespace lldb_dap