Hey Venkatram,

On Wed, Apr 28, 2010 at 11:33 AM, Venkatram Tummala
<venkatram...@gmail.com>wrote:
>
> to find these addresses by "p modules", the module has to be already
> loaded.....right? So, the initialization function of the module must have
> been  already executed....right? So, the question is how can we step through
> the initialization function of the module..? "p modules" won't help
> us..probably looking at /sys is a faster way to find module segment
> addresses, or am I missing something here in "p modules"??
>
>
Why don't you try setting breakpoints in kernel (kernel/module.c) after the
module has been loaded but before your modules' init function is called?

>From kernel/module.c , in SYSCALL_DEFINE3(init_module..):
the line load_module(...) loads your module into the kernel, and  the line
do_one_initcall(mod->init); calls the init functions.
So I think if you set a break point in between these lines, you should be
able to get the address of text section etc just in time before the init
functions is called, using p modules or something.

-Joel

Reply via email to