convert to_masked_watch_num_registers

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.
This commit is contained in:
Tom Tromey 2013-12-18 14:34:15 -07:00
parent 8b1c364c14
commit 6c7e5e5cdc
4 changed files with 28 additions and 8 deletions

View File

@ -1,3 +1,11 @@
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.

View File

@ -281,6 +281,19 @@ tdefault_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1
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)
{
@ -1176,6 +1189,8 @@ install_delegators (struct target_ops *ops)
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)
@ -1345,6 +1360,7 @@ install_dummy_methods (struct target_ops *ops)
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;

View File

@ -3870,13 +3870,8 @@ target_remove_mask_watchpoint (%s, %s, %d) = %d\n",
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 (&current_target,
addr, mask);
}
/* The documentation for this function is in its prototype declaration

View File

@ -503,7 +503,8 @@ struct target_ops
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 *)