Seeing symbols of modules in kgdb setup

Thayumanavar S thayumker at gmail.com
Tue May 10 22:19:24 EDT 2011


> I think the tutorial on Linsyssoft helped me a lot (but only after
> combining it with other resources): http://kgdb.linsyssoft.com/quickstart.htm.
>
> I have built a custom kernel with kgdb. kgdboc and kgdbwait are set up,
> I can break into my machine over serial. I can single step through the
> kernel, as long as no modules are involved.
>
> As soon as I have a module, I do not see its symbols or source anymore.
> http://kgdb.linsyssoft.com/downloads.htm mentions a modified "gdbmod",
> which has additional functionality to allow this.
You can use add-symbol-file to add symbol information to your modules.
Say as an example,
add-symbol-file /home/myhome/mymod.ko <text-address> -s .data
<data-address> -s .bss <bss-address>.
You can get the text-address, data-address, bss-address of the module
where it is loaded ( after loading the module) via:
cat /sys/module/mymod/sections/.text
cat /sys/module/mymod/sections/.data
cat /sys/module/mymod/sections/.bss
Recent kernel versions contain kgdb as part of the mainline kernel and
no need to apply any kernel patches if you use this kernel.

Thanks,
Thayumanavar S.



More information about the Kernelnewbies mailing list