debugging kernel modules

4 messages, 3 authors, 2002-08-06 · open the first message on its own page

debugging kernel modules

From: Brian Kuschak <hidden>
Date: 2002-08-05 23:00:54

Wolfgang has a nice tutorial on this:
http://www.denx.de/doc/TQM8xxL/debugging.html

But here's the question - is there any way to dump the
module load addresses, after the fact?  'insmod -m'
works well if you always remember to use it to load
the module.  FreeBSD has 'kldstat' which dumps module
address information at any time.  Is there anything
similar to kldstat for linux?  If not, any comments on
how hard it would be to write one?

-Brian


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

Re: debugging kernel modules

From: Daniel L. Taylor <hidden>
Date: 2002-08-05 23:14:30

apropos modules -> lsmod; man lsmod -> ksyms;
man ksyms -> "ksyms -m"

Does this help?

Brian Kuschak wrote:
Wolfgang has a nice tutorial on this:
http://www.denx.de/doc/TQM8xxL/debugging.html

But here's the question - is there any way to dump the
module load addresses, after the fact?  'insmod -m'
works well if you always remember to use it to load
the module.  FreeBSD has 'kldstat' which dumps module
address information at any time.  Is there anything
similar to kldstat for linux?  If not, any comments on
how hard it would be to write one?

-Brian
--
Dan.Taylor@atlp.com

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

Re: debugging kernel modules

From: Brian Kuschak <hidden>
Date: 2002-08-06 02:43:22

Thanks Dan, I think that's it.  With a little bit of
scripting I should be able to make it work nicely.

--- "Daniel L. Taylor" <Dan.Taylor@atlp.com> wrote:
apropos modules -> lsmod; man lsmod -> ksyms;
man ksyms -> "ksyms -m"

Does this help?

Brian Kuschak wrote:
quoted
Wolfgang has a nice tutorial on this:
http://www.denx.de/doc/TQM8xxL/debugging.html

But here's the question - is there any way to dump
the
quoted
module load addresses, after the fact?  'insmod
-m'
quoted
works well if you always remember to use it to
load
quoted
the module.  FreeBSD has 'kldstat' which dumps
module
quoted
address information at any time.  Is there
anything
quoted
similar to kldstat for linux?  If not, any
comments on
quoted
how hard it would be to write one?

-Brian
--
Dan.Taylor@atlp.com

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

Re: debugging kernel modules

From: Michael Habermann <hidden>
Date: 2002-08-06 04:31:03

Brian Kuschak wrote:
But here's the question - is there any way to dump the
module load addresses, after the fact?  'insmod -m'
If necessary, it also works without tools.

The linux kernel has the symbol module_list, which contains a linked
list of all modules. You can follow the linked list until you find your
module. Take the address of the struct module list entry (!) and add
(size_of_struct+4). Then you get to the start address of your module.

E.g.:
&struct module = 0xc100b000
size_of_struct = 0x60

=> .text = 0xc1000064


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help