Questions tagged [kgdb]

KGDB is a source level debugger for the linux kernel. It is used along with gdb to debug linux kernels. It requires two machines that are connected via a serial connection.

Kernel developers can debug a kernel similar to application programs with use of KGDB. It makes it possible to place breakpoints in kernel code, step through the code and observe variables.

Two machines are required for using KGDB. One of these machines is a development machine and the other is a test machine. The machines are connected through a serial line, a null-modem cable which connects their serial ports. The kernel to be debugged runs on the test machine. gdb runs on the development machine. The serial line is used by gdb to communicate with the kernel being debugged.

KGDB is available for i386, x86_64, ppc and s390 architectures.

KGDB is a kernel patch. It has to be applied to a linux kernel to enable kernel debugging. KGDB adds the following components to a kernel.

  • gdb stub - The gdb stub is the heart of the debugger. It is the part that handles requests coming from gdb on the development machine. It has control of all processors in the target machine when the kernel running on it is inside the debugger.
  • modifications to fault handlers - Kernel gives control to debugger when an unexpected fault occurs. A kernel which does not contain gdb panics on unexpected faults. Modifications to fault handles allow kernel developers to analyze unexpected faults.
  • serial communication - This component uses a serial driver in the kernel and offers an interface to gdb stub in the kernel. It is responsible for sending and receiving data from a serial line. This component is also responsible for handling control break requests sent by gdb.

Project site

66 questions
0
votes
1 answer

How to break the REMOTE debugged Linux kernel from the LOCAL machine via GDB + KGDB?

I'm debugging the Linux kernel through GDB + KGDB + two virtual machines + serial ports. If we use GDB to debug a normal program, we can just press Ctrl+C to break the execution of the program. However, when I connect GDB to a remote KGDB stub, I…
xmllmx
  • 39,765
  • 26
  • 162
  • 323
0
votes
1 answer

Not able to set breakpoint on some functions in kgdb setup

I have kgdb setup using two virtual machines, both are having CentOs 6.4(actually kgdb host is clone of target). I am successfully able to connect to remote target and start debugging. I want to debug RAID driver, specifically raid456.ko. My…
pratik
  • 434
  • 2
  • 8
0
votes
1 answer

Need of KDB patch for powerpc Architecture

I am using Linux Kernel Version 2.6.34.6 with powerPC. I knew that KDB was merged with Kernel mainline 2.6.35. Hence I need to apply KDB patch with my kernel, But I couldn't find any patch for powerPC in the following…
Jegan
  • 188
  • 3
  • 15
0
votes
2 answers

Debugging Android kernel: Passing arguments to android kernel while booting

I am trying to get kgdb working with Android kernel using http://bootloader.wikidot.com/android:kgdb. I got stucked at following step: Configure kernel command line Specify ttyGS0 as the kgdboc device. Add the following into the kernel…
sattu
  • 632
  • 1
  • 22
  • 37
0
votes
1 answer

How the kernel enters kdb mode by sysrq-g?

Can someone suggest how the kernel hangs while entering kdb mode using the command echo g > /proc/sysrq-trigger .How kgdb and kdb differs? Is there any process running when the kernel enters debugger mode?.
Djames
  • 61
  • 6
0
votes
1 answer

How to Check Kgdb is enabled or not?

I have a kernel image and would like to debug with kgdb. The .config also not available, otherwise I could check the flags in it. In /proc/sys/ folder also there is no entry about kgdb. Is there any way to check whether that image is kgdb enabled or…
Jeyaram
  • 9,158
  • 7
  • 41
  • 63
1 2 3 4
5