This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC 31/32] change delegation for to_read_description
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 14 Jan 2014 20:07:38 +0000
- Subject: Re: [RFC 31/32] change delegation for to_read_description
- Authentication-results: sourceware.org; auth=none
- References: <1389640367-5571-1-git-send-email-tromey at redhat dot com> <1389640367-5571-32-git-send-email-tromey at redhat dot com>
On 01/13/2014 07:12 PM, Tom Tromey wrote:
> This switches to_read_description to the "new normal" delegation
> scheme. This one was a bit trickier than the other changes due to the
> way that target_read_description handled delegation. I examined all
> the target implementations of to_read_description and changed the ones
> returning NULL to instead delegate.
>
Looks good to me. A suggestion below.
> 2014-01-13 Tom Tromey <tromey@redhat.com>
>
> * arm-linux-nat.c (arm_linux_read_description): Delegate when
> needed
Missing period.
> /* Describe the architecture-specific features of this target.
> - Returns the description found, or NULL if no description
> - was available. */
> - const struct target_desc *(*to_read_description) (struct target_ops *ops);
> + Returns the description found. If no description is found,
> + this should delegate to the "beneath" target. */
"Returns ... found ... If not found ..." reads a little like a
paradox to me. I'd suggest leaving the NULL sentences as is,
something like:
/* Describe the architecture-specific features of this target.
If OPS doesn't have a description, this should delegate
to the "beneath" target. Returns the description found, or
NULL if no description was available. */
> + const struct target_desc *(*to_read_description) (struct target_ops *ops)
> + TARGET_DEFAULT_RETURN (0);
--
Pedro Alves