xref: /openbsd-src/gnu/llvm/lldb/tools/lldb-vscode/BreakpointBase.h (revision 1a8dbaac879b9f3335ad7fb25429ce63ac1d6bac)
1 //===-- BreakpointBase.h ----------------------------------------*- 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 #ifndef LLDBVSCODE_BREAKPOINTBASE_H_
10 #define LLDBVSCODE_BREAKPOINTBASE_H_
11 
12 #include "JSONUtils.h"
13 #include "lldb/API/SBBreakpoint.h"
14 #include "llvm/Support/JSON.h"
15 #include <string>
16 
17 namespace lldb_vscode {
18 
19 struct BreakpointBase {
20 
21   // An optional expression for conditional breakpoints.
22   std::string condition;
23   // An optional expression that controls how many hits of the breakpoint are
24   // ignored. The backend is expected to interpret the expression as needed
25   std::string hitCondition;
26   // If this attribute exists and is non-empty, the backend must not 'break'
27   // (stop) but log the message instead. Expressions within {} are
28   // interpolated.
29   std::string logMessage;
30   // The LLDB breakpoint associated wit this source breakpoint
31   lldb::SBBreakpoint bp;
32 
33   BreakpointBase() = default;
34   BreakpointBase(const llvm::json::Object &obj);
35 
36   void SetCondition();
37   void SetHitCondition();
38   void UpdateBreakpoint(const BreakpointBase &request_bp);
39 };
40 
41 } // namespace lldb_vscode
42 
43 #endif
44