How to debug kernel on ARM with gdb

Woody Wu narkewoody at gmail.com
Wed Apr 17 05:09:32 EDT 2013


Hi,

I am working on an embedded ARM board (s3c2416) and I can already
debug its boot loader (u-boot) with arm-linux-gdb, which talks to
a GDB server provided from J-Link.

Now I want to debug the kernel.  The problem is that how can I get
the correct symbol table for listing source lines in gdb.

I checked the symbols in my compiled vmlinux, it starts from 0xC0008000.
I think this is the final runtime address and should be a virtual
address after MMU enabled. When kernel getting loaded into RAM, the
virtual address probably not exists. On the other hand, the zImage
loaded by boot loader is not vmlinux actually, it should be head.S which
then carries vmlinux as piggy.

So, with these complexities, how can I correctly debug Linux kernel
starting from it's first instruction in head.S?

Who have experience on this? Thanks in advance.

-- 
woody
I can't go back to yesterday - because I was a different person then.



More information about the Kernelnewbies mailing list