forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExceptionBreakpoint.cpp
33 lines (28 loc) · 1.07 KB
/
ExceptionBreakpoint.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//===-- ExceptionBreakpoint.cpp ---------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "ExceptionBreakpoint.h"
#include "BreakpointBase.h"
#include "DAP.h"
#include "lldb/API/SBTarget.h"
namespace lldb_dap {
void ExceptionBreakpoint::SetBreakpoint() {
if (m_bp.IsValid())
return;
bool catch_value = m_filter.find("_catch") != std::string::npos;
bool throw_value = m_filter.find("_throw") != std::string::npos;
m_bp = m_dap.target.BreakpointCreateForException(m_language, catch_value,
throw_value);
m_bp.AddName(BreakpointBase::kDAPBreakpointLabel);
}
void ExceptionBreakpoint::ClearBreakpoint() {
if (!m_bp.IsValid())
return;
m_dap.target.BreakpointDelete(m_bp.GetID());
m_bp = lldb::SBBreakpoint();
}
} // namespace lldb_dap