* NEWS: Mention "info auto-load-scripts".
[deliverable/binutils-gdb.git] / gdb / regcache.c
index 8b4d77ccc0c81b7444e772ed7d3d6373e5c621e2..f603c331d1cd1ab02c15d42b93c5a921ac3ff582 100644 (file)
@@ -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);
 
 }
This page took 0.029295 seconds and 4 git commands to generate.