summaryrefslogtreecommitdiff
path: root/tools/lldb-vscode/SourceBreakpoint.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-01-19 10:06:29 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-01-19 10:06:29 +0000
commit94994d372d014ce4c8758b9605d63fae651bd8aa (patch)
tree51c0b708bd59f205d6b35cb2a8c24d62f0c33d77 /tools/lldb-vscode/SourceBreakpoint.cpp
parent39be7ce23363d12ae3e49aeb1fdb2bfeb892e836 (diff)
Notes
Diffstat (limited to 'tools/lldb-vscode/SourceBreakpoint.cpp')
-rw-r--r--tools/lldb-vscode/SourceBreakpoint.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/lldb-vscode/SourceBreakpoint.cpp b/tools/lldb-vscode/SourceBreakpoint.cpp
new file mode 100644
index 000000000000..f2a286c9eca2
--- /dev/null
+++ b/tools/lldb-vscode/SourceBreakpoint.cpp
@@ -0,0 +1,27 @@
+//===-- SourceBreakpoint.cpp ------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "SourceBreakpoint.h"
+#include "VSCode.h"
+
+namespace lldb_vscode {
+
+SourceBreakpoint::SourceBreakpoint(const llvm::json::Object &obj)
+ : BreakpointBase(obj), line(GetUnsigned(obj, "line", 0)),
+ column(GetUnsigned(obj, "column", 0)) {}
+
+void SourceBreakpoint::SetBreakpoint(const llvm::StringRef source_path) {
+ bp = g_vsc.target.BreakpointCreateByLocation(source_path.str().c_str(), line);
+ if (!condition.empty())
+ SetCondition();
+ if (!hitCondition.empty())
+ SetHitCondition();
+}
+
+} // namespace lldb_vscode