This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v4 2/9] add "this" pointers to more target APIs
- From: Tom Tromey <tromey at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 06 Dec 2013 11:23:18 -0700
- Subject: Re: [PATCH v4 2/9] add "this" pointers to more target APIs
- Authentication-results: sourceware.org; auth=none
- References: <1382464769-2465-1-git-send-email-tromey at redhat dot com> <1382464769-2465-3-git-send-email-tromey at redhat dot com> <526E8AF2 dot 7050202 at redhat dot com> <87r4b5cpxd dot fsf at fleche dot redhat dot com> <526E9451 dot 6050103 at redhat dot com> <87mwltcp8v dot fsf at fleche dot redhat dot com> <527D2323 dot 2010708 at redhat dot com> <87ob5uodry dot fsf at fleche dot redhat dot com> <527D5D58 dot 4030707 at redhat dot com>
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Tom> I'll remove "is_async". Unless you'd rather I remove "can_async".
Pedro> No, that's fine. "is_async" would be my choice as well.
I looked deeper than the two are still subtly different.
Specifically, remote.c delegates to serial:
return serial_can_async_p (rs->remote_desc);
return serial_is_async_p (rs->remote_desc);
And these really do differ:
int
serial_can_async_p (struct serial *scb)
{
return (scb->ops->async != NULL);
}
int
serial_is_async_p (struct serial *scb)
{
return (scb->ops->async != NULL) && (scb->async_handler != NULL);
}
I find it a bit odd that the upper layers rely on the serial layer to do
this bookkeeping.
Tom