Re: gdb can break on __init function ?

From: Jun Sun (jsun@mvista.com)
Date: Thu Apr 13 2000 - 12:13:44 EST


Keith Owens wrote:
>
> On Wed, 12 Apr 2000 14:03:43 -0700,
> Jun Sun <jsun@mvista.com> wrote:
> >I am using gdb/kdb to debug kernel through a serial line. It mostly
> >works. However I notice that I cannot break on any functions declared
> >as "__init". If I remove that declaration, everything is fine.
>
> __init code and data is collected in one place by the linker. After
> the kernel has finished initialization, the entire __init code and data
> is *freed* and reused as kmalloc space. Setting breakpoints in code
> that will be removed and reused for random data is a bad idea.

I understand that.

But the problem is I CAN NOT break at any __init function even BEFORE
the .*.init sections are freed.

I got a reply that confirms that such a breakpoint works on i386. It
makes me wonder if this problem is MIPS specific, or something I
specified wrong the lds file.

BTW, when I set the breakpoint on such a __init function, gdb reports
the correct address, but shows no file name and line number. Could it
be something wrong on the host side?

Jun

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:21 EST