From owner-cvs-all@FreeBSD.ORG Tue Jul 20 09:59:53 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 BDE9616A4CE; Tue, 20 Jul 2004 09:59:53 +0000 (GMT) Received: from server7.nfra.nl (server7.nfra.nl [192.87.1.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 40BF043D62; Tue, 20 Jul 2004 09:59:52 +0000 (GMT) (envelope-from kettenis@jive.nl) Received: from juw15.nfra.nl [10.87.8.15] by server7.nfra.nl; Tue, 20 Jul 2004 11:59:06 +0200 Received: from juw15.nfra.nl (localhost [127.0.0.1]) by juw15.nfra.nl (8.12.2+Sun/8.11.1) with ESMTP id i6K9waCu022361; Tue, 20 Jul 2004 11:58:36 +0200 (CEST) Received: (from kettenis@localhost) by juw15.nfra.nl (8.12.2+Sun/8.12.2/Submit) id i6K9wZD4022358; Tue, 20 Jul 2004 11:58:35 +0200 (CEST) Date: Tue, 20 Jul 2004 11:58:35 +0200 (CEST) Message-Id: <200407200958.i6K9wZD4022358@juw15.nfra.nl> To: marcel@xcllnt.net From: Mark Kettenis In-reply-to: <20040719171041.GA22048@ns1.xcllnt.net> (message from Marcel Moolenaar on Mon, 19 Jul 2004 10:10:41 -0700) References: <200407182028.i6IKS7Su002490@repoman.freebsd.org> <20040719171041.GA22048@ns1.xcllnt.net> cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: scottl@freebsd.org cc: cvs-all@freebsd.org 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 09:59:53 -0000 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