I'm trying to debug modules using kgdb with 2.6.23 on an ARM platform but can't get gdb/ddd to show source code for the modules. I am able to print global variables from a module and can stop at breakpoints in the module but I only see assembly. I'm using the following sequence to try debugging:
1) boot target and load modules 2) cat each file under /sys/module/module_name/sections/ to get relocation information 3) break into kgdb (I have a simple serial ISR that calls breakpoint() when a specific character is sent over serial). 4) launch ddd & gdb and connect to the target 5) use add-symbol-file to tell gdb about the module 6) set a breakpoint and continue 'til hit The following output shows the call for #5 above. I've been adding a -s entry for every section listed under /sys/module/module_name/sections/ but it gives me warnings about both strtab and symtab -- I'm not sure if that's part of my problem or not. (gdb) add-symbol-file drivers/mydriver/mydriver.ko 0xBF003000 -s .data 0xBF00D110 -s .bss 0xBF00D360 -s .rodata 0xBF00B284 -s .rodata.str1.4 0xBF00B2A0 -s .strtab 0xBF00CAE0 -s .symtab 0xBF00BE50 -s __ksymtab 0xBF00BDF0 -s __ksymtab_strings 0xBF00BE10 add symbol table from file "drivers/mydriver/mydriver.ko" at .text_addr = 0xbf003000 .data_addr = 0xbf00d110 .bss_addr = 0xbf00d360 .rodata_addr = 0xbf00b284 .rodata.str1.4_addr = 0xbf00b2a0 .strtab_addr = 0xbf00cae0 .symtab_addr = 0xbf00be50 __ksymtab_addr = 0xbf00bdf0 __ksymtab_strings_addr = 0xbf00be10 warning: section .strtab not found in /home/lance/fw/drivers/mydriver/mydriver.ko warning: section .symtab not found in /home/lance/drivers/mydriver/mydriver.ko I have tried both gdb 6.6 and gdb 6.4 (the latter with the kgdb module notification patch) but neither will show source for the modules. I've also tried building the kernel & modules with both gcc 4.1.2 and gcc 4.2.1 but I get the same results. Is there a debug step I'm missing or do I need a newer version of gdb maybe? Thanks in advance, Lance ------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 _______________________________________________ Kgdb-bugreport mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport
