[RFC 03/32] introduce async_callback_ftype

Tom Tromey tromey@redhat.com
Tue Jan 14 15:06:00 GMT 2014


>>>>> "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



More information about the Gdb-patches mailing list