This is the mail archive of the 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 01/32] add "this" pointers to more target APIs

This looks about good to go to me.

On 01/13/2014 07:12 PM, Tom Tromey wrote:
> @@ -4761,8 +4759,8 @@ static void
>  linux_nat_close (void)
>  {
>    /* Unregister from the event loop.  */
> -  if (linux_nat_is_async_p ())
> -    linux_nat_async (NULL, 0);
> +  if (linux_nat_is_async_p (linux_ops))
> +    linux_nat_async (linux_ops, NULL, 0);

I still think linux_ops is the wrong target to
use here.  While to_close doesn't have a self
pointer, I'd suggest using NULL or adding a comment
(or storing the multi-threaded target pointer in a
global, though given the target really isn't used,
that's probably overkill).

>  static int
> -record_full_stopped_by_watchpoint (void)
> +record_full_stopped_by_watchpoint (struct target_ops *ops)
>  {
>      return record_full_hw_watchpoint;
>    else
> -    return record_full_beneath_to_stopped_by_watchpoint ();
> +    {
> +      struct target_ops *beneath = find_target_beneath (ops);
> +
> +      return record_full_beneath_to_stopped_by_watchpoint (beneath);
> +    }

(For the record, pedantically, this isn't strictly correct.  It's
not guaranteed the target just beneath is the one record_full_open
found had a non-NULL t->to_stopped_by_watchpoint implementation.
It'll end up fixed later in the series anyway though.)

Pedro Alves

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