Subject: Re: kernel debuggers, dumps, and savecore issues
To: None <woods@planix.com>
From: Gordon W. Ross <gwr@mc.com>
List: port-sun3
Date: 11/25/1997 09:53:22
> Date: Mon, 24 Nov 1997 17:20:10 -0500 (EST)
> From: woods@most.weird.com (Greg A. Woods)
> 
> That reminds me, is 'cc -g' still of any use, esp. for DDB?  Is KGDB of
> any use, or even possible?  Shouldn't the stuff about 'gdb -k' be
> removed from options(4)?

Yes, 'cc -g' is still of use for kernels that 'gdb -k' will talk to
(actually, the current equivalent of 'gdb -k').  Not useful for DDB.

> Is there any (planned?) support for un-tangling swap area stuff in the
> kernel debuggers?  I.e. for digging deeper into the state of a process
> that's been partially paged out, or even swapped out, from a dump image?
> I would think this could be useful, esp. for emulation-related issues.

No plans that I know of, but I'm not in on many of the plans.

> > The only unusual thing about savecore on the sun3 is that the machine-
> > dependent kernel core header has some MMU state needed by libkvm.
> 
> Which brings up the issue of how much bigger the dump device must be
> than physical RAM.  I've got 48KB of space on the primary dump/swap
> device now for a 32MB machine, but I've seen the "WARNING: EOF on dump"
> from savecore and now that I've peered at the source the only way I can
> see that it could do that is if the dumpsize values got trashed in the
> crash or were miscalculated in the first place (unless I've seriously
> under-calculated the extra space required for a dump).

Probably just a bug somewhere.  The sun3 uses three extra pages.
I just tried it out, and this machine that used to be able to
savecore now complains about "EOF on dump device" like yours.
Nonetheless, the kernel core file appears to be usable.

venus% gdb netbsd.0
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (m68k-netbsd), Copyright 1996 Free Software Foundation, Inc...
(no debugging symbols found)...
(gdb) target kcore netbsd.0.core
#0  0xe0a0f24 in cpu_reboot ()
(gdb) print/x dumpsize
$1 = 0xc03
(gdb)

Someone will have to look at savecore (or libkvm).