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: Thu, 12 Aug 2010 19:08:00 -0000	[thread overview]
Message-ID: <30E80C506E574886BE41DFFFD7E96F14@soleil> (raw)
In-Reply-To: <20100811202307.GN6088@caradoc.them.org>

Thanks for the reply/help.

> The problem with letting people specify random strings as group is
> that GDB might grab those strings for a specific purpose in some
> future version.  There's no registry or namespace.
Is this really a problem ? 
From what I understand, a group is (only?) useful to (in the future)
allow to do 'info register <group>".
If there is really some behaviour linked with a register group,
then it is enough to specify something like:  
"general", "all", "float", "vector", "save"  and group names starting 
with "g" are standard group names reserved for gdb usage.

> Turns out there's a better fix too.  Does this work?
It does not work according to the doc, but it provides
a consistent behaviour. The behaviour is: 
   if *no* group is given, then 'info reg' shows the registers.

With the patch, the behaviour is:
   * if no group is specified, then a register belongs to the general group.
   * the general group is shown by 'info reg'
   * other (gdb known) groups are shown by 'info reg <group>'
   * info all-reg shows all registers
    * and in the future, we could have
         info reg <non standard group name> shows the registers of this group.

Here is some more detailed info about the behaviour with the patch:

With the below (extract of) target description file:
 ...
    <field name="VIP" start="20" end="20"/>
    <field name="ID" start="21" end="21"/>
  </flags>

  <reg name="eaxs1" bitsize="32" type="int32" group="float"/>
  <reg name="ecxs1" bitsize="32" type="int32" group="groupecxs1"/>
  <reg name="edxs1" bitsize="32" type="int32"/>
  <reg name="ebxs1" bitsize="32" type="int32"/>
  ...

info register gives
  ...
  es             0x0 0
  fs             0x0 0
  gs             0x7b0000 8060928
  edxs1          0x0 0
  ebxs1          0x0 0
  esps1          0x0 0x0
  ...


So, specifying either a standard (float) or unknown (groupecxs1)
group makes these registers not shown.
But having no group at all (e.g. edxs1) still shows them.

maint print register-groups gives:
 ...
 orig_eax     49   49    308       4 long            save,restore,system
 eaxs1        50   50    312       4 int32_t         float,all,save,restore
 ecxs1        51   51    316       4 int32_t         all,save,restore
 edxs1        52   52    320       4 int32_t         general,all,save,restore
 ...

Philippe


  reply	other threads:[~2010-08-12 19:08 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
2010-08-11 20:23     ` Daniel Jacobowitz
2010-08-12 19:08       ` Philippe Waroquiers [this message]
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=30E80C506E574886BE41DFFFD7E96F14@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