This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 4/6] Use LWP IDs with ptrace register requests on FreeBSD.
- From: John Baldwin <jhb at freebsd dot org>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 16 Jan 2016 10:35:26 -0800
- Subject: Re: [PATCH v2 4/6] Use LWP IDs with ptrace register requests on FreeBSD.
- Authentication-results: sourceware.org; auth=none
- References: <1452721551-657-1-git-send-email-jhb at FreeBSD dot org> <2254480 dot 0h7heLGpvG at ralph dot baldwin dot cx> <569A5626 dot 8020507 at redhat dot com>
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