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 31/32] change delegation for to_read_description


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


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