Ubuntu下使用Eclipse+CDT+UML调试linux内核
本文介绍在Ubuntu下使用eclipse+cdt+uml进行linux内核调试的方法,所谓UML并非是指Unified Modeling Language,而是User Mode Linux,是将kernel作为process在linux系统中运行的技术,该技术目前已经集成进linux的版本中了,使用uml可以方便的进行kernel的调试,再结合eclipse一定的设置则可以进行源码级的debug。
首先,到http://www.doczj.com/doc/d3b2dfc4d5bbfd0a7956737e.html中下载一个linux版本,本文使用的是linux-3.3.8版本,然后解压缩,在根目录下运行如下命令:
make ARCH=um defconfig
make ARCH=um menuconfig
make ARCH=um
注意,在执行make ARCH=um menuconfig时要在”Kernel hacking”中选择“Compile the kernel with debug info”和“Compile the kernel with frame pointers”,如下图: