Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Register Groups (again)
@ 2002-08-17 16:48 Andrew Cagney
  2002-08-17 21:01 ` Daniel Jacobowitz
  2002-08-19 11:35 ` Kevin Buettner
  0 siblings, 2 replies; 10+ messages in thread
From: Andrew Cagney @ 2002-08-17 16:48 UTC (permalink / raw)
  To: gdb

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.



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-08-21  2:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-17 16:48 Register Groups (again) Andrew Cagney
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox