[Lldb-commits] [PATCH] D151366: [lldb] Disable variable watchpoints when going out of scope

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 25 16:51:40 PDT 2023


mib marked an inline comment as done.
mib added inline comments.


================
Comment at: lldb/source/Breakpoint/Watchpoint.cpp:127
+
+bool Watchpoint::VariableWatchpointDisabler(void *baton,
+                                            StoppointCallbackContext *context,
----------------
JDevlieghere wrote:
> I think this should return an `llvm::Error` and log it at the call site. For every early return we know what went wrong. Same for `SetupVariableWatchpointDisabler`.
This is a WatchpointCallback so it have to match a specific function signature (and return a `bool`). I could change `SetupVariableWatchpointDisabler` to return an `llvm::Error` in a follow-up


================
Comment at: lldb/source/Breakpoint/Watchpoint.cpp:140
+
+  LLDB_LOGF(log, "Watchpoint::%s called by breakpoint %" PRIu64 ".%" PRIu64,
+            __FUNCTION__, break_id, break_loc_id);
----------------
JDevlieghere wrote:
> Doesn't __FUNCTION__ already include `Watchpoint::`? Also I think there's a flag to include the function name in the log, so this is redundant. 
No, it only prints the method name, `LLVM_PRETTY_FUNCTION` prints everything but I think that macro is not defined with other compiler.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151366/new/

https://reviews.llvm.org/D151366



More information about the lldb-commits mailing list