Subject: Re: debugging kernel core dumps ?
To: None <current-user@netbsd.org, port-sparc@netbsd.org>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: port-sparc
Date: 09/26/1994 16:24:47
> Yes, "gdb -k netbsd.N vmcore.N" works - sort of. It puts you into a
> "kgdb" mode.
> options DEBUG, DIAGNOSTIC # extra kernel debugging
> options KGDB # support for kernel gdb
> options KGDBDEV=0xc01, KGDBRATE=38400 # device & baud rate
> Running "gdb -k netbsd.1 vmcore.1" yields
> netbsd4me [/var/crash] # gdb -k netbsd.1 vmcore.1
> (no debugging symbols found)...panic: rtfree 2
> #0 0xf8006c9c in snapshot ()
> (kgdb) where
> #0 0xf8006c9c in snapshot ()
[...]
> #9 0xf80233a8 in sosend ()
> ...
> (kgdb)
> Why does it say "No debugging symbols found" (and apparently there
> aren't) if I built the kernel with "options DEBUG, DIAGNOSTIC"?
Because those don't control debugging in the sense of debugger symbols
in the symbol table; those control debugging in the sense of putting
some extra consistency checks and such into the kernel.
> The man page for config.new admonishes
> The old undocumented-gflag is no longer supported. Instead, use
> ``makeoptions DEBUG="-g"'' and (typically) ``options KGDB''.
> Perhaps a reminder that `options DEBUG, DIAGNOSTIC' *and*
> `makeoptions DEBUG="-g"' are probably both needed to get crash dumps
> working is in order?
Um, your crash dumps are working just fine. I wouldn't expect you even
need DEBUG or DIAGNOSTIC for them, though since I haven't checked I
could well be wrong.
What I would suggest is that you (a) use makeoptions DEBUG="-g" in your
kernel config and (b) uncomment lines 89, 90, 91, and 92 in
Makefile.sparc (in arch/sparc/conf - I don't know why they're commented
by default). Then when you run gdb -k, use the .gdb kernel, but
install the other one as your boot kernel. (The .gdb one will be huge;
if you have five or six spare megs of disk in /, you can boot that one
if you want, but there's really no point.)
der Mouse
mouse@collatz.mcrcim.mcgill.edu