summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-vscode/FunctionBreakpoint.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/tools/lldb-vscode/FunctionBreakpoint.cpp')
-rw-r--r--lldb/tools/lldb-vscode/FunctionBreakpoint.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/lldb/tools/lldb-vscode/FunctionBreakpoint.cpp b/lldb/tools/lldb-vscode/FunctionBreakpoint.cpp
new file mode 100644
index 00000000000..f83333dc989
--- /dev/null
+++ b/lldb/tools/lldb-vscode/FunctionBreakpoint.cpp
@@ -0,0 +1,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