gdb/9: Linux kernel loadable modules
Thu Nov 16 04:48:00 GMT 2000

>Number:         9
>Category:       gdb
>Synopsis:       Linux kernel loadable modules
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 16 04:48:00 PST 2000
>Release:        5.0
linux-2.0.35, libc5, i386, modutils-2.1.121/2.3.19,
gdb 20000204
I'm trying to debug loadable kernel module. The module
is loaded into kernel with "insmod -m". Map file insmod
generates is used to provide paremeters to add-symbol-file
gdb command. Module is compiled with -g and without
-fomit-frame-pointer options.

The problem is to see the values of global variables defined 
in the module. The debugger complains that the address of
variable is unknown. It is possible however to view 
variables' values using their addresses from the map file.

Loading module in debugger at address 0, i.e. by
"add-symbol-file foo.o 0" has the same effect, i.e
the address of variable is unknown.

I suspect that only uninitialized variables are affected,
though I'm not sure.
Try debugging 2.0.x kernel module on libc5 system.
I've used a modified version of script
provided by Amit S. Kale at
to extract a relevant information from module map file.
Make sure that .moduse section that insmod adds to map file
is not given to add-symbol-file.


More information about the Gdb-prs mailing list