From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68391 invoked by alias); 16 Jan 2016 19:17:22 -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 68378 invoked by uid 89); 16 Jan 2016 19:17:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL,BAYES_20,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=HX-Greylist:AUTH, HX-Greylist:succeeded, HX-Greylist:SMTP, HX-Greylist:delayed X-HELO: bigwig.baldwin.cx Received: from bigwig.baldwin.cx (HELO bigwig.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Sat, 16 Jan 2016 19:17:20 +0000 Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A9CC3B958; Sat, 16 Jan 2016 14:17:18 -0500 (EST) From: John Baldwin To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 4/6] Use LWP IDs with ptrace register requests on FreeBSD. Date: Sat, 16 Jan 2016 19:17:00 -0000 Message-ID: <2651627.borPenzgRP@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <569A5626.8020507@redhat.com> References: <1452721551-657-1-git-send-email-jhb@FreeBSD.org> <2254480.0h7heLGpvG@ralph.baldwin.cx> <569A5626.8020507@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00340.txt.bz2 On Saturday, January 16, 2016 02:39:34 PM Pedro Alves wrote: > On 01/15/2016 11:22 PM, John Baldwin wrote: > > > Ok. I made a pass and fixed the ones that I thought were relevant (i.e. > > generating a pid to pass to ptrace()). However, the vast majority of the > > files changed were various foo-linux-nat.c files which I am not setup to > > test. > > Hmm, actually, sorry about that, but I remembered that the ptid_get_lwp()==0 > paths in Linux code are dead code (90ad5e1d4f). I see now that d89fa914ad6f > cleaned most of the linux code, but left out the cases that were open coded. > > So I think it's best to just leave those be. Someone can always clean > those up to use ptid_get_lwp directly afterwards. > > I now think that to move forward with your patch, it's simpler/better to > export get_ptrace_pid, and just use it in the cases you cared about, > and leave other targets as is. Ok. > If you're changing the FreeBSD to always store an lwp, do you still > need get_ptrace_pid, or would something like this instead work? > > - if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), > + if (ptrace (PT_GETREGS, get_ptrace_lwp (inferior_ptid), > > etc. Or would you still need it because the foo-nat.c files you're > touching are used by other BSDs as well? Most of them are pan-BSD so they would need the helper, but ppcfbsd-nat.c is FreeBSD-only, so it can use ptid_get_lwp() directly. -- John Baldwin