convert to_remove_mask_watchpoint
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 21:33:28 +0000 (14:33 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:48:09 +0000 (07:48 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* target-delegates.c: Rebuild.
* target.c (target_remove_mask_watchpoint): Unconditionally
delegate.
* target.h (struct target_ops) <to_remove_mask_watchpoint>: Use
TARGET_DEFAULT_RETURN.

gdb/ChangeLog
gdb/target-delegates.c
gdb/target.c
gdb/target.h

index 0f6bd76..45d853c 100644 (file)
@@ -1,6 +1,14 @@
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target-delegates.c: Rebuild.
+       * target.c (target_remove_mask_watchpoint): Unconditionally
+       delegate.
+       * target.h (struct target_ops) <to_remove_mask_watchpoint>: Use
+       TARGET_DEFAULT_RETURN.
+
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target-delegates.c: Rebuild.
        * target.c (target_insert_mask_watchpoint): Unconditionally
        delegate.
        * target.h (struct target_ops) <to_insert_mask_watchpoint>: Use
index 934f302..164739d 100644 (file)
@@ -216,6 +216,19 @@ tdefault_insert_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_A
 }
 
 static int
+delegate_remove_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3)
+{
+  self = self->beneath;
+  return self->to_remove_mask_watchpoint (self, arg1, arg2, arg3);
+}
+
+static int
+tdefault_remove_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3)
+{
+  return 1;
+}
+
+static int
 delegate_stopped_by_watchpoint (struct target_ops *self)
 {
   self = self->beneath;
@@ -1151,6 +1164,8 @@ install_delegators (struct target_ops *ops)
     ops->to_insert_watchpoint = delegate_insert_watchpoint;
   if (ops->to_insert_mask_watchpoint == NULL)
     ops->to_insert_mask_watchpoint = delegate_insert_mask_watchpoint;
+  if (ops->to_remove_mask_watchpoint == NULL)
+    ops->to_remove_mask_watchpoint = delegate_remove_mask_watchpoint;
   if (ops->to_stopped_by_watchpoint == NULL)
     ops->to_stopped_by_watchpoint = delegate_stopped_by_watchpoint;
   if (ops->to_stopped_data_address == NULL)
@@ -1324,6 +1339,7 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_remove_watchpoint = tdefault_remove_watchpoint;
   ops->to_insert_watchpoint = tdefault_insert_watchpoint;
   ops->to_insert_mask_watchpoint = tdefault_insert_mask_watchpoint;
+  ops->to_remove_mask_watchpoint = tdefault_remove_mask_watchpoint;
   ops->to_stopped_by_watchpoint = tdefault_stopped_by_watchpoint;
   ops->to_stopped_data_address = tdefault_stopped_data_address;
   ops->to_watchpoint_addr_within_range = default_watchpoint_addr_within_range;
index 11f3b7e..6f1c1bc 100644 (file)
@@ -3850,25 +3850,18 @@ target_insert_mask_watchpoint (%s, %s, %d) = %d\n",
 int
 target_remove_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask, int rw)
 {
-  struct target_ops *t;
-
-  for (t = current_target.beneath; t != NULL; t = t->beneath)
-    if (t->to_remove_mask_watchpoint != NULL)
-      {
-       int ret;
+  int ret;
 
-       ret = t->to_remove_mask_watchpoint (t, addr, mask, rw);
+  ret = current_target.to_remove_mask_watchpoint (&current_target,
+                                                 addr, mask, rw);
 
-       if (targetdebug)
-         fprintf_unfiltered (gdb_stdlog, "\
+  if (targetdebug)
+    fprintf_unfiltered (gdb_stdlog, "\
 target_remove_mask_watchpoint (%s, %s, %d) = %d\n",
-                             core_addr_to_string (addr),
-                             core_addr_to_string (mask), rw, ret);
-
-       return ret;
-      }
+                       core_addr_to_string (addr),
+                       core_addr_to_string (mask), rw, ret);
 
-  return 1;
+  return ret;
 }
 
 /* The documentation for this function is in its prototype declaration
index 012231f..4af2148 100644 (file)
@@ -480,7 +480,8 @@ struct target_ops
                                      CORE_ADDR, CORE_ADDR, int)
       TARGET_DEFAULT_RETURN (1);
     int (*to_remove_mask_watchpoint) (struct target_ops *,
-                                     CORE_ADDR, CORE_ADDR, int);
+                                     CORE_ADDR, CORE_ADDR, int)
+      TARGET_DEFAULT_RETURN (1);
     int (*to_stopped_by_watchpoint) (struct target_ops *)
       TARGET_DEFAULT_RETURN (0);
     int to_have_steppable_watchpoint;