diff options
Diffstat (limited to 'lldb/tools/lldb-vscode/SourceBreakpoint.h')
-rw-r--r-- | lldb/tools/lldb-vscode/SourceBreakpoint.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lldb/tools/lldb-vscode/SourceBreakpoint.h b/lldb/tools/lldb-vscode/SourceBreakpoint.h new file mode 100644 index 00000000000..8af647ca8fe --- /dev/null +++ b/lldb/tools/lldb-vscode/SourceBreakpoint.h @@ -0,0 +1,39 @@ +//===-- SourceBreakpoint.h --------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDBVSCODE_SOURCEBREAKPOINT_H_ +#define LLDBVSCODE_SOURCEBREAKPOINT_H_ + +#include "llvm/ADT/StringRef.h" +#include "BreakpointBase.h" + +namespace lldb_vscode { + +struct SourceBreakpoint : public BreakpointBase { + + uint32_t line; ///< The source line of the breakpoint or logpoint + uint32_t column; ///< An optional source column of the breakpoint + + SourceBreakpoint() : BreakpointBase(), line(0), column(0) {} + SourceBreakpoint(const llvm::json::Object &obj); + + // Set this breakpoint in LLDB as a new breakpoint + void SetBreakpoint(const llvm::StringRef source_path); +}; + +inline bool operator<(const SourceBreakpoint &lhs, + const SourceBreakpoint &rhs) { + if (lhs.line == rhs.line) + return lhs.column < rhs.column; + return lhs.line < rhs.line; +} + +} // namespace lldb_vscode + +#endif |