In a continuing effort to get kgdb merged into the mainline 2.6 Linux kernel [story], Amit Kale announced a feature freeze on his core-lite and i386-lite kgdb patches. At this point, he intends to only perform bug-fixes and code cleanup to these patches until they are merged, aiming for 2.6 inclusion by the end of this month. This first merge will only add kgdb support with a minimal featureset to the i386 architecture, allowing remote kernel debugging through a serial connection.
Recently added to the patches was some kgdb documentation, which begins:
"kgdb is a source level debugger for [the] linux kernel. It is used along with gdb to debug a linux kernel. 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."
From: Amit S. Kale [email blocked] Subject: Code freeze on lite patches and schedule for submission into mainline kernel Date: Wed, 3 Mar 2004 13:54:10 +0530 Hi, We have two sets of kgdb patches as of now: [core-lite, i386-lite, 8250] and [core, i386, ppc, x86_64, eth]. First set of kgdb patches (lite) is fairly clean. Let's consider it to be a candicate for submission to mainline kernel. I am freezing the lite patches wrt. feature updates. Only bug-fixes and code cleanups will be allowed in lite patches. You can make any feature enhancements to second set of patches. I propose following schedule for pushing kgdb lite into mainline kernel: Take 1: 8th , Take 2: 15th, Take 3: 22nd, Take 4:29th. I'll download the kernel snapshot (http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/) on these dates and submit a single patch for possible acceptance into mainline kenrel and feedback from community. Hopefully we'll succeed by end of this month. Please checkin any fixes or cleanups by end of this week. I plan to add some documentation to core-lite.patch this week (will send it for review in a separate email) Comments/suggestions? -- Amit Kale EmSysSoft (http://www.emsyssoft.com) KGDB: Linux Kernel Source Level Debugger (http://kgdb.sourceforge.net)
From: Pavel Machek [email blocked] Subject: Re: Code freeze on lite patches and schedule for submission into mainline kernel Date: Wed, 3 Mar 2004 12:01:54 +0100 Hi! > We have two sets of kgdb patches as of now: [core-lite, i386-lite, 8250] and > [core, i386, ppc, x86_64, eth]. First set of kgdb patches (lite) is fairly > clean. Let's consider it to be a candicate for submission to mainline kernel. There may be better way to get kgdb into mainline. AFAICS, mainline already contains kgdb/ppc. Submiting "core-lite, ppc-lite, 8250" would then be simply much needed cleanup. We can push i386 few days after that. Pavel -- When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
From: Amit S. Kale [email blocked] Subject: Re: Code freeze on lite patches and schedule for submission into mainline kernel Date: Wed, 3 Mar 2004 16:46:22 +0530 On Wednesday 03 Mar 2004 4:31 pm, Pavel Machek wrote: > > There may be better way to get kgdb into mainline. > > AFAICS, mainline already contains kgdb/ppc. Submiting "core-lite, > ppc-lite, 8250" would then be simply much needed cleanup. We can push > i386 few days after that. ppc.patch removes arch/ppc/kernel/ppc-stub.c and adds a new file kgdb.c I think that has a greater rejection chance. Let's not change the direction now. Some time ago there was another view that x86_64 would be easier. We have already had sufficient headache because of split -lite -heavy patches. Let's try to finish that asap. -Amit
From: Pavel Machek [email blocked] Subject: Re: Code freeze on lite patches and schedule for submission into mainline kernel Date: Wed, 3 Mar 2004 12:22:16 +0100 > ppc.patch removes arch/ppc/kernel/ppc-stub.c and adds a new file kgdb.c I > think that has a greater rejection chance. > > Let's not change the direction now. Some time ago there was another view that > x86_64 would be easier. We have already had sufficient headache because of > split -lite -heavy patches. Let's try to finish that asap. Okay, you are right. i386 is best tested. Pavel -- When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
From: Amit S. Kale [email blocked] Subject: Added KGDB documentation Date: Thu, 4 Mar 2004 14:56:43 +0530 Hi, I have added some documentation to core-lite.patch. It's as follows. Comments/feedback? Thanks. -- Amit Kale EmSysSoft (http://www.emsyssoft.com) KGDB: Linux Kernel Source Level Debugger (http://kgdb.sourceforge.net) Documentation/kgdb.txt ================== KGDB Linux kernel source level debugger Amit S. Kale [email blocked] Last updated March 2004. Introduction: kgdb is a source level debugger for linux kernel. It is used along with gdb to debug a linux kernel. 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 to the kernel being debugged. This version of kgdb is a lite version. It is available on i386 platform uses a serial line for communicating to gdb. Full kgdb containing more features and support more architecture is available along with plenty of documentation at http://kgdb.sourceforge.net/ Compiling a kernel: Enable Kernel hacking -> Kernel Debugging -> KGDB: kernel debugging with remote gdb Only generic serial port (8250) is supported in the lite version. Configure 8250 options. Booting the kernel: Kernel command line option "kgdbwait" makes kgdb wait for gdb connection during booting of a kernel. If you have configured simple serial port, the port number and speed can be overriden on command line by using option "kgdb8250=portnumber,speed", where port numbers are 0-3 for COM1 to COM4 respectively and supported speeds are 9600, 19200, 38400, 57600, 115200. Example: kgdbwait kgdb8250=0,115200 Connecting gdb: If you have used "kgdbwait", kgdb prints a message "Waiting for connection from remote gdb..." on the console and waits for connection from gdb. At this point you connect gdb to kgdb. Example: % gdb ./vmlinux (gdb) set remotebaud 115200 (gdb) target remote /dev/ttyS0 Once connected, you can debug a kernel the way you would debug an application program.