Don't throw an error in 'info registers' for unavailable MIPS registers.
authorJohn Baldwin <jhb@FreeBSD.org>
Mon, 19 Jun 2017 21:30:24 +0000 (14:30 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Mon, 19 Jun 2017 21:40:22 +0000 (14:40 -0700)
'info registers' for MIPS throws an error and when it first encounters
an unavailable register.  This does not match other architectures
which annotate unavailable registers and continue to print out the
values of subsequent registers.  Replace the error by displaying an
aligned "<unavailable>".  This string is truncated to "<unavl>" when
displaying a 32-bit register.

gdb/ChangeLog:

* mips-tdep.c (print_gp_register_row): Don't error for unavailable
registers.

gdb/ChangeLog
gdb/mips-tdep.c

index c7cf410131701ff5591780d18f448961e63ade9a..4e091d7e40b6ce994eda82b622e4513e9e563ad8 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-19  John Baldwin  <jhb@FreeBSD.org>
+
+       * mips-tdep.c (print_gp_register_row): Don't error for unavailable
+       registers.
+
 2017-06-19  Pedro Alves  <palves@redhat.com>
 
        * dwarf2read.c (write_psymtabs_to_index): Construct file_closer
index 3ff2dab491e7760571e45ce1fcf0a5f320624f7e..c1800e419f8d988bef475edea0d53e9e69c271f1 100644 (file)
@@ -6542,8 +6542,14 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
       value = get_frame_register_value (frame, regnum);
       if (value_optimized_out (value)
        || !value_entirely_available (value))
-       error (_("can't read register %d (%s)"),
-              regnum, gdbarch_register_name (gdbarch, regnum));
+       {
+         fprintf_filtered (file, "%*s ",
+                           (int) mips_abi_regsize (gdbarch) * 2,
+                           (mips_abi_regsize (gdbarch) == 4 ? "<unavl>"
+                            : "<unavailable>"));
+         col++;
+         continue;
+       }
       raw_buffer = value_contents_all (value);
       /* pad small registers */
       for (byte = 0;
This page took 0.030371 seconds and 4 git commands to generate.