[Lldb-commits] [lldb] [lldb][NFC] Refactor Watchpoint class (PR #163695)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 31 06:07:42 PDT 2025


================
@@ -74,17 +74,31 @@ class Watchpoint : public std::enable_shared_from_this<Watchpoint>,
 
   bool ShouldStop(StoppointCallbackContext *context) override;
 
-  bool WatchpointRead() const;
-  bool WatchpointWrite() const;
-  bool WatchpointModify() const;
+  bool WatchpointRead() const { return m_watch_type & LLDB_WATCH_TYPE_READ; }
+  bool WatchpointWrite() const { return m_watch_type & LLDB_WATCH_TYPE_WRITE; }
+  bool WatchpointModify() const {
+    return m_watch_type & LLDB_WATCH_TYPE_MODIFY;
+  }
+
   uint32_t GetIgnoreCount() const;
   void SetIgnoreCount(uint32_t n);
   void SetWatchpointType(uint32_t type, bool notify = true);
   void SetDeclInfo(const std::string &str);
-  std::string GetWatchSpec();
+  std::string GetWatchSpec() const;
----------------
DavidSpickett wrote:

Could be a separate change, it's a correctness improvement on its own.

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


More information about the lldb-commits mailing list