This is the mail archive of the gdb@sourceware.org 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]

Re: Private data members


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.


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