blob: 91d1ad70ecd64d8d2de79cf277bad077227bc3f6 [file] [log] [blame]
Greg Clayton2f5cf852018-08-16 17:59:38 +00001//===-- SourceBreakpoint.cpp ------------------------------------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Greg Clayton2f5cf852018-08-16 17:59:38 +00006//
7//===----------------------------------------------------------------------===//
8
9#include "SourceBreakpoint.h"
10#include "VSCode.h"
11
12namespace lldb_vscode {
13
14SourceBreakpoint::SourceBreakpoint(const llvm::json::Object &obj)
15 : BreakpointBase(obj), line(GetUnsigned(obj, "line", 0)),
16 column(GetUnsigned(obj, "column", 0)) {}
17
18void SourceBreakpoint::SetBreakpoint(const llvm::StringRef source_path) {
19 bp = g_vsc.target.BreakpointCreateByLocation(source_path.str().c_str(), line);
20 if (!condition.empty())
21 SetCondition();
22 if (!hitCondition.empty())
23 SetHitCondition();
24}
25
26} // namespace lldb_vscode