diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2007-10-22 14:03:37 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2007-10-22 14:03:37 +0000 |
commit | f8d2990873716de2bee1048265d51b46b801f2e2 (patch) | |
tree | 5d8c958d2ac257fca7cd85171632334a1251371c /gdb/target.c | |
parent | 39cbfefa3af75e3c375ff2c0693370d9c84115f3 (diff) | |
download | gdb-f8d2990873716de2bee1048265d51b46b801f2e2.zip gdb-f8d2990873716de2bee1048265d51b46b801f2e2.tar.gz gdb-f8d2990873716de2bee1048265d51b46b801f2e2.tar.bz2 |
2007-10-22 Markus Deuling <deuling@de.ibm.com>
* target.c (debug_print_register): Use get_regcache_arch to get at the
current architecture by regcache.
Diffstat (limited to 'gdb/target.c')
-rw-r--r-- | gdb/target.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gdb/target.c b/gdb/target.c index 356df74..d89a7fb 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -2165,18 +2165,19 @@ static void debug_print_register (const char * func, struct regcache *regcache, int regno) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); fprintf_unfiltered (gdb_stdlog, "%s ", func); - if (regno >= 0 && regno < gdbarch_num_regs (current_gdbarch) - + gdbarch_num_pseudo_regs (current_gdbarch) - && gdbarch_register_name (current_gdbarch, regno) != NULL - && gdbarch_register_name (current_gdbarch, regno)[0] != '\0') - fprintf_unfiltered (gdb_stdlog, "(%s)", gdbarch_register_name - (current_gdbarch, regno)); + if (regno >= 0 && regno < gdbarch_num_regs (gdbarch) + + gdbarch_num_pseudo_regs (gdbarch) + && gdbarch_register_name (gdbarch, regno) != NULL + && gdbarch_register_name (gdbarch, regno)[0] != '\0') + fprintf_unfiltered (gdb_stdlog, "(%s)", + gdbarch_register_name (gdbarch, regno)); else fprintf_unfiltered (gdb_stdlog, "(%d)", regno); if (regno >= 0) { - int i, size = register_size (current_gdbarch, regno); + int i, size = register_size (gdbarch, regno); unsigned char buf[MAX_REGISTER_SIZE]; regcache_cooked_read (regcache, regno, buf); fprintf_unfiltered (gdb_stdlog, " = "); |