Kgdb git



Keywords: kgdb git
Description: It is fascinating to think that you have control over running Linux Kernel. You can stop, can single-step, can resume and even can put break-points on running Kernel. In fact, you can debug the

It is fascinating to think that you have control over running Linux Kernel. You can stop, can single-step, can resume and even can put break-points on running Kernel. In fact, you can debug the kernel as easily as you debug any application.

The steps mentioned here are with reference to 2.6.26 Kernel. The main reason is KGDB code is merged into Linux tree from 2.6.26-RC5 kernel. (As a side note, for kernel < 2.6.26-RC5, you have to get kgdb patch from [ http://kgdb.linsyssoft.com/kernel.htm ] and apply them to kernel)

Two x86 machines are required for using KGDB. One of the machines runs a kernel to be debugged called "TEST MACHINE". The other machine runs gdb "DEVELOPMENT MACHINE". A serial line is required between the development and the test machine. And so obviously, machines need one serial port each. Basically, you will be sending "Debugging Commands" from "DEVELOPMENT MACHINE" to "TEST MACHINE".

2. Recompile the Kernel on "DEVELOPMENT MACHINE". Go to Kernel Hacking and Enable the following options:

5. Now, edit the GRUB entry for that kernel on "TEST MACHINE". Add kernel options/kernel parameters like kgdbwait and kgdboc=ttyS0,115200

kgdbwait -- > This will make Kernel to wait on boot time and will expect someone to connect to it and give further commands kgdboc --> This is a KGDB I/O driver and we are supplying two arguments. ttyS0 will tell that communication will happen on Serial Port 0 and 115200 is the baudrate.

The argument vmlinux file is the file that is created with Debug symbols. It will be of much larger size and more than likely to be in the directory where you gave "make" command.

8. Assuming that on "DEVELOPMENT MACHINE" you have set serial interface baudrate as 115200. Connect to the "TEST MACHINE" with target command.

9. This will stop your Kernel booting on "TEST MACHINE" and will give control to your "DEVELOPMENT MACHINE". Now, you can do Single-stepping or put breakpoints and etc.

10. Once your Kernel is running on "TEST MACHINE" and you want control over your running kernel from "DEVELOPMENT MACHINE", You have to send MANUALLY on TEST machine SysRq command. So, on "TEST MACHINE" press SysRq + g

2. You may find some time that while stopping execution through SysRq key on "TEST MACHINE", it stops but then it is not able to communicate over serial cable with "DEVELOPMENT MACHINE". The reason can be, your KGDB I/O driver is not passed arguments properly and you may need to reconfigure the driver by following way,

You can debug Linux Kernel over KGDB with Visual Studio using the VisualKernel plugin. This tutorial shows how to use it with KGDB.




Photogallery Kgdb git:


sivaborra-2-638.jpg?cb=1442319456


just do IT


Linux Solutions on OMAP3x


Introduction and course Details of Embedded Linux Platform Developer


Linux Kernel Development (3rd Edition)


Linux Kernel Development (3rd Edition)


just do IT


yocto | Page 6


kgdb | ???????


yocto | Page 6


Henry Choi: October 2014


Virtuous blogs


Category:Linux - Texas Instruments Wiki


Yocto Project Development Manual


Yocto Project Development Manual


Android GDB Debugging (Chinese)


freiesMagazin 08/2008


ODROID Magazine August 2014


ZEWAREN.NET | The personal website of Erwan Martin


2010/09/01 - Xilinx - The Zynq book (ebook)


CV_DishendraDeshmukh