blob: f2a286c9eca23bf6b09ec60a49d3912591cf5671 [file] [log] [blame]
Greg Clayton2f5cf852018-08-16 17:59:38 +00001//===-- SourceBreakpoint.cpp ------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "SourceBreakpoint.h"
11#include "VSCode.h"
12
13namespace lldb_vscode {
14
15SourceBreakpoint::SourceBreakpoint(const llvm::json::Object &obj)
16 : BreakpointBase(obj), line(GetUnsigned(obj, "line", 0)),
17 column(GetUnsigned(obj, "column", 0)) {}
18
19void SourceBreakpoint::SetBreakpoint(const llvm::StringRef source_path) {
20 bp = g_vsc.target.BreakpointCreateByLocation(source_path.str().c_str(), line);
21 if (!condition.empty())
22 SetCondition();
23 if (!hitCondition.empty())
24 SetHitCondition();
25}
26
27} // namespace lldb_vscode