I use remote (k) gdb to debug a problem in a module that causes a panic at boot, for example. when called init().
The stack trace shows what do_one_initcall(mod->init)causes the failure. To get the character file loaded into gdb, I need to get the address of the text section of the module and get it to load the module.
Since insmodbusybox (1.16.1) does not support -m, so I'm tied to grep modulename /proc/modules+ adding an offset from nmto figure out the address.
So, I ran into the problem of chicken and eggs here - to debug module loading, I need to load the module, but to load the module, I need to debug the problem ...
So, I'm now thinking about two options - is there a way to get address information:
- by printk () in module initialization code
- by printk () somewhere in the kernel code
all this before the call mod->init()- so I could place a breakpoint there, load the symbol file, click cand see its failure and write ...
source
share