[Lldb-commits] [lldb] [lldb] [mostly NFC] Large WP foundation: WatchpointResources (PR #68845)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 26 17:19:34 PDT 2023


================
@@ -266,33 +268,73 @@ void Watchpoint::Dump(Stream *s) const {
 
 // If prefix is nullptr, we display the watch id and ignore the prefix
 // altogether.
-void Watchpoint::DumpSnapshots(Stream *s, const char *prefix) const {
-  if (!prefix) {
-    s->Printf("\nWatchpoint %u hit:", GetID());
-    prefix = "";
-  }
+bool Watchpoint::DumpSnapshots(Stream *s, const char *prefix) const {
+  bool printed_anything = false;
----------------
JDevlieghere wrote:

Doesn't look like you actually need this. You change the value exactly once below. I would just return false on line 276 and 337 and true on line 334. I think the return value of a `Dump` function is more self explanatory than having to scroll up and see if `printed_anything` happened to be modified in the 50 lines between 275 and 325. 

https://github.com/llvm/llvm-project/pull/68845


More information about the lldb-commits mailing list