Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] MIPS: Ignore invalid regs during info registers all
@ 2014-09-30 14:43 James Hogan
  2014-09-30 15:01 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: James Hogan @ 2014-09-30 14:43 UTC (permalink / raw)
  To: gdb-patches; +Cc: James Hogan

The "info registers all" command causes mips_print_registers_info () to be
called for all register numbers, including invalid ones such as unused DSP
register numbers. This triggers an error () call which prevents further
register values being printed. Just silently return without printing
anything or erroring, so that all valid registers can be printed.

For example, before this patch:
  (gdb) info registers all
  zero: 0x0
  ...
  fir: 0x30f30320
  Not a valid register for the current processor type
  (gdb)

After this patch:
  (gdb) info registers all
  zero: 0x0
  ...
  fir: 0x30f30320
  restart: 0x0
  (gdb)

gdb/ChangeLog:

	* mips-tdep.c (mips_print_registers_info): Replace error for
	single invalid register with silent return.
---
 gdb/ChangeLog   | 5 +++++
 gdb/mips-tdep.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f3282144c303..5da8415c3ca0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-30  James Hogan  <james.hogan@imgtec.com>
+
+	* mips-tdep.c (mips_print_registers_info): Replace error for
+	single invalid register with silent return.
+
 2014-09-30  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
 	* gdbarch.sh (regset_from_core_section): Remove gdbarch method.
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 188580f2ebdc..3c4665457552 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -6332,7 +6332,7 @@ mips_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
     {
       gdb_assert (regnum >= gdbarch_num_regs (gdbarch));
       if (*(gdbarch_register_name (gdbarch, regnum)) == '\0')
-	error (_("Not a valid register for the current processor type"));
+	return;
 
       mips_print_register (file, frame, regnum);
       fprintf_filtered (file, "\n");
-- 
1.8.5.5


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-10-03 16:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-30 14:43 [PATCH] MIPS: Ignore invalid regs during info registers all James Hogan
2014-09-30 15:01 ` Pedro Alves
2014-09-30 15:05   ` James Hogan
2014-09-30 15:36     ` Pedro Alves
2014-10-03 16:32       ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox