This is the mail archive of the gdb-patches@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: [RFC 03/32] introduce async_callback_ftype


>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> I think it would be nice if the arguments were named, giving us more
Joel> tools to better document the intended behavior of this callback. It's
Joel> also a way to help implementors to choose consistent names for those
Joel> parameters. As for the documentation, unless completely trivial, it
Joel> seems reasonable to me to leave that for later, or even someone else!

How about this?

/* The type of the callback to the to_async method.  */

typedef void async_callback_ftype (enum inferior_event_type event_type,
				   void *context);

"context" is used in several places related to this.  OTOH the only
non-NULL function pointer ever passed to to_async is
'inferior_event_handler', which names the second argument "client_data".
I found them equally clear; particularly once I noticed that all
existing calls pass context==NULL :)

As for documentation, I think the docs should be comments before each
to_* method.  target.h has been laxly maintained in this regard.

Tom


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