I think the problem might have to do with the way multiple object files are linked into a ko.
For example with ARCH=um, the address of a line in the ko object file increases: address source 1 balloc.c 1 2 balloc.c 2 3 super.c 1 4 super.c 2 5 super.c 3 While with ARCH=x86_64, the addresses are reset for each C file: address source line 1 balloc.c 1 2 balloc.c 2 1 super.c 1 2 super.c 2 3 super.c 3 This means address -> lineno mapping in the object file for X86_64 doesn't match what's actually in memory. Further debugging of kernel modules with ARCH=um works.. could this be a bug in kernel build for ARCH=x86_64? Thanks, -Joel On Tue, Jan 19, 2010 at 2:28 PM, Joel Fernandes <[email protected]>wrote: > I am trying to debug a kernel module that has been loaded after the start > of a kgdb session. > > Once I load the module, I do: > (gdb) add-symbol-file ~/ext2.ko 0xffffffffa01b1000 > > This works fine, and gdb knows the addresses of the symbols in the kernel > module, to verify this: > > At the KGDB target: > # cat /proc/kallsyms | grep ext2_ioctl > *ffffffffa01b8210 t ext2_ioctl [ext2]* > > In GDB: > (gdb) p ext2_ioctl > *$1 = {long int (struct file *, unsigned int, long unsigned int)} > 0xffffffffa01b8210 <ext2_ioctl>* > > However when I try to list the code of a function in the module, it > complaints that it does not have line number information: > > (gdb) list ext2_ioctl > *No line number known for ext2_ioctl.* > > The object file contains line number information as verified by: > # readelf -wL /root/ext2.ko > > But why doesn't gdb load it when I do an 'add-symbol-file' ? What am I > doing wrong here? > > Thanks! > -Joel > > ------------------------------------------------------------------------------ Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ Kgdb-bugreport mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport
