This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Register Groups (again)


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]