[RFC] Register sets

Andrew Cagney ac131313@redhat.com
Thu Sep 4 14:00:00 GMT 2003


> Hmm, yes and no.  That definition of regset is only useful for core
> files; I would like something more generally useful, for remote and
> native use.  I also don't really like passing the core gdbarch around,
> for the same reason.  How about this instead?
> 
> struct regset
> {
>   void (*supply_regset)(struct regcache *, const void *, size_t, int);
>   void (*read_regset)(struct regcache *, void *, size_t, int);
> };
> 
> const struct regset *
> core_section_to_regset (struct gdbarch *core_gdbarch,
> 			const char *sec_name, size_t sec_size);
> 
> which would then allow:
> 
> const struct regset *
> remote_name_to_regset (const char *name);

As far as I know, the required lookups are:
	REGNUM -> REGSET
	foreach REGSET
and not SETNAME -> REGSET.  This is so that a request for a single 
register, or all registers, can be directed to the correct regset.  I 
also think having remote and corefile adopt an identical naming schema 
should make life easier.

As for the architecture, supply_regset needs this.  It might, for 
instance, be an x86-64 method supplying registers to an i386 register cache.

--

I should note that I do know of a second way of handling cross 
architectures (x86-64 on i386 et.al.).  Add a table of cross 
architecture unwinders and then allow different frames to have different 
architectures vis:

	x86-64 frame
	<x86-64 X i386>
	i386 frame
	i386 frame
	<ia64 X i386>
	ia64 frame

but that's getting way ahead of many other changes.

enjoy,
Andrew




More information about the Gdb mailing list