[Lldb-commits] [lldb] [lldb] Convert Breakpoint & Watchpoints structs to classes (NFC) (PR #133780)
John Harrison via lldb-commits
lldb-commits at lists.llvm.org
Mon Mar 31 13:20:11 PDT 2025
================
@@ -52,14 +37,33 @@ struct SourceBreakpoint : public Breakpoint {
static bool BreakpointHitCallback(void *baton, lldb::SBProcess &process,
lldb::SBThread &thread,
lldb::SBBreakpointLocation &location);
-};
-inline bool operator<(const SourceBreakpoint &lhs,
- const SourceBreakpoint &rhs) {
- if (lhs.line == rhs.line)
- return lhs.column < rhs.column;
- return lhs.line < rhs.line;
-}
+ inline bool operator<(const SourceBreakpoint &rhs) {
+ if (line == rhs.line)
+ return column < rhs.column;
+ return line < rhs.line;
+ }
+
+ uint32_t GetLine() const { return line; }
+ uint32_t GetColumn() const { return column; }
+
+protected:
+ // logMessage part can be either a raw text or an expression.
+ struct LogMessagePart {
+ LogMessagePart(llvm::StringRef text, bool is_expr)
+ : text(text), is_expr(is_expr) {}
+ std::string text;
+ bool is_expr;
+ };
+ // If this attribute exists and is non-empty, the backend must not 'break'
+ // (stop) but log the message instead. Expressions within {} are
+ // interpolated.
+ std::string logMessage;
+ std::vector<LogMessagePart> logMessageParts;
+
+ uint32_t line; ///< The source line of the breakpoint or logpoint
+ uint32_t column; ///< An optional source column of the breakpoint
----------------
ashgti wrote:
Nit: `m_`?
https://github.com/llvm/llvm-project/pull/133780
More information about the lldb-commits
mailing list