diff options
Diffstat (limited to 'lldb/tools/lldb-vscode/ExceptionBreakpoint.cpp')
-rw-r--r-- | lldb/tools/lldb-vscode/ExceptionBreakpoint.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lldb/tools/lldb-vscode/ExceptionBreakpoint.cpp b/lldb/tools/lldb-vscode/ExceptionBreakpoint.cpp new file mode 100644 index 00000000000..96bc0930e42 --- /dev/null +++ b/lldb/tools/lldb-vscode/ExceptionBreakpoint.cpp @@ -0,0 +1,32 @@ +//===-- ExceptionBreakpoint.cpp ---------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "ExceptionBreakpoint.h" +#include "VSCode.h" + +namespace lldb_vscode { + +void ExceptionBreakpoint::SetBreakpoint() { + if (bp.IsValid()) + return; + bool catch_value = filter.find("_catch") != std::string::npos; + bool throw_value = filter.find("_throw") != std::string::npos; + bp = g_vsc.target.BreakpointCreateForException(language, catch_value, + throw_value); +} + +void ExceptionBreakpoint::ClearBreakpoint() { + if (!bp.IsValid()) + return; + g_vsc.target.BreakpointDelete(bp.GetID()); + bp = lldb::SBBreakpoint(); +} + +} // namespace lldb_vscode + |