public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Nick Duffek <nsd@redhat.com>
To: ac131313@cygnus.com
Cc: gdb@sources.redhat.com, insight@sources.redhat.com
Subject: Re: Register group proposal
Date: Thu, 22 Feb 2001 05:17:00 -0000	[thread overview]
Message-ID: <200102221326.f1MDQJc02778@rtl.cygnus.com> (raw)
In-Reply-To: <3A942228.C9E05495@cygnus.com>

On 21-Feb-2001, Andrew Cagney wrote:

>Rather than a simple integer, should reggroup be made an object vis
>``struct reggroup *''?

Perhaps so.  It's not a struct at the moment, though, and even if it were,
declaring it as such implies that clients of the interface have access to
fields of the struct, which either (a) is untrue or (b) leaks internal
information across the interface.

I'd rather typedef it to something that'll cause compile-time errors if
it's used as anything other than an opaque handle.  That change probably
would require more discussion, so for now I'd prefer to use an int.

Going one step further, REGISTER_GROUPS should be defined as a pair of
FIRST/NEXT iterator macros plus a NAME macro:

  /* Return the first register group to display.  */
  int REGGROUP_FIRST (void)

  /* Return the register group to display after GRP.  -1 means there
     aren't any more groups to display.  */
  int REGGROUP_NEXT (int grp)

  /* Return the name of register group GRP.  */
  char *REGGROUP_NAME (int grp)

>Even if it isn't made an object could I suggest the convention of a
>...._REGGROUP() be adopted to all methods that return a register group.

Yes, that's helpful for supporting Stephane's idea of using register
groups for purposes other than display, e.g. fetching and storing.

>>   /* Return a null-terminated list of register group
>> names.  */
>>   char **REGISTER_GROUPS (void)

>Would such a table be released using freeargv() like many of the BFD
>interfaces?

No, it never would be released, because it would be part of a gdbarch.
But this question is bypassed by the REGGROUP_FIRST change.

>>   /* Return the REGISTER_GROUPS index of the group that
>> "info registers"
>>      should display.  */
>>   int REGISTERS_SOME (void)

>Perhaphs

>	...._DEFAULT_REGROUP()

Agreed.

>>   /* Return the REGISTER_GROUPS index of the group that
>> "info
>>      all-registers" should display.  */
>>   int REGISTERS_ALL (void)

>Hmm, is there a case when ``info all-registers'' doesn't display all the
>registers?

I proposed such a case in my original message:

  - Some pseudo-registers might not be appropriate in either "info
    registers" or "info all-registers" output.  For example, if an
    architecture lacks a dedictated frame pointer register but its ABI
    stores the frame pointer in general register r31, then "fp" and "r31"
    might be aliases for the same register.  It would not be useful to
    display both fp and r31 in "info all-registers" output.

Do you disagree with that case?  Even if you do, though, I don't think we
should impose restrictions on how architectures define register groups.

Nick

  parent reply	other threads:[~2001-02-22  5:17 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-20 20:56 Nick Duffek
2001-02-21  6:44 ` Fernando Nasser
2001-02-21  7:10   ` Nick Duffek
2001-02-21  7:36     ` Fernando Nasser
2001-02-21  7:58     ` Keith Seitz
2001-02-21  8:50 ` Andrew Cagney
2001-02-21 11:43   ` Andrew Cagney
2001-02-25 15:36   ` Nick Duffek
2001-02-21 11:43 ` Andrew Cagney
2001-02-21 12:28   ` Andrew Cagney
2001-02-21 12:18 ` Andrew Cagney
2001-02-22  0:59   ` Eli Zaretskii
2001-02-22  4:29     ` Nick Duffek
2001-02-22  8:46       ` Andrew Cagney
2001-02-22  8:56         ` Keith Seitz
2001-02-22  9:20           ` Andrew Cagney
2001-02-22  5:17   ` Nick Duffek [this message]
2001-02-22  6:36     ` Fernando Nasser
2001-02-22  8:23       ` Andrew Cagney
2001-02-22  7:58     ` Andrew Cagney
2001-02-22  8:37       ` Nick Duffek
2001-02-22  9:12         ` Andrew Cagney
2001-02-22 10:15           ` Nick Duffek
2001-02-22 10:25             ` Andrew Cagney
2001-02-22 11:40               ` Eli Zaretskii
2001-02-22 11:02           ` Kevin Buettner
2001-02-22 12:08             ` Andrew Cagney
2001-02-22  8:16     ` Andrew Cagney
2001-02-21  3:00 Stephane Carrez
2001-02-21  7:00 ` Nick Duffek
2001-02-21  9:34 ` Andrew Cagney
2001-02-22  9:19 Michael Elizabeth Chastain
2001-02-23  2:52 Bernard Dautrevaux
2001-02-24 15:43 ` Nick Duffek
2001-02-26 18:21   ` Andrew Cagney
2001-02-27 10:30     ` Jim Kleck
2001-02-27 11:24       ` Per Bothner
2001-02-27 13:44         ` Jim Kleck
2001-02-27 15:17           ` Andrew Cagney
2001-02-26  5:29 Bernard Dautrevaux
2001-02-26  9:28 ` Christopher Faylor
2001-02-26 10:56   ` Andrew Cagney
2001-02-26 11:28     ` Christopher Faylor
2001-02-26 17:02       ` Andrew Cagney
2001-02-27  8:53         ` Christopher Faylor
2001-02-27  9:57           ` Andrew Cagney
2001-02-28  1:59 Bernard Dautrevaux

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=200102221326.f1MDQJc02778@rtl.cygnus.com \
    --to=nsd@redhat.com \
    --cc=ac131313@cygnus.com \
    --cc=gdb@sources.redhat.com \
    --cc=insight@sources.redhat.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).