Examining core dump with gdb

Peter Skvarka <[email protected]> Wed, 12 Mar 2025 11:04:26 +0100
Newsgroups gmane.os.netbsd.devel.toolchain
Organization Soft in Engines
Message-ID <[email protected]>
Hello,
I have /etc/defaults/rc.conf setup like described on:
https://wiki.netbsd.org/tutorials/panic/ relating to savecore, 
savecore_flags, savecore_dir. (on NetBSD 10.1)

On the page is written:
"...To load the core dump into gdb, after uncompressing it with 
gunzip(1), use target kvm /path/to/netbsd.core..."

When I try with unzipped core dump:
/var/crash#gdb
(gdb) target kvm netbsd.10.core
[1]   Abort trap (core dumped) gdb
/var/crash#

When I try:
(gdb) core-file netbsd.10.core
"/var/crash/netbsd.10.core" is not a core dump: file format not recognized

When I try crash instead of gdb I have some result:

/var/crash# crash -M netbsd.10.core
Crash version 10.1, image version 10.1.
crash: _kvm_kvatop(0)
Kernel compiled without options LOCKDEBUG.
System panicked: trap
Backtrace from time of crash is available.

crash> bt
__kernel_end() at 0
kern_reboot() at sys_reboot
vpanic() at vpanic+0x192
panic() at device_printf
trap() at startlwp
--- trap (number 6) ---
__kernel_end() at ffffffff81de0132

crash> bt 10
crash: _kvm_kvatop(18)
crash: kvm_read(0x18, 8): invalid translation (invalid level 4 PDE)
crash>

I have two questions:
1. What to check/correct to be able to load core dump into gdb ?
2. Does exist any help or page describing how to use crash bt command to 
display full stack ?

Peter