From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21485 invoked by alias); 22 Dec 2011 10:21:00 -0000 Received: (qmail 21474 invoked by uid 22791); 22 Dec 2011 10:20:58 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Dec 2011 10:20:45 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id pBMAKcIh021470; Thu, 22 Dec 2011 11:20:38 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id pBMAKaL0007007; Thu, 22 Dec 2011 11:20:36 +0100 (CET) Date: Thu, 22 Dec 2011 10:25:00 -0000 Message-Id: <201112221020.pBMAKaL0007007@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: stanshebs@earthlink.net CC: gdb-patches@sourceware.org In-reply-to: <4EF26E18.3030401@earthlink.net> (message from Stan Shebs on Wed, 21 Dec 2011 15:39:04 -0800) Subject: Re: [PATCH] PIE support for OpenBSD References: <201112172108.pBHL8Th2032226@glazunov.sibelius.xs4all.nl> <20111221171315.GA18194@host2.jankratochvil.net> <201112212126.pBLLQ2Fl013069@glazunov.sibelius.xs4all.nl> <4EF26E18.3030401@earthlink.net> 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 X-SW-Source: 2011-12/txt/msg00777.txt.bz2 > Date: Wed, 21 Dec 2011 15:39:04 -0800 > From: Stan Shebs > > On 12/21/11 1:26 PM, Mark Kettenis wrote: > >> Date: Wed, 21 Dec 2011 18:13:15 +0100 > >> From: Jan Kratochvil > >> > >> 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?