convert to_insert_mask_watchpoint
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 21:32:43 +0000 (14:32 -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_insert_mask_watchpoint): Unconditionally
delegate.
* target.h (struct target_ops) <to_insert_mask_watchpoint>: Use
TARGET_DEFAULT_RETURN.

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

index 1e001189b9316b2f94523457f9e9a31fcfd8a49c..0f6bd76bf3b3aa287c51b2aefbf7053b519bea32 100644 (file)
@@ -1,3 +1,11 @@
+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
+       TARGET_DEFAULT_RETURN.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target-delegates.c: Rebuild.
index 3def7634c1825f0f68998c66a9b7f98ec9cdcfad..934f3021eac6cefeaf95ea80085ba8ef64f509bd 100644 (file)
@@ -202,6 +202,19 @@ tdefault_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, i
   return -1;
 }
 
+static int
+delegate_insert_mask_watchpoint (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3)
+{
+  self = self->beneath;
+  return self->to_insert_mask_watchpoint (self, arg1, arg2, arg3);
+}
+
+static int
+tdefault_insert_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)
 {
@@ -1136,6 +1149,8 @@ install_delegators (struct target_ops *ops)
     ops->to_remove_watchpoint = delegate_remove_watchpoint;
   if (ops->to_insert_watchpoint == NULL)
     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_stopped_by_watchpoint == NULL)
     ops->to_stopped_by_watchpoint = delegate_stopped_by_watchpoint;
   if (ops->to_stopped_data_address == NULL)
@@ -1308,6 +1323,7 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_remove_hw_breakpoint = tdefault_remove_hw_breakpoint;
   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_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 d4e58b06bfe399e75e44a2128fee7cf71bc6c086..11f3b7e04b402ecc25555c01af961c65508082c7 100644 (file)
@@ -3830,25 +3830,18 @@ target_verify_memory (const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size)
 int
 target_insert_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_insert_mask_watchpoint != NULL)
-      {
-       int ret;
+  int ret;
 
-       ret = t->to_insert_mask_watchpoint (t, addr, mask, rw);
+  ret = current_target.to_insert_mask_watchpoint (&current_target,
+                                                 addr, mask, rw);
 
-       if (targetdebug)
-         fprintf_unfiltered (gdb_stdlog, "\
+  if (targetdebug)
+    fprintf_unfiltered (gdb_stdlog, "\
 target_insert_mask_watchpoint (%s, %s, %d) = %d\n",
-                             core_addr_to_string (addr),
-                             core_addr_to_string (mask), rw, ret);
-
-       return ret;
-      }
-
-  return 1;
+                       core_addr_to_string (addr),
+                       core_addr_to_string (mask), rw, ret);
+  
+  return ret;
 }
 
 /* The documentation for this function is in its prototype declaration in
index 25e98ed35b24614ef790e73454d07334da3b2048..012231f795b6bd60c8a54786ebba2425bff8f8bc 100644 (file)
@@ -477,7 +477,8 @@ struct target_ops
       TARGET_DEFAULT_RETURN (-1);
 
     int (*to_insert_mask_watchpoint) (struct target_ops *,
-                                     CORE_ADDR, CORE_ADDR, int);
+                                     CORE_ADDR, CORE_ADDR, int)
+      TARGET_DEFAULT_RETURN (1);
     int (*to_remove_mask_watchpoint) (struct target_ops *,
                                      CORE_ADDR, CORE_ADDR, int);
     int (*to_stopped_by_watchpoint) (struct target_ops *)
This page took 0.035686 seconds and 4 git commands to generate.