[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:12 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;
+ };
----------------
ashgti wrote:
I think other kinds of breakpoints can have log messages. Should we make this into its own helper that is shared between all the BP types?
https://github.com/llvm/llvm-project/pull/133780
More information about the lldb-commits
mailing list