KGDB is a source level debugger for the linux kernel
http://stackoverflow.com/tags/kgdb/info
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.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通