kdb
[Top] [All Lists]

Re: [PATCH] kdb v1.0 for 2.3.29

To: slurn@xxxxxxxxxxxxxxxxxxxx (Scott Lurndal)
Subject: Re: [PATCH] kdb v1.0 for 2.3.29
From: "Andi Kleen" <ak@xxxxxxx>
Date: Tue, 8 Feb 2000 21:20:59 +0100
Cc: ak@xxxxxxx (Andi Kleen), linux-kernel@xxxxxxxxxxxxxxxx, kdb@xxxxxxxxxxx
In-reply-to: <200002081943.LAA83859@griffin.engr.sgi.com>; from slurn@griffin.engr.sgi.com on Tue, Feb 08, 2000 at 11:43:23AM -0800
References: <20000201185104.A14956@gruyere.muc.suse.de> <200002081943.LAA83859@griffin.engr.sgi.com>
Sender: owner-kdb@xxxxxxxxxxx
On Tue, Feb 08, 2000 at 11:43:23AM -0800, Scott Lurndal wrote:
> > 
> > On Tue, Feb 01, 2000 at 09:03:23AM -0800, Scott Lurndal wrote:
> > > This release restructures the code a bit and adds breakpoint
> > > instruction style (int 03) breakpoints.   They don't completely
> > > work yet at this time, so as a workaround, the 'bph' command
> > > which uses the hardware debug registers should be used to
> > > establish breakpoints.
> > > 
> > > There is some debug code present to save and display the contents of the
> > > last branch register MSR on page-fault entry to the kernel.
> > > 
> > > A list of changes and features can be found on
> > 
> > [...]
> > 
> > One change that I'm missing is a move of the module add code to above
> > the module init constructor call. That makes it possible to debug
> > crashing init_module() functions symbolically. 
> 
> Ok.  I'll do that.   However, by moving kdb_init() before mem_init(), 
> kdb cannot use the kernel memory allocators (It doesn't anyway, because
> it cannot trust them, and you wouldn't be able to debug them).

There must be some miscomunication. I was not proposing to change the
kernel startup (everything is statically linked there thus all symbols
are known anyways). What I want to change is the module loading
(kernel/module.c:sys_init_module()). Currently the symbols for the module
are registered to kdb after the module's init_module() function has 
run. This means you don't get a meaningfull backtrace if the init_module()
function crashes for some reason. The change I did was to move 
the kdbaddmodsym() loop before the mod->init() call (and add a appropiate
cleanup loop if mod->init() fails). This way it is possible to debug
the module constructor. 

-Andi


<Prev in Thread] Current Thread [Next in Thread>