Coverage Report

Created: 2023-09-21 18:56

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/tools/lldb-vscode/ExceptionBreakpoint.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- ExceptionBreakpoint.cpp ---------------------------------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "ExceptionBreakpoint.h"
10
#include "BreakpointBase.h"
11
#include "VSCode.h"
12
13
namespace lldb_vscode {
14
15
0
void ExceptionBreakpoint::SetBreakpoint() {
16
0
  if (bp.IsValid())
17
0
    return;
18
0
  bool catch_value = filter.find("_catch") != std::string::npos;
19
0
  bool throw_value = filter.find("_throw") != std::string::npos;
20
0
  bp = g_vsc.target.BreakpointCreateForException(language, catch_value,
21
0
                                                 throw_value);
22
  // See comments in BreakpointBase::GetBreakpointLabel() for details of why
23
  // we add a label to our breakpoints.
24
0
  bp.AddName(BreakpointBase::GetBreakpointLabel());
25
0
}
26
27
0
void ExceptionBreakpoint::ClearBreakpoint() {
28
0
  if (!bp.IsValid())
29
0
    return;
30
0
  g_vsc.target.BreakpointDelete(bp.GetID());
31
0
  bp = lldb::SBBreakpoint();
32
0
}
33
34
} // namespace lldb_vscode