From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78172 invoked by alias); 4 Aug 2015 17:30:51 -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 78163 invoked by uid 89); 4 Aug 2015 17:30:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_20,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 04 Aug 2015 17:30:49 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 5CE1428723; Tue, 4 Aug 2015 13:30:45 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3ZADKSAoPcxf; Tue, 4 Aug 2015 13:30:45 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id C5F982865C; Tue, 4 Aug 2015 13:30:44 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 5C0F2472E5; Tue, 4 Aug 2015 10:30:43 -0700 (PDT) Date: Tue, 04 Aug 2015 17:30:00 -0000 From: Joel Brobecker To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Remove get_thread_id Message-ID: <20150804173043.GK4777@adacore.com> References: <1438260744-14116-1-git-send-email-yao.qi@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1438260744-14116-1-git-send-email-yao.qi@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-08/txt/msg00096.txt.bz2 > This patch removes get_thread_id from aarch64-linux-nat.c, > arm-linux-nat.c and xtensa-linux-nat.c. > > get_thread_id was added in this commit below in 2000, > > 41c49b06c471443d3baf2eaa2463a315f9b5edca > https://sourceware.org/ml/gdb-patches/2000-04/msg00398.html > > which predates the ptid_t stuff added into GDB. Nowadays, lwpid of > inferior_ptid is only zero when the inferior is created (in > fork-child.c:fork_inferior) and its lwpid will be set after > linux_nat_wait_1 gets the first event. After that, lwpid of > inferior_ptid is not zero for linux-nat target, then we can use > ptid_get_lwp, so this function isn't needed anymore. I'm not a specialist, but I tend to agree. I've always found these GET_THREAD_ID macros, in particular, but be unecessary and obfuscating. -- Joel