aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-18 14:30:22 -0700
committerTom Tromey <tromey@redhat.com>2014-02-19 07:48:07 -0700
commitad5989bd21c9941358ea33a79e6fad47a93c2b47 (patch)
tree54a40079b70da14c286f8e0b1d9e28d47db597c3
parent46ee7e8d84bb33c3c6c5dc8673ee2ca5457462b0 (diff)
downloadgdb-ad5989bd21c9941358ea33a79e6fad47a93c2b47.zip
gdb-ad5989bd21c9941358ea33a79e6fad47a93c2b47.tar.gz
gdb-ad5989bd21c9941358ea33a79e6fad47a93c2b47.tar.bz2
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.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/target-delegates.c15
-rw-r--r--gdb/target.c15
-rw-r--r--gdb/target.h3
4 files changed, 27 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 95d308f..1f352ea 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,6 +1,13 @@
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.
* target.c (update_current_target): Don't inherit or default
to_stop.
* target.h (struct target_ops) <to_stop>: Use
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index 1220058..f813e35 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -61,6 +61,18 @@ tdefault_wait (struct target_ops *self, ptid_t arg1, struct target_waitstatus *a
}
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)
{
self = self->beneath;
@@ -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;
diff --git a/gdb/target.c b/gdb/target.c
index 0432dfd..f656db3 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -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
diff --git a/gdb/target.h b/gdb/target.h
index 64f6b6e..0aee7a9 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -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 *)