This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] MIPS: Ignore invalid regs during info registers all
- From: Pedro Alves <palves at redhat dot com>
- To: James Hogan <james dot hogan at imgtec dot com>, gdb-patches at sourceware dot org
- Date: Tue, 30 Sep 2014 16:00:57 +0100
- Subject: Re: [PATCH] MIPS: Ignore invalid regs during info registers all
- Authentication-results: sourceware.org; auth=none
- References: <1412088186-26402-1-git-send-email-james dot hogan at imgtec dot com>
On 09/30/2014 03:43 PM, James Hogan wrote:
> 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.
What happens when the user does "info registers that-unused-register" ?
Thanks,
Pedro Alves
>
> 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");
>