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

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 25 17:10:09 PDT 2023


JDevlieghere added inline comments.


================
Comment at: lldb/source/Breakpoint/Watchpoint.cpp:127
+
+bool Watchpoint::VariableWatchpointDisabler(void *baton,
+                                            StoppointCallbackContext *context,
----------------
mib wrote:
> 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
That's unfortunate but makes sense. Thanks for clarifying. 


================
Comment at: lldb/source/Breakpoint/Watchpoint.cpp:140
+
+  LLDB_LOGF(log, "Watchpoint::%s called by breakpoint %" PRIu64 ".%" PRIu64,
+            __FUNCTION__, break_id, break_loc_id);
----------------
mib wrote:
> 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.
`LLVM_PRETTY_FUNCTION` is an llvm define, it expands to the appropriate macro based on the host compiler. You can totally use it but you must include `Compiler.h`.


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