Re: Private data members

Michael Snyder
2009-07-29T22:39:01Z

Andreas Schwab wrote:
> Michael Snyder <msnyder@vmware.com> writes:
>
>> Define struct breakpoint in breakpoint.h, put any public members
>> in there, and then include a member "struct breakpoint_private"
>> that is only a forward declaration.
>
> That only works if this member is a pointer. You cannot have struct
> members with incomplete types.

Right. But that can still be done, because we have a local allocator.
Breakpoint structs are created by set_raw_breakpoint_without_location,
a static function, and the exported interface is set_raw_breakpoint.

As long as nobody outside of breakpoint.c allocates a struct bp,
I don't see why it shouldn't work.