================
@@ -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;
   void SetWatchSpec(const std::string &str);
   bool WatchedValueReportable(const ExecutionContext &exe_ctx);
 
+  // This function determines whether we should report a watchpoint value
+  // change. Specifically, it checks the watchpoint condition (if present),
+  // ignore count and so on.
----------------
DavidSpickett wrote:

This phrasing is a bit contradictory.

> Specifically, it checks the watchpoint condition (if present), ignore count 
> and so on.

Specifically implies the list following it is specific and complete. You could 
say "This includes the watchpoint condition...." instead.

Or maybe you wanted to make it clear that it only uses the watchpoint's 
attributes to make the decision. As opposed to some other lldb user setting for 
example. So put some "includes X but nothing else" if that was the intent here.

https://github.com/llvm/llvm-project/pull/163695
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to