Register group proposal

Andrew Cagney ac131313@cygnus.com
Thu Feb 22 07:58:00 GMT 2001


Nick Duffek wrote:
> 
> On 21-Feb-2001, Andrew Cagney wrote:
> 
> >Rather than a simple integer, should reggroup be made an object vis
> >``struct reggroup *''?
> 
> Perhaps so.  It's not a struct at the moment, though, and even if it were,
> declaring it as such implies that clients of the interface have access to
> fields of the struct, which either (a) is untrue or (b) leaks internal
> information across the interface.
> 
> I'd rather typedef it to something that'll cause compile-time errors if
> it's used as anything other than an opaque handle.  That change probably
> would require more discussion, so for now I'd prefer to use an int.

I'm sorry but you've lost me here.

Have a look at ui-out.h, ui-file.h, gdbarch.h, ...  They have all used
``struct foo *'' to implement an opaque type.  In all cases it isn't
possible to get to the inner workings.

Regarding typedefs.  Per my e-mail
http://sources.redhat.com/ml/gdb-patches/2001-02/msg00325.html it
encouraging a tangled web of includes.

enjoy,
	Andrew



More information about the Gdb mailing list