From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13220 invoked by alias); 24 Jun 2013 17:32:07 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 13209 invoked by uid 89); 24 Jun 2013 17:32:07 -0000 X-Spam-SWARE-Status: No, score=-8.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 24 Jun 2013 17:32:07 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5OHW5FS003699 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 Jun 2013 13:32:06 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5OHW4CQ021555; Mon, 24 Jun 2013 13:32:05 -0400 Message-ID: <51C88294.9030604@redhat.com> Date: Mon, 24 Jun 2013 17:32:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: [PATCH 14/16] move async_client_callback and async_client_context into remote_state References: <1371835506-15691-1-git-send-email-tromey@redhat.com> <1371835506-15691-15-git-send-email-tromey@redhat.com> In-Reply-To: <1371835506-15691-15-git-send-email-tromey@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00662.txt.bz2 On 06/21/2013 06:25 PM, Tom Tromey wrote: > This moves async_client_callback and async_client_context into > remote_state. > > * remote.c (struct remote_state) async_client_context>: New fields. > (async_client_callback, async_client_context): Remove. > (record_currthread, set_thread, set_general_process) This line looks a pasto from another patch. > (remote_async_serial_handler, remote_async): Update. > --- > gdb/remote.c | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) > > diff --git a/gdb/remote.c b/gdb/remote.c > index 94aa5a8..39ad2ef 100644 > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -409,6 +409,10 @@ struct remote_state > > int use_threadinfo_query; > int use_threadextra_query; > + > + void (*async_client_callback) (enum inferior_event_type event_type, > + void *context); > + void *async_client_context; > }; > > /* Private data that we'll store in (struct thread_info)->private. */ > @@ -11638,17 +11642,16 @@ remote_is_async_p (void) > will be able to delay notifying the client of an event until the > point where an entire packet has been received. */ This comment above is related to the callback. > > -static void (*async_client_callback) (enum inferior_event_type event_type, > - void *context); > -static void *async_client_context; > static serial_event_ftype remote_async_serial_handler; > > static void > remote_async_serial_handler (struct serial *scb, void *context) > { > + struct remote_state *rs = context; Does this actually work? > + > /* Don't propogate error information up to the client. Instead let > the client find out about the error by querying the target. */ > - async_client_callback (INF_REG_EVENT, async_client_context); > + rs->async_client_callback (INF_REG_EVENT, rs->async_client_context); > } > > static void > @@ -11665,9 +11668,9 @@ remote_async (void (*callback) (enum inferior_event_type event_type, > > if (callback != NULL) > { > - serial_async (rs->remote_desc, remote_async_serial_handler, NULL); > - async_client_callback = callback; > - async_client_context = context; > + serial_async (rs->remote_desc, remote_async_serial_handler, rs); > + rs->async_client_callback = callback; > + rs->async_client_context = context; Because I think CONTEXT is always NULL here. And it'd seem a wrong to me to store the remote state in the meant for context passed in by the target_async's caller? -- Pedro Alves