Question on the gdb.xml/tdesc-regs.exp test

Andrew Burgess aburgess@redhat.com
Wed Mar 30 10:22:00 GMT 2022


Carl Love via Gdb-patches <gdb-patches@sourceware.org> writes:

> Stafford:
>
> In your patch for the test on Dec 27, 2017, you updated the comment in
> the test to say:
>
> +# Reggroups should have at least general and the extra foo group               
> +gdb_test "maintenance print reggroups" \                                       
> +    " Group\[ \t\]+Type\[ \t\]+\r\n.* general\[ \t\]+user\[ \t\]+\r\n.* foo\[ \
> \t\]+user\[ \t\]+"
>
> On Powerpc, the test results are as follows:
>
> maintenance print reggroups
>  Group      Type      
>  foo        user      
> (gdb) FAIL: gdb.xml/tdesc-regs.exp: maintenance print reggroups
> set tdesc filename test-regs.xml
>
> I see that the output on X86 includes an line with general:
>
>  maintenance print reggroups
>  Group      Type      
>  sse        user      
>  mmx        user      
>  general    user      
> ...
>
> I am wondering if you can help me understand why a line with general is
> expected?  I have been looking at Powerpc and Intel trying to figure
> out why it shows up on Intel but not Powerpc?  Anyway, it would be good
> to understand what results in the general line being generated so I can
> figure out how to get the test to run properly on Powerpc.  Currently,
> this is the only failure on Powerpc.   Thanks for your help.

The 'general' set usually includes the core integer registers for an
architecture, so on ppc this would be r0 - r31.  Different architectures
might add some additional registers to this set, maybe $pc if it's
separate, or some flag registers... but the integer regs are the main
ones.

So, if I fire up GDB on ppc and do:

  maint print register-groups

I can see that r0 - r31 are indeed in the general group.

But, if I load the xml description used in the test, I can see that the
r0-r31 registers are still present, but they are no longer in the
general set.  This is the problem that needs solving.

I've not (yet) looked into why this might be, but thought the above
might be a good starting point if you wanted to look at this yourself.

Thanks,
Andrew



More information about the Gdb-patches mailing list