[PATCH] MIPS: Ignore invalid regs during info registers all

Pedro Alves palves@redhat.com
Tue Sep 30 15:36:00 GMT 2014


On 09/30/2014 04:05 PM, James Hogan wrote:
> On 30/09/14 16:00, Pedro Alves wrote:
>> 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" ?
> 
> I don't think that's possible, because the check is:
> if (*(gdbarch_register_name (gdbarch, regnum)) == '\0')
> 
> So any such register already has no name by which to refer to it.

Indeed.  :-)  I'll leave it to Maciej to approve.

I see that sh64-tdep.c:sh64_media_print_registers_info has the
same problem.

A bit silly that we force each arch backend to do this.

I guess the loop in registers_info could/should already skip
empty-named registers, like default_print_registers_info does.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list