From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22670 invoked by alias); 12 Apr 2011 13:42:00 -0000 Received: (qmail 22660 invoked by uid 22791); 12 Apr 2011 13:41:59 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Apr 2011 13:41:55 +0000 Received: (qmail 18892 invoked from network); 12 Apr 2011 13:41:55 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Apr 2011 13:41:55 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [PATCH] GDB checkpoint can't/shouldn't be possible with multiple threads on Linux Date: Tue, 12 Apr 2011 13:42:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.6.2; x86_64; ; ) Cc: Kevin Pouget References: <201104121355.11278.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201104121441.56034.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2011-04/txt/msg00170.txt.bz2 Small nit I should have caught before: On Tuesday 12 April 2011 14:27:49, Kevin Pouget wrote: > +static int > +inf_has_multiple_thread_cb (struct thread_info *tp, void *data) > +{ > + int *has_multiple_threads = (int *) data; can you rename this local as well, in line with the other local in the other function? To "count", or "count_p", or something like that. Thanks. (pre-approved) > + if (current_inferior ()->pid == ptid_get_pid (tp->ptid)) > + (*has_multiple_threads)++; > + > + /* Stop the iteration if multiple threads have been detected. */ > + return *has_multiple_threads > 1; > +} > + > +/* Return true if the current inferior is multi-threaded. */ > + > +static int > +inf_has_multiple_threads (void) > +{ > + int count = 0; > + > + iterate_over_threads (inf_has_multiple_thread_cb, &count); -- Pedro Alves