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

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 23 17:58:53 PDT 2023


================
@@ -3105,102 +3122,184 @@ Status ProcessGDBRemote::DisableBreakpointSite(BreakpointSite *bp_site) {
 }
 
 // Pre-requisite: wp != NULL.
-static GDBStoppointType GetGDBStoppointType(Watchpoint *wp) {
-  assert(wp);
-  bool watch_read = wp->WatchpointRead();
-  bool watch_write = wp->WatchpointWrite();
-  bool watch_modify = wp->WatchpointModify();
-
-  // watch_read, watch_write, watch_modify cannot all be false.
-  assert((watch_read || watch_write || watch_modify) &&
-         "watch_read, watch_write, watch_modify cannot all be false.");
-  if (watch_read && (watch_write || watch_modify))
+static GDBStoppointType
+GetGDBStoppointType(const WatchpointResourceSP &wp_res_sp) {
+  assert(wp_res_sp);
+  bool read, write;
+  wp_res_sp->GetType(read, write);
+
+  assert((read || write) && "read and write cannot both be false.");
----------------
bulbazord wrote:

The assertion message here could be fleshed out a bit more. Something like `"WatchpointResource type is neither read nor write"`.

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


More information about the lldb-commits mailing list