Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 2/3] remove all_lwps from gdbserver: use list api
Date: Thu, 06 Feb 2014 12:27:00 -0000	[thread overview]
Message-ID: <52F37FC2.5040001@redhat.com> (raw)
In-Reply-To: <yjt2ob2ud5fo.fsf@ruffy.mtv.corp.google.com>

On 01/29/2014 06:11 PM, Doug Evans wrote:

> +/* Return a pointer to the first inferior in the list, or NULL if there
> +   isn't one.
> +   This is for cases where the caller needs a thread, but doesn't care
> +   which one.  */
> +
> +struct inferior_list_entry *
> +get_first_inferior (void)
> +{
> +  if (all_threads.head != NULL)
> +    return all_threads.head;

I think this one, being an "inferior" function, should take
a list as argument.

> +  return NULL;
> +}
> +

> +/* Helper for gdb_agent_about_to_close.
> +   Return non-zero if thread ENTRY is in the same process in DATA.  */
> +
> +static int
> +same_process_p (struct inferior_list_entry *inf, void *data)

Mismatch between comment and parameter (ENTRY vs inf).

Otherwise looks good to me.

(Note: I noticed that patch 3 had a hunk that should be here:

 	  if (!non_stop)
 	    {
-	      current_inferior = (struct thread_info *) all_threads.head;
+	      current_inferior = get_first_thread ();
)

-- 
Pedro Alves


  reply	other threads:[~2014-02-06 12:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29 18:11 Doug Evans
2014-02-06 12:27 ` Pedro Alves [this message]
2014-02-19 23:31   ` Doug Evans
2014-02-20 13:40     ` Pedro Alves
2014-02-20 18:18       ` Doug Evans
2014-02-20 18:27         ` Pedro Alves
2014-02-20 21:18 ` Doug Evans
2014-02-20 21:19 ` Doug Evans

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=52F37FC2.5040001@redhat.com \
    --to=palves@redhat.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /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