1 //===-- ExceptionBreakpoint.cpp ---------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "ExceptionBreakpoint.h"
11 #include "VSCode.h"
12 
13 namespace lldb_vscode {
14 
15 void ExceptionBreakpoint::SetBreakpoint() {
16   if (bp.IsValid())
17     return;
18   bool catch_value = filter.find("_catch") != std::string::npos;
19   bool throw_value = filter.find("_throw") != std::string::npos;
20   bp = g_vsc.target.BreakpointCreateForException(language, catch_value,
21                                                  throw_value);
22 }
23 
24 void ExceptionBreakpoint::ClearBreakpoint() {
25   if (!bp.IsValid())
26     return;
27   g_vsc.target.BreakpointDelete(bp.GetID());
28   bp = lldb::SBBreakpoint();
29 }
30 
31 } // namespace lldb_vscode
32 
33