This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdbserver target description: info reg displays or not according to group presence ???


On Sun, 1 Aug 2010 22:39:47 -0400, Daniel Jacobowitz wrote:
Separately, note "must be".  Don't use group="s1".  Target-defined
register groups aren't supported.

In target-description.c, I found the following comment: Arbitrary strings (other than "general", "float", and "vector") from the description are not used; they cause the register to be displayed in "info all-registers" but excluded from "info registers" et al. The names of containing features are also not used. This might be extended to display registers in some more useful groupings.

I guess the idea is that one day, something like
   info registers a_target_defined_abitrary_group
will show the registers of this group.

So, it looks like the code currently already accepts arbitrary
register group but that the doc about GROUP does not mention this.


Yes, it looks like a bug in i386_register_reggroup_p, in the last bit
(group == general_reggroup_p).  One way to fix it would be to add a
range check (&& regnum < I386_NUM_GREGS).

Not too sure of what I did but a small test seems ok with the below code:
if (group == general_reggroup)
return (!fp_regnum_p
&& !mmx_regnum_p
&& !mxcsr_regnum_p
&& !xmm_regnum_p
&& !ymm_regnum_p
&& !ymmh_regnum_p
&& regnum < I386_NUM_GREGS);
Note that the tests above seems redundant: none of the registers below I386_NUM_GREGS are fp or mmx or ...



Should I do a bug entry for this and also for clarifying the doc/comment ?


The documentation of GROUP could probably be clarified and/or the comment
in the code could be changed :
* the code accepts any string as group name, doc does not mention this.
* also the target xml files for i386 does not specify any
group for e.g. eax, but eax is shown in info registers.
I imagine we need an additional sentence such as "Pre-defined standard registers have an hard-coded set of groups. Use 'maint print register-groups' to look at these. The standard
registers belonging to general group will be shown by 'info registers'."



Philippe



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]