Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@ges.redhat.com>
To: gdb@sources.redhat.com
Subject: Register Groups (again)
Date: Sat, 17 Aug 2002 16:48:00 -0000	[thread overview]
Message-ID: <3D5EE0C6.7080902@ges.redhat.com> (raw)

See: http://sources.redhat.com/ml/gdb/2001-02/msg00268.html for the 
origins of this idea.


I'd like to propose a new object ``struct reggroup'' and a number of 
methods:


struct reggroup; // the opaque object

// Some predefined register groups
struct reggroup *general_reggroup;
struct reggroup *float_reggroup;
struct reggroup *system_reggroup;
struct reggroup *vector_reggroup;
struct reggroup *all_reggroup;

// architecture method indicating membership of a register group
int register_reggroup_p (gdbarch, regnum, reggroup);

// The reggroup's attributes
const char *reggroup_name (reggroup);

// Null terminated list of the architectures reggroups
struct reggroup **reggroups (gdbarch);

// Add a custom register group to an architecture
struct reggroup *reggroup_add (gdbarch, name, other attributes?);


A default register group function could look something like:

	if all group
	  return 1
	if float group and register's type is float
	  return 1;
	if vector group and register's type is vector
	  return 1;
	if general group and register's type isn't float or vector
	  return 1
	return 0

And the ``info registers', ``info float'', ``info all-registers'' and 
``info vector'' (``info system''?) commands would then use it.


The big gapeing holes in this proposal are:


- an MI/GUI interface.

The above interface provides:

	for (regnum = 0; regnum < NUM_REGS+NUM_PSEUDO_REGS; regnum++)
	  if (register_reggroup_p (arch, regnum, XXXX_group)
	    ....

I guess that would be abstracted somehow.  Somebody elses problem though :-)


- how it relates to frames

It currently assumes that the register groups are identical between 
frames :-/


comments, thoughts?
Andrew


PS: I guess this gets written up and goes into the ``Registers'' chapter.



             reply	other threads:[~2002-08-17 23:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-17 16:48 Andrew Cagney [this message]
2002-08-17 21:01 ` Daniel Jacobowitz
2002-08-17 22:45   ` Andrew Cagney
2002-08-18  7:44     ` Daniel Jacobowitz
2002-08-18  8:35       ` Andrew Cagney
2002-08-18  9:18         ` Daniel Jacobowitz
2002-08-19 11:54   ` Kevin Buettner
2002-08-19 18:51     ` Daniel Jacobowitz
2002-08-20 19:50       ` Andrew Cagney
2002-08-19 11:35 ` Kevin Buettner

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=3D5EE0C6.7080902@ges.redhat.com \
    --to=ac131313@ges.redhat.com \
    --cc=gdb@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