convert to_fetch_registers

2014-02-19  Tom Tromey  <tromey@redhat.com>

	* target-delegates.c: Rebuild.
	* target.c (target_fetch_registers): Unconditionally delegate.
	* target.h (struct target_ops) <to_fetch_registers>: Use
	TARGET_DEFAULT_NORETURN.
This commit is contained in:
Tom Tromey 2013-12-18 14:30:22 -07:00
parent 46ee7e8d84
commit ad5989bd21
4 changed files with 27 additions and 13 deletions

View File

@ -1,3 +1,10 @@
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_fetch_registers): Unconditionally delegate.
* target.h (struct target_ops) <to_fetch_registers>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.

View File

@ -60,6 +60,18 @@ tdefault_wait (struct target_ops *self, ptid_t arg1, struct target_waitstatus *a
noprocess ();
}
static void
delegate_fetch_registers (struct target_ops *self, struct regcache *arg1, int arg2)
{
self = self->beneath;
self->to_fetch_registers (self, arg1, arg2);
}
static void
tdefault_fetch_registers (struct target_ops *self, struct regcache *arg1, int arg2)
{
}
static void
delegate_store_registers (struct target_ops *self, struct regcache *arg1, int arg2)
{
@ -1087,6 +1099,8 @@ install_delegators (struct target_ops *ops)
ops->to_resume = delegate_resume;
if (ops->to_wait == NULL)
ops->to_wait = delegate_wait;
if (ops->to_fetch_registers == NULL)
ops->to_fetch_registers = delegate_fetch_registers;
if (ops->to_store_registers == NULL)
ops->to_store_registers = delegate_store_registers;
if (ops->to_prepare_to_store == NULL)
@ -1267,6 +1281,7 @@ install_dummy_methods (struct target_ops *ops)
ops->to_detach = tdefault_detach;
ops->to_resume = tdefault_resume;
ops->to_wait = tdefault_wait;
ops->to_fetch_registers = tdefault_fetch_registers;
ops->to_store_registers = tdefault_store_registers;
ops->to_prepare_to_store = tdefault_prepare_to_store;
ops->to_files_info = tdefault_files_info;

View File

@ -3758,18 +3758,9 @@ debug_print_register (const char * func,
void
target_fetch_registers (struct regcache *regcache, int regno)
{
struct target_ops *t;
for (t = current_target.beneath; t != NULL; t = t->beneath)
{
if (t->to_fetch_registers != NULL)
{
t->to_fetch_registers (t, regcache, regno);
if (targetdebug)
debug_print_register ("target_fetch_registers", regcache, regno);
return;
}
}
current_target.to_fetch_registers (&current_target, regcache, regno);
if (targetdebug)
debug_print_register ("target_fetch_registers", regcache, regno);
}
void

View File

@ -415,7 +415,8 @@ struct target_ops
ptid_t (*to_wait) (struct target_ops *,
ptid_t, struct target_waitstatus *, int)
TARGET_DEFAULT_NORETURN (noprocess ());
void (*to_fetch_registers) (struct target_ops *, struct regcache *, int);
void (*to_fetch_registers) (struct target_ops *, struct regcache *, int)
TARGET_DEFAULT_IGNORE ();
void (*to_store_registers) (struct target_ops *, struct regcache *, int)
TARGET_DEFAULT_NORETURN (noprocess ());
void (*to_prepare_to_store) (struct target_ops *, struct regcache *)