From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10966 invoked by alias); 19 Feb 2014 23:31:43 -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 10954 invoked by uid 89); 19 Feb 2014 23:31:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ve0-f177.google.com Received: from mail-ve0-f177.google.com (HELO mail-ve0-f177.google.com) (209.85.128.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 19 Feb 2014 23:31:41 +0000 Received: by mail-ve0-f177.google.com with SMTP id jz11so1128545veb.22 for ; Wed, 19 Feb 2014 15:31:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Fe0uDN5oMdY1IOuXSlkwL+6g/Oqbn+AzmS/sU8+laJU=; b=Sa1QV0a9rf7EtGBsX4SXoaBHxt/8MzbwDcOXPhbct4U1j8MieHswspzin/1SHCu7Ne n/SKVAtrokgGsIBYDDbtP81vv0Gq3sOhHkD9Rn4LdTVSVFN9xzfiLhDdBJhzaR8ZRwE6 Xcy2KspRkVT8hfrGYlKCIBDc3mxKxKjQMS/RA3bTHVTjQgmYcgyZpCotz0172qR1ToPc b+32yxIc1GNZfD+P1zhHFclS/e5JO8/xN5+dg9W9uAs7cyzzlsrUaNUaQdDEsjKoP9oz SEH4vndVOOanC/VBfkB9prTc9Dh/CSkpkl5spAVruA1uAadQJ1mXaOBKrCn6yeD1ADrI D6GQ== X-Gm-Message-State: ALoCoQkPgvB71kygtoH8DhsV7UukfPq1nz0xEoisRc+gK3+cJLhJxO1sm/35G0wa1SDAzN9nmI9xFtZbRfDSAD2+maPC106If5SLeGReaYRjovgmkg5t9S8d4HblW6BQD/sbHiDTEf46G5zlnm3UY2SCgEElrlxCj6lnyJkpmOEI5FRt+7FOjjpP8I96zdfkRcBTmlQBX8yYk8PAUc4Q7hBQaIaicoJ/Gg== MIME-Version: 1.0 X-Received: by 10.52.160.233 with SMTP id xn9mr2583040vdb.48.1392852699505; Wed, 19 Feb 2014 15:31:39 -0800 (PST) Received: by 10.52.51.234 with HTTP; Wed, 19 Feb 2014 15:31:39 -0800 (PST) In-Reply-To: <52F37FC2.5040001@redhat.com> References: <52F37FC2.5040001@redhat.com> Date: Wed, 19 Feb 2014 23:31:00 -0000 Message-ID: Subject: Re: [PATCH v2 2/3] remove all_lwps from gdbserver: use list api From: Doug Evans To: Pedro Alves Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00616.txt.bz2 On Thu, Feb 6, 2014 at 4:27 AM, Pedro Alves wrote: > 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 (); > ) Committed with the suggested changes.