Coverage Report

Created: 2022-01-25 06:29

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/tools/lldb-vscode/SourceBreakpoint.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- SourceBreakpoint.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 "SourceBreakpoint.h"
10
#include "VSCode.h"
11
12
namespace lldb_vscode {
13
14
SourceBreakpoint::SourceBreakpoint(const llvm::json::Object &obj)
15
    : BreakpointBase(obj), line(GetUnsigned(obj, "line", 0)),
16
0
      column(GetUnsigned(obj, "column", 0)) {}
17
18
0
void SourceBreakpoint::SetBreakpoint(const llvm::StringRef source_path) {
19
0
  bp = g_vsc.target.BreakpointCreateByLocation(source_path.str().c_str(), line);
20
  // See comments in BreakpointBase::GetBreakpointLabel() for details of why
21
  // we add a label to our breakpoints.
22
0
  bp.AddName(GetBreakpointLabel());
23
0
  if (!condition.empty())
24
0
    SetCondition();
25
0
  if (!hitCondition.empty())
26
0
    SetHitCondition();
27
0
}
28
29
} // namespace lldb_vscode