[ELDK] Kernel debugging with Denx 4.2 and BDI emulator
David.Rensberger at ambientcorp.com
Fri Jul 25 22:55:28 CEST 2008
I'm wondering if anyone else has tried to debug a kernel built with the
gcc-4.2.2 based toolchain and an emulator. I'm having very little luck
doing this. I can successfully set a breakpoint at start_kernel. I'm
also able to do a "step over" of the first subroutine call in
start_kernel (I forget what it's called), but after that, gdb seems to
skip over large sections of code. It sort of acts as if symbols are
just completely absent from the vmlinux image, even though I've (I
believe anyway) turned all optimization off. It may be more complicated
than that, however, as a "step over" often lands me in the middle of a
completely different function.
I'm building the kernel with the following options turned on via the
Linux configuration procedure:
I've also set the following flags in the Makefile (and yes, I've
verified that these are actually making it into the gcc command line
args during invocation):
-O0 (I also tried just leaving -O out altogether)
Does anyone know if the meaning of any of these command line arguments
has changed in 4.2.2 (or perhaps if the compiler is suddenly allowed to
or more prone to ignoring them)? The weird behavior that I see seems
to be consistent (i.e. it mis-behaves in exactly the same way, skips
over exactly the same code, etc.) regardless of how I have any of these
compiler options set.
The people who support me for the BDI3000 emulator say that setting
these options is normally sufficient to allow single stepping through
kernel startup code.
P.S. Based on the responses I get to this email, I may be able to
provide a little bit more detail, in terms of which functions seem to be
being skipped, etc. Unfortunately I don't have that information at my
fingertips right now.
More information about the eldk