Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Move pending_event to remote_notif_state ([PATCH 1/6] Move notif_queue to remote_state)
Date: Mon, 30 Sep 2013 19:34:00 -0000	[thread overview]
Message-ID: <5249D259.5070101@redhat.com> (raw)
In-Reply-To: <52492EAE.5030802@codesourcery.com>

Eh, sorry, somehow I only noticed this patch now.

(Still, I'd have preferred if the previous patch didn't
create an intermediate state that leaks.)

Anyway...

On 09/30/2013 08:56 AM, Yao Qi wrote:

>  /* Return an allocated remote_notif_state.  */
>  
>  struct remote_notif_state *
> @@ -238,6 +246,8 @@ remote_notif_state_allocate (void)
>      = create_async_event_handler (remote_async_get_pending_events_handler,
>  				  notif_state);
>  
> +  memset (notif_state->pending_event, 0, sizeof (notif_state->pending_event));

Could use xzalloc to begin with.  Might be more future proof.

> @@ -5414,16 +5409,22 @@ discard_pending_stop_replies (struct inferior *inf)
>  {
>    int i;
>    struct queue_iter_param param;
> -  struct stop_reply *reply
> -    = (struct stop_reply *) notif_client_stop.pending_event;
> +  struct stop_reply *reply;
> +  struct remote_state *rs = get_remote_state ();
> +  struct remote_notif_state *rns = rs->notif_state;
> +
> +  /* This function can be notified when an inferior exists.  When the
> +     target is not remote, the notification state is NULL.  */
> +  if (rns == NULL)
> +    return;

I'd rather we use the same "target is remote" predicate we use everywhere else:

  if (rs->remote_desc == NULL)
    return;

Otherwise this looks fine.

Thanks,
-- 
Pedro Alves


  reply	other threads:[~2013-09-30 19:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-19  1:56 [PATCH 0/6 V5] MI notification on trace started/stopped Yao Qi
2013-08-19  1:56 ` [PATCH 2/6] Add annex in an async remote notification Yao Qi
2013-09-26 18:43   ` Pedro Alves
2013-09-27  1:44     ` Yao Qi
2013-10-18  1:05       ` Yao Qi
2013-08-19  1:56 ` [PATCH 5/6] MI notification on trace started/stopped:basic Yao Qi
2013-08-19  1:56 ` [PATCH 6/6] MI notification on trace stop: triggered by remote Yao Qi
2013-08-19  1:56 ` [PATCH 3/6] Query supported notifications by qSupported Yao Qi
2013-08-19  1:56 ` [PATCH 4/6] async remote notification 'Trace' Yao Qi
2013-08-19  1:56 ` [PATCH 1/6] Move notif_queue to remote_state Yao Qi
2013-09-25 16:12   ` Pedro Alves
2013-09-30  7:34     ` Yao Qi
2013-09-30  7:58       ` Move pending_event to remote_notif_state ([PATCH 1/6] Move notif_queue to remote_state) Yao Qi
2013-09-30 19:34         ` Pedro Alves [this message]
2013-10-04  7:42           ` Yao Qi
2013-09-30 17:08       ` [PATCH 1/6] Move notif_queue to remote_state Pedro Alves
2013-10-01 14:08         ` Yao Qi
2013-10-02  1:54         ` Yao Qi
2013-10-02 10:48           ` Pedro Alves
2013-10-04  7:36             ` Yao Qi
2013-09-02  0:14 ` [PATCH 0/6 V5] MI notification on trace started/stopped Yao Qi
2013-09-18 13:24 ` [ping 2]: " Yao Qi
2013-09-18 13:25   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5249D259.5070101@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox