From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1329 invoked by alias); 16 Jan 2016 14:39:39 -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 1314 invoked by uid 89); 16 Jan 2016 14:39:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 16 Jan 2016 14:39:37 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 2EEE552742; Sat, 16 Jan 2016 14:39:36 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0GEdYir025960; Sat, 16 Jan 2016 09:39:35 -0500 Message-ID: <569A5626.8020507@redhat.com> Date: Sat, 16 Jan 2016 14:39:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: John Baldwin CC: gdb-patches@sourceware.org Subject: Re: [PATCH v2 4/6] Use LWP IDs with ptrace register requests on FreeBSD. References: <1452721551-657-1-git-send-email-jhb@FreeBSD.org> <6071650.bM8jrAlx9r@ralph.baldwin.cx> <5699677F.3040808@redhat.com> <2254480.0h7heLGpvG@ralph.baldwin.cx> In-Reply-To: <2254480.0h7heLGpvG@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-01/txt/msg00338.txt.bz2 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. 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? > Is there a way to push a branch and have the build bots build it to > do a test build? No, sorry. > (Even then I think those would not cover 'nat' files for > s390, hppa, etc.) I'm still happy to include this, just want to ensure I > don't break the build. > I'm also not sure if changing these files would > break gdbserver (if gdbserver doesn't include inf-ptrace.o). gdbserver does not include inf-ptrace.o, but it doesn't use the gdb/*-nat.c files either. It has its own backends and shares the gdb/nat/, gdb/common/ and gdb/arch/ files with gdb. We'd actually like to merge the existing gdbserver/gdb backends though: https://sourceware.org/gdb/wiki/Common Thanks, Pedro Alves