summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-vscode/FunctionBreakpoint.cpp
blob: f83333dc9895dd8a8a5bbd18e4f218e3f5585a37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//===-- FunctionBreakpoint.cpp ----------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "FunctionBreakpoint.h"
#include "VSCode.h"

namespace lldb_vscode {

FunctionBreakpoint::FunctionBreakpoint(const llvm::json::Object &obj)
    : BreakpointBase(obj), functionName(GetString(obj, "name")) {}

void FunctionBreakpoint::SetBreakpoint() {
  if (functionName.empty())
    return;
  bp = g_vsc.target.BreakpointCreateByName(functionName.c_str());
  if (!condition.empty())
    SetCondition();
  if (!hitCondition.empty())
    SetHitCondition();
}

}
OpenPOWER on IntegriCloud