convert to_insert_watchpoint
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 17:08:59 +0000 (10:08 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:47:08 +0000 (07:47 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_insert_watchpoint.
* target.h (struct target_ops) <to_insert_watchpoint>: Use
TARGET_DEFAULT_RETURN.

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

index 81fd3f412d70c96afc397d3dcac357bfb90850a3..87eb928e03e6394f9cd659a2d3a359e865c7e31d 100644 (file)
@@ -1,3 +1,11 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target-delegates.c: Rebuild.
+       * target.c (update_current_target): Don't inherit or default
+       to_insert_watchpoint.
+       * target.h (struct target_ops) <to_insert_watchpoint>: Use
+       TARGET_DEFAULT_RETURN.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target-delegates.c: Rebuild.
index da91fb0faec841c97c70b43d2c952527b15b82cf..0d62cffc8c6ae1cb718f1f3380e526dc2ea42755 100644 (file)
@@ -151,6 +151,19 @@ tdefault_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *arg1, st
   return -1;
 }
 
+static int
+delegate_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+{
+  self = self->beneath;
+  return self->to_insert_watchpoint (self, arg1, arg2, arg3, arg4);
+}
+
+static int
+tdefault_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
+{
+  return -1;
+}
+
 static int
 delegate_stopped_by_watchpoint (struct target_ops *self)
 {
@@ -266,6 +279,8 @@ install_delegators (struct target_ops *ops)
     ops->to_insert_hw_breakpoint = delegate_insert_hw_breakpoint;
   if (ops->to_remove_hw_breakpoint == NULL)
     ops->to_remove_hw_breakpoint = delegate_remove_hw_breakpoint;
+  if (ops->to_insert_watchpoint == NULL)
+    ops->to_insert_watchpoint = delegate_insert_watchpoint;
   if (ops->to_stopped_by_watchpoint == NULL)
     ops->to_stopped_by_watchpoint = delegate_stopped_by_watchpoint;
   if (ops->to_stopped_data_address == NULL)
@@ -300,6 +315,7 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_can_use_hw_breakpoint = tdefault_can_use_hw_breakpoint;
   ops->to_insert_hw_breakpoint = tdefault_insert_hw_breakpoint;
   ops->to_remove_hw_breakpoint = tdefault_remove_hw_breakpoint;
+  ops->to_insert_watchpoint = tdefault_insert_watchpoint;
   ops->to_stopped_by_watchpoint = tdefault_stopped_by_watchpoint;
   ops->to_stopped_data_address = tdefault_stopped_data_address;
   ops->to_rcmd = default_rcmd;
index eb9a21c0e0ec7649d563af5235367a2454985d8d..b19eb406f2c540c0771010e28eaec95958c19f91 100644 (file)
@@ -608,7 +608,7 @@ update_current_target (void)
       /* Do not inherit to_insert_hw_breakpoint.  */
       /* Do not inherit to_remove_hw_breakpoint.  */
       /* Do not inherit to_ranged_break_num_registers.  */
-      INHERIT (to_insert_watchpoint, t);
+      /* Do not inherit to_insert_watchpoint.  */
       INHERIT (to_remove_watchpoint, t);
       /* Do not inherit to_insert_mask_watchpoint.  */
       /* Do not inherit to_remove_mask_watchpoint.  */
@@ -734,10 +734,6 @@ update_current_target (void)
            (int (*) (CORE_ADDR, gdb_byte *, int, int,
                      struct mem_attrib *, struct target_ops *))
            nomemory);
-  de_fault (to_insert_watchpoint,
-           (int (*) (struct target_ops *, CORE_ADDR, int, int,
-                     struct expression *))
-           return_minus_one);
   de_fault (to_remove_watchpoint,
            (int (*) (struct target_ops *, CORE_ADDR, int, int,
                      struct expression *))
index 32cf4f6693882b1f621f10643b9b7f9051d9cb60..02ca292a892550f780ce2d0a0286de4422cda290 100644 (file)
@@ -470,7 +470,8 @@ struct target_ops
     int (*to_remove_watchpoint) (struct target_ops *,
                                 CORE_ADDR, int, int, struct expression *);
     int (*to_insert_watchpoint) (struct target_ops *,
-                                CORE_ADDR, int, int, struct expression *);
+                                CORE_ADDR, int, int, struct expression *)
+      TARGET_DEFAULT_RETURN (-1);
 
     int (*to_insert_mask_watchpoint) (struct target_ops *,
                                      CORE_ADDR, CORE_ADDR, int);
This page took 0.035737 seconds and 4 git commands to generate.