This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: [RFC] Register sets
- From: Jim Blandy <jimb at redhat dot com>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: Mark Kettenis <kettenis at chello dot nl>, gdb at sources dot redhat dot com
- Date: 05 Sep 2003 19:01:34 -0500
- Subject: Re: [RFC] Register sets
- References: <200308232249.h7NMnvhh090154@elgar.kettenis.dyndns.org><20030824164347.GA17520@nevyn.them.org><200308252234.h7PMYqFu001245@elgar.kettenis.dyndns.org><3F4B8173.1000302@redhat.com> <20030826165547.GA22836@nevyn.them.org><86he3xrkjb.fsf@elgar.kettenis.dyndns.org><20030904125514.GA2577@nevyn.them.org>
Daniel Jacobowitz <drow@mvista.com> writes:
> struct regset
> {
> void (*supply_regset)(struct regcache *, const void *, size_t, int);
> void (*read_regset)(struct regcache *, void *, size_t, int);
> };
If you want to allow people to define regset formats via the CLI, it
seems to me you probably want some kind of closure argument in there,
like this:
struct regset
{
/* Always pass this to the supply_regset and read_regset
functions below as their first argument. */
void *closure;
void (*supply_regset)(void *closure,
struct regcache *, const void *, size_t, int);
void (*read_regset)(void *closure,
struct regcache *, void *, size_t, int);
};
This gives you the hook you need to have a single function for all
CLI-defined regsets, interpreting the layout the user supplies to the
CLI command.