This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC 01/32] add "this" pointers to more target APIs
- 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 12:10:24 +0000
- Subject: Re: [RFC 01/32] add "this" pointers to more target APIs
- Authentication-results: sourceware.org; auth=none
- References: <1389640367-5571-1-git-send-email-tromey at redhat dot com> <1389640367-5571-2-git-send-email-tromey at redhat dot com>
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)
> {
> if (RECORD_FULL_IS_REPLAY)
> 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