From mboxrd@z Thu Jan 1 00:00:00 1970 From: thayumker@gmail.com (Thayumanavar S) Date: Wed, 11 May 2011 07:49:24 +0530 Subject: Seeing symbols of modules in kgdb setup In-Reply-To: <20110510200019.GH5513@trikaliotis.net> References: <20110510200019.GH5513@trikaliotis.net> Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org > 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 -s .data -s .bss . 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.