Friday, December 05, 2008

Linux Kernel Debugging with CDT

Just ran into this awesome tutorial on how to use the CDT for debugging the Linux kernel using qemu's gdb remote debug service that makes it work much like a standard hardware/JTAG debugger.

This was something I played with a while ago when I looked at adding hardware debugging support to the CDT as an optional service. And I believe Elena from QNX has continued on with that work and we should hopefully see it completed for Galileo (if not before that).

But it further solidifies for me how important qemu is as a tool in the belt of the embedded software developer. We've seen it as a key enabler for Android without which I'm not sure it would have achieved the momentum it has. I think there are still issues with it, and of course one I'm looking at is ease at adding new hardware emulation and 3D graphics support. But I think there is plenty of opportunity there and being an open source project, the door is open to help make that happen.

1 comment:

  1. Hi!

    I see you are very competent in CDT.
    I need some help with it (eclipse configuration always was too complicated and undocumented): I'm working with kernel source in eclipse, this is pretty handy, but I can't manage indexer to include autoconf.h at all!

    I discovered, that in addition to blog post on kernel debugging, there are few things to get complete navigation thru kernel source:
    1) add include directories (arch/{platform}/include, include, and in my case ubuntu/include)
    2) define symbols __KERNEL=1 for all and __ASSEMBLY__=1 for assembly (got these from makefile)
    3) add linux/autoconf.h to indexer "files to index up-first"

    But last one have no effect :(
    autoconf.h isn't included!

    "Create parser log" for any source file shows, that "Preincluded files (option -include):" list is empty!

    Can you tell me, how to specify preincluded headers correctly?

    I tried to specify path to it in different ways, but neither complete absolute path give any effect nor running "freshen all files"/rebuild.

    I use CDT SR1 package, only mylyn updates came from autoupdate.

    ReplyDelete