Re: Module debugging

Henner Eisen (eis@baty.hanse.de)
27 Nov 1997 22:38:23 +0100


Hi,

"Andrew E. Mileski" <aem@netcom.ca> writes:

>
> > is it possible to debug loadable kernel module ?
>
> I do all my development with them.
>
> It helps to printk the addresses of a few routines.
> Then compare these againt the module object.

Why not just using the "-m" option when insmoding the modules in question?

I.e. I use a script that loads the modules like

insmod -m isdn > /var/modules/isdn.map
insmod -m x25 > /var/modules/x25.map

# ..
# and after all modules are loaded ...
#

#
# create a System.map suitable for ksymoops and alike that contains symbols
# of resident kernel as well as of all currently loaded modules
#

cat $KERNEL_ROOT/System.map > /tmp/System.map
for i in `cat /proc/modules | sed 's/ .*$//'`
do
grep '^c' < /var/modules/$i.map | sed "s/$/@$i/"
done | sort >> /tmp/System.map

(might be improvable but works well for me). In case of an oops just
let ksymoops use that /tmp/System.map file.

Henner