Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Philippe Waroquiers" <philippe.waroquiers@skynet.be>
To: "Daniel Jacobowitz" <dan@codesourcery.com>
Cc: <gdb@sourceware.org>
Subject: Re: gdbserver target description: info reg displays or not according to group presence ???
Date: Mon, 02 Aug 2010 18:07:00 -0000	[thread overview]
Message-ID: <42CE44B333DB4F8DB17A98AF7734D41F@soleil> (raw)
In-Reply-To: <20100802023939.GA25401@caradoc.them.org>

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


  reply	other threads:[~2010-08-02 18:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-30 22:16 Philippe Waroquiers
2010-08-02  2:39 ` Daniel Jacobowitz
2010-08-02 18:07   ` Philippe Waroquiers [this message]
2010-08-11 20:23     ` Daniel Jacobowitz
2010-08-12 19:08       ` Philippe Waroquiers
2010-09-12 11:09         ` Philippe Waroquiers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42CE44B333DB4F8DB17A98AF7734D41F@soleil \
    --to=philippe.waroquiers@skynet.be \
    --cc=dan@codesourcery.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox