From owner-freebsd-arch Thu Oct 18 17:59:41 2001 Delivered-To: freebsd-arch@freebsd.org Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by hub.freebsd.org (Postfix) with ESMTP id 9624F37B407; Thu, 18 Oct 2001 17:59:37 -0700 (PDT) Received: from nomad.yogotech.com (nomad.yogotech.com [206.127.123.131]) by ns.yogotech.com (8.9.3/8.9.3) with ESMTP id SAA20164; Thu, 18 Oct 2001 18:59:33 -0600 (MDT) (envelope-from nate@nomad.yogotech.com) Received: (from nate@localhost) by nomad.yogotech.com (8.8.8/8.8.8) id SAA01756; Thu, 18 Oct 2001 18:59:33 -0600 (MDT) (envelope-from nate) From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15311.31477.44659.191811@nomad.yogotech.com> Date: Thu, 18 Oct 2001 18:59:33 -0600 To: Greg Lehey Cc: Nate Williams , Dag-Erling Smorgrav , FreeBSD-arch@FreeBSD.org Subject: Re: /usr/src/sys/scripts? In-Reply-To: <20011019102425.G60412@wantadilla.lemis.com> References: <20011018101828.A88312@wantadilla.lemis.com> <15311.9266.464139.798092@nomad.yogotech.com> <20011019101722.C60412@wantadilla.lemis.com> <15311.30927.305794.574364@nomad.yogotech.com> <20011019102425.G60412@wantadilla.lemis.com> X-Mailer: VM 6.95 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Reply-To: nate@yogotech.com (Nate Williams) Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > >>>>> BSD/OS has a directory /usr/src/sys/scripts which contains macros for > >>>>> kernel debugging. I have a number of macros here that I've > >>>>> accumulated over time, and I'd like to commit them. I'd also like to > >>>>> modify config(8) to install a .gdbinit in the kernel build directory > >>>>> if debugging has been specified; the .gdbinit would load macros from > >>>>> ../../scripts in order to help with kernel debugging. > >>>> > >>>> Wouldn't /var/crash be the logical place for .gdbinit? > >>> > >>> Yes, and no. Yes because that's where it may be useful, and no because > >>> it's a place for crashdumps, not for analyzing crashdumps. > >> > >> I've been thinking about this, and I think I agree with DES. We have > >> a basic problem that there are two different ways to use gdb, for > >> crash dumps and for remote serial debugging. The .gdbinit you use is > >> different in each case. I think it would make sense to install a > >> serial debug .gdbinit in the kernel build directory, and a dump > >> analysis .gdbinit in /var/crash (if present). > >> > >>> Most folks will probably not analyze the crashdumps, or they will copy > >>> them off somewhere else so they can free up /var/crash for the next > >>> crashdump, so I'd say stick .gdbinit somewhere else. > >> > >> If you can move the dump, you can move the .gdbinit. At least > >> /var/crash is a standard place to look for it. > > > > Only if we make it a standard place. A better place would be > > /sys/scripts/gdbinit.crash. > > Why? That's not obvious to somebody analyzing the dump in /var/crash. > One more thing to look for, one more pathname to remember. The people debugging crash dumps can certainly remember the name of a file as easily as they can remember the commands to type in gdb. This is a specious argument. (And, we can easily document it in the same place we document how to get backtraces in the kernel.) For 95% of the users, they have no need for .gdbinit, but the folks that may have use for it would be the same folks who have a use for a .gdbinit for debugging kernels over serial consoles, over the network (Jonathan Lemon's is working on this), and for looking at different data structures. In other words, there is no 'One True' .gdbinit, so we can provide the users with a plethora of choices to use, depending on the type of error they are seeing. :) > >> I think it makes sense, though I'm not clear about when to move it > >> there. Maybe savecore can do it if it's not already there. > > > > It has nothing to do with crashdumps themselves, but it has everything > > to do with debugging crashdumps. Just because there is a casual > > relationship doesn't mean it's the best place for the file. > > That statement applies to the saved kernel file as well. /var/crash is necessary to save since there's no other place to save it that guarantees a one-to-one mapping for dumps. If you replace your /kernel, then there's no way for the person debugging the file to be able to get to it. '.gdbinit' is common for *all* kernels, otherwise it would have no use. Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message