From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14276 invoked by alias); 5 Aug 2010 18:44:49 -0000 Received: (qmail 14265 invoked by uid 22791); 5 Aug 2010 18:44:48 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Aug 2010 18:44:44 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o75IieDJ015505 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 5 Aug 2010 14:44:41 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o75IiavN001586; Thu, 5 Aug 2010 14:44:36 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o75IiZK2003976; Thu, 5 Aug 2010 14:44:35 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 2F2083782ED; Thu, 5 Aug 2010 12:44:35 -0600 (MDT) From: Tom Tromey To: Hui Zhu Cc: gdb-patches ml Subject: Re: [RFA]corelow.c: Add tid to add_to_thread_list References: Date: Thu, 05 Aug 2010 18:44:00 -0000 In-Reply-To: (Hui Zhu's message of "Tue, 3 Aug 2010 16:48:30 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2010-08/txt/msg00045.txt.bz2 >>>>> ">" == Hui Zhu writes: >> I make a patch for kernel (http://lkml.org/lkml/2010/8/3/75) but they >> think it should be fixed in user space. >> So I add the tid to add_to_thread_list. I don't know about this area of gdb, so I can't really comment on the semantics of the change, but I do have a comment about how the change is written: >> - ptid = ptid_build (pid, lwpid, 0); >> + tid = 0; >> +get_ptid: >> + ptid = ptid_build (pid, lwpid, tid); >> + if (find_thread_ptid (ptid)) >> + { >> + tid ++; >> + goto get_ptid; >> + } I think this would be more readably written without 'goto', as a loop. Tom