problem debugging kernel module using kernel crash dump with kgdb

Ryan Stone rysto32 at gmail.com
Sun Jan 16 19:44:43 UTC 2011


gcc has helpfully inlined minixfs_mountfs into minixfs_mount for you.
kgdb, which is basically gdb patched to understand the structure of
kernel cores, has no idea how to handle inlined functions.  Sadly, you
have only two options here that I'm aware of:

1) If the crash is reproducible, recompile you kernel with the
attribute __attribute__((noinline)) attached to minixfs_mountfs's
prototype.  You should get a core that is possible to debug using
kgdb.

2) If the crash is difficult to reproduce, the only thing I've been
able to do in such a scenario is disassemble the function and try to
work out where the variables I'm interested in are.  This is extremely
painful, so I'd suggest going with option 1 if it's at all feasible.


More information about the freebsd-hackers mailing list