From owner-cvs-all@FreeBSD.ORG Tue Jul 20 10:33:37 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 51F7816A4CE; Tue, 20 Jul 2004 10:33:37 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id E10CB43D1F; Tue, 20 Jul 2004 10:33:36 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from pooker.samsco.org (scottl@localhost [127.0.0.1]) by pooker.samsco.org (8.12.11/8.12.10) with ESMTP id i6KAdeuw058245; Tue, 20 Jul 2004 04:39:40 -0600 (MDT) (envelope-from scottl@freebsd.org) Received: from localhost (scottl@localhost)i6KAder5058242; Tue, 20 Jul 2004 04:39:40 -0600 (MDT) (envelope-from scottl@freebsd.org) X-Authentication-Warning: pooker.samsco.org: scottl owned process doing -bs Date: Tue, 20 Jul 2004 04:39:40 -0600 (MDT) From: Scott Long Sender: scottl@pooker.samsco.org To: Mark Kettenis In-Reply-To: <200407200958.i6K9wZD4022358@juw15.nfra.nl> Message-ID: <20040720043824.X32601@pooker.samsco.org> References: <200407182028.i6IKS7Su002490@repoman.freebsd.org> <20040719171041.GA22048@ns1.xcllnt.net> <200407200958.i6K9wZD4022358@juw15.nfra.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=0.0 required=3.8 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on pooker.samsco.org cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org cc: marcel@xcllnt.net Subject: Re: cvs commit: src/sys/kern imgact_elf.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2004 10:33:37 -0000 On Tue, 20 Jul 2004, Mark Kettenis wrote: > Date: Mon, 19 Jul 2004 10:10:41 -0700 > From: Marcel Moolenaar > > On Mon, Jul 19, 2004 at 03:45:39AM -0600, Scott Long wrote: > > I've seen concern (maybe in private email, can't check at the moment) > > recently that loosing the PID info is undesirable. Is there any way that > > it can be included again, maybe in something other than a PRSTATUS object? > > Ideally you want one note that describes the process as a whole (let's > call it a P-note for now) and as many notes as there were kernel threads > for the process (let's call such notes T-notes). > > Defenitely. > > A P-note would typically hold the PID. T-notes typically hold register > contents, as well as LWPIDs. > > Essentially, yes. > > Creating a core file with P-notes and T-notes is easy enough. getting > binutils to grok them is non-trivial, not to mention that gdb needs > to be able to get to the information, which is as non-trivial as > binutils extracting it from the core file. So, introducing new notes > is a major effort. Extending existing notes is a major effort. Not > because it's hard to understand a new note, or read a new field from > a note, but because it's hard to have binutils save the information > and gdb use the saved information. You pretty much have to redesign > interfaces and I'm not touching that... > > I think a redesign of the core file format along the lines you said > above would defenitely pay off. The NetBSD folks have done it, and I > think their approach is pretty elegant. An improtant benefit of their > approach is that it's (almost) machine independent. The BFD code is > pretty much localized in elf.c (look for the functions with netbsd in > their names). Adapting that code for FreeNSD should not be much work. > I don't think any further changes to GDB are needed. > > For a description of the format you can look at the NetBSD core(5) man > page. The T-notes are simply dumps of `struct reg' and `struct > fpreg'. The LWPIDs are encoded in the name of those notes. > > Please realize that the problems you're citing largely stem from the > let's simulate-Linux-which-simulates-SVR4 type notes currently used by > FreeBSD. Throwing that all overboard will save much trouble in the > future. > > I'm certainly willing to do some of the legwork, since it'd make life > for me on the GDB side a lot easier if you'd adapt these NetBSD-style > core file notes. I certainly have some time the coming weeks to spend > on it. > > Mark > I think it's a little late in the 5.3/5-STABLE game to change the corefile format. I do, however, like this idea a lot. Getting it done early on in the 6.x cycles would be a really good thing. Scott