This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC 03/32] introduce async_callback_ftype
- From: Tom Tromey <tromey at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Date: Tue, 14 Jan 2014 08:06:22 -0700
- Subject: Re: [RFC 03/32] introduce async_callback_ftype
- Authentication-results: sourceware.org; auth=none
- References: <1389640367-5571-1-git-send-email-tromey at redhat dot com> <1389640367-5571-4-git-send-email-tromey at redhat dot com> <52D512FB dot 7010006 at redhat dot com> <20140114105012 dot GF4762 at adacore dot com>
>>>>> "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