diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:06:29 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:06:29 +0000 |
commit | 94994d372d014ce4c8758b9605d63fae651bd8aa (patch) | |
tree | 51c0b708bd59f205d6b35cb2a8c24d62f0c33d77 /tools/lldb-vscode/ExceptionBreakpoint.cpp | |
parent | 39be7ce23363d12ae3e49aeb1fdb2bfeb892e836 (diff) |
Notes
Diffstat (limited to 'tools/lldb-vscode/ExceptionBreakpoint.cpp')
-rw-r--r-- | tools/lldb-vscode/ExceptionBreakpoint.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/lldb-vscode/ExceptionBreakpoint.cpp b/tools/lldb-vscode/ExceptionBreakpoint.cpp new file mode 100644 index 000000000000..96bc0930e429 --- /dev/null +++ b/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 + |