Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Jan 2011 14:44:41 -0500
From:      Ryan Stone <rysto32@gmail.com>
To:        Miki Magyari <magyarimiki@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: problem debugging kernel module using kernel crash dump with kgdb
Message-ID:  <AANLkTi=0t4WzGytC9=Ch_Ovc82t342M7YKz1znbjcxzp@mail.gmail.com>
In-Reply-To: <AANLkTi=%2BZOdjiq-SArU8%2B3t_4qvoOzK-LPhdFjFJ1EeG@mail.gmail.com>
References:  <AANLkTi=%2BZOdjiq-SArU8%2B3t_4qvoOzK-LPhdFjFJ1EeG@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=0t4WzGytC9=Ch_Ovc82t342M7YKz1znbjcxzp>