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: Pedro Alves <palves at redhat dot com>
- To: John Baldwin <jhb at freebsd dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 16 Jan 2016 14:39:34 +0000
- 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> <6071650 dot bM8jrAlx9r at ralph dot baldwin dot cx> <5699677F dot 3040808 at redhat dot com> <2254480 dot 0h7heLGpvG at ralph dot baldwin dot cx>
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