diff options
Diffstat (limited to 'lldb/tools/lldb-vscode/SourceBreakpoint.cpp')
-rw-r--r-- | lldb/tools/lldb-vscode/SourceBreakpoint.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lldb/tools/lldb-vscode/SourceBreakpoint.cpp b/lldb/tools/lldb-vscode/SourceBreakpoint.cpp new file mode 100644 index 00000000000..f2a286c9eca --- /dev/null +++ b/lldb/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 |