diff options
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r-- | gdb/regcache.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c index 8b4d77c..f603c33 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -30,6 +30,7 @@ #include "gdbcmd.h" /* For maintenanceprintlist. */ #include "observer.h" #include "exceptions.h" +#include "remote.h" /* * DATA STRUCTURE @@ -1053,7 +1054,8 @@ dump_endian_bytes (struct ui_file *file, enum bfd_endian endian, enum regcache_dump_what { regcache_dump_none, regcache_dump_raw, - regcache_dump_cooked, regcache_dump_groups + regcache_dump_cooked, regcache_dump_groups, + regcache_dump_remote }; static void @@ -1251,6 +1253,23 @@ regcache_dump (struct regcache *regcache, struct ui_file *file, } } + /* Remote packet configuration. */ + if (what_to_dump == regcache_dump_remote) + { + if (regnum < 0) + { + fprintf_unfiltered (file, "Rmt Nr g/G Offset"); + } + else if (regnum < regcache->descr->nr_raw_registers) + { + int pnum, poffset; + + if (remote_register_number_and_offset (get_regcache_arch (regcache), regnum, + &pnum, &poffset)) + fprintf_unfiltered (file, "%7d %11d", pnum, poffset); + } + } + fprintf_unfiltered (file, "\n"); } @@ -1309,6 +1328,12 @@ maintenance_print_register_groups (char *args, int from_tty) regcache_print (args, regcache_dump_groups); } +static void +maintenance_print_remote_registers (char *args, int from_tty) +{ + regcache_print (args, regcache_dump_remote); +} + extern initialize_file_ftype _initialize_regcache; /* -Wmissing-prototype */ void @@ -1342,5 +1367,11 @@ _initialize_regcache (void) "including each register's group.\n" "Takes an optional file parameter."), &maintenanceprintlist); + add_cmd ("remote-registers", class_maintenance, + maintenance_print_remote_registers, _("\ +Print the internal register configuration including each register's\n\ +remote register number and buffer offset in the g/G packets.\n\ +Takes an optional file parameter."), + &maintenanceprintlist); } |