/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 | 1 | : BreakpointBase(obj), line(GetUnsigned(obj, "line", 0)), |
16 | 1 | column(GetUnsigned(obj, "column", 0)) {} |
17 | | |
18 | 1 | void SourceBreakpoint::SetBreakpoint(const llvm::StringRef source_path) { |
19 | 1 | lldb::SBFileSpecList module_list; |
20 | 1 | bp = g_vsc.target.BreakpointCreateByLocation(source_path.str().c_str(), line, |
21 | 1 | column, 0, module_list); |
22 | | // See comments in BreakpointBase::GetBreakpointLabel() for details of why |
23 | | // we add a label to our breakpoints. |
24 | 1 | bp.AddName(GetBreakpointLabel()); |
25 | 1 | if (!condition.empty()) |
26 | 0 | SetCondition(); |
27 | 1 | if (!hitCondition.empty()) |
28 | 0 | SetHitCondition(); |
29 | 1 | if (!logMessage.empty()) |
30 | 0 | SetLogMessage(); |
31 | 1 | } |
32 | | |
33 | | } // namespace lldb_vscode |