This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] PIE support for OpenBSD
> Date: Wed, 21 Dec 2011 15:39:04 -0800
> From: Stan Shebs <firstname.lastname@example.org>
> On 12/21/11 1:26 PM, Mark Kettenis wrote:
> >> Date: Wed, 21 Dec 2011 18:13:15 +0100
> >> From: Jan Kratochvil<email@example.com>
> >> On Sat, 17 Dec 2011 22:08:29 +0100, Mark Kettenis wrote:
> >>> For now this is OpenBSD-specific, but FreeBSD and NetBSD might
> >>> implement the PIOD_READ_AUXV request at some point too.
> >> [...]
> >>> * inf-ptrace.c [PT_IO&& PIOD_READ_AUXV]
> >> So why didn't you put it into *bsd*-nat.c files?
> > There is already PT_IO support code in inf-ptrace.c. It makes sense
> > to keep it all together. I guess I could move all that code into a
> > seperate bsd-nat.c file, but that's quite a big undertaking. And
> > inf-ptrace.c *BSD really is the primary user of inf-ptrace.c anyway.
> > The various Linux targets only need it to support ancient versions of
> > the Linux kernels; linux-nat.c ovverrides everything except for
> > to_fetch_registers and to_store_registers. And those are overridden
> > by most, if not all, *-linux-nat.c files.
> I wonder if inf-ptrace.c could be retired altogether. It was always
> based on a weak assumption, that Unix variants would tend to have the
> same syntax and semantics for the various ptrace commands, and I suspect
> that more of its code is unreachable than is obvious from inspection,
> what with configs overriding or on the verge of being retired themselves.
Almost all of the code is used on OpenBSD and the other BSDs. It is
certainly true that systems have diverged. This is especially true
for Linux where we have a lot of support code for dealing with threads
that sits on top of the code in inf-ptrace.c. It still uses a fair
chunk of the code through linux_ops->to_create_inferior, to_attach,
to_detach and to_stop, to_resume and to_mourn_inferior, as pointed out
by Jan. But I currently do see inf-ptrace.c primarily as BSD support
code and further decoupling the Linux code might make some sense. But
you'd need to duplicate a fair amount of code to fully decouple
to_create_inferior for example.
Back to my origional diff. Any remaining objections to committing it as is?