1 //===-- SourceBreakpoint.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 LLDB_TOOLS_LLDB_VSCODE_SOURCEBREAKPOINT_H
10 #define LLDB_TOOLS_LLDB_VSCODE_SOURCEBREAKPOINT_H
11 
12 #include "BreakpointBase.h"
13 #include "llvm/ADT/StringRef.h"
14 
15 namespace lldb_vscode {
16 
17 struct SourceBreakpoint : public BreakpointBase {
18 
19   uint32_t line;   ///< The source line of the breakpoint or logpoint
20   uint32_t column; ///< An optional source column of the breakpoint
21 
SourceBreakpointSourceBreakpoint22   SourceBreakpoint() : BreakpointBase(), line(0), column(0) {}
23   SourceBreakpoint(const llvm::json::Object &obj);
24 
25   // Set this breakpoint in LLDB as a new breakpoint
26   void SetBreakpoint(const llvm::StringRef source_path);
27 };
28 
29 inline bool operator<(const SourceBreakpoint &lhs,
30                       const SourceBreakpoint &rhs) {
31   if (lhs.line == rhs.line)
32     return lhs.column < rhs.column;
33   return lhs.line < rhs.line;
34 }
35 
36 } // namespace lldb_vscode
37 
38 #endif
39