+2014-02-19 Tom Tromey <tromey@redhat.com>
+
+ * target-delegates.c: Rebuild.
+ * target.c (target_masked_watch_num_registers): Unconditionally
+ delegate.
+ * target.h (struct target_ops) <to_masked_watch_num_registers>:
+ Use TARGET_DEFAULT_RETURN.
+
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
return 0;
}
+static int
+delegate_masked_watch_num_registers (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2)
+{
+ self = self->beneath;
+ return self->to_masked_watch_num_registers (self, arg1, arg2);
+}
+
+static int
+tdefault_masked_watch_num_registers (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2)
+{
+ return -1;
+}
+
static void
delegate_terminal_init (struct target_ops *self)
{
ops->to_region_ok_for_hw_watchpoint = delegate_region_ok_for_hw_watchpoint;
if (ops->to_can_accel_watchpoint_condition == NULL)
ops->to_can_accel_watchpoint_condition = delegate_can_accel_watchpoint_condition;
+ if (ops->to_masked_watch_num_registers == NULL)
+ ops->to_masked_watch_num_registers = delegate_masked_watch_num_registers;
if (ops->to_terminal_init == NULL)
ops->to_terminal_init = delegate_terminal_init;
if (ops->to_terminal_inferior == NULL)
ops->to_watchpoint_addr_within_range = default_watchpoint_addr_within_range;
ops->to_region_ok_for_hw_watchpoint = default_region_ok_for_hw_watchpoint;
ops->to_can_accel_watchpoint_condition = tdefault_can_accel_watchpoint_condition;
+ ops->to_masked_watch_num_registers = tdefault_masked_watch_num_registers;
ops->to_terminal_init = tdefault_terminal_init;
ops->to_terminal_inferior = tdefault_terminal_inferior;
ops->to_terminal_ours_for_output = tdefault_terminal_ours_for_output;
int
target_masked_watch_num_registers (CORE_ADDR addr, CORE_ADDR mask)
{
- struct target_ops *t;
-
- for (t = current_target.beneath; t != NULL; t = t->beneath)
- if (t->to_masked_watch_num_registers != NULL)
- return t->to_masked_watch_num_registers (t, addr, mask);
-
- return -1;
+ return current_target.to_masked_watch_num_registers (¤t_target,
+ addr, mask);
}
/* The documentation for this function is in its prototype declaration
struct expression *)
TARGET_DEFAULT_RETURN (0);
int (*to_masked_watch_num_registers) (struct target_ops *,
- CORE_ADDR, CORE_ADDR);
+ CORE_ADDR, CORE_ADDR)
+ TARGET_DEFAULT_RETURN (-1);
void (*to_terminal_init) (struct target_ops *)
TARGET_DEFAULT_IGNORE ();
void (*to_terminal_inferior) (struct target_ops *)