Marcel Moolenaar has been very busy with GDB code as of late, having imported gdb version 6.1.1 in late June and now supplying a patch to freebsd-arch@ that adds kernel debugging and helpful features to FreeBSD's gdb and ddb code, including thread awareness. Other interesting additions include optimizations for the 64-bit platforms, compression for remote gdb, and improved symbol handling. Marcel is looking to commit the patch in a week, barring any major issues, but the code requires testing on most supported platforms:
"The patch applies to alpha, amd64, i386, ia64 and sparc64. amd64 is known to compile but I can't test this stuff yet due to lack of hardware."
Completion of this work will satisfy a required feature on the 5.3 Open Issues list. Read on for the diff and Marcel's full announcement.
From: Marcel Moolenaar [email blocked] To: freebsd-arch Subject: Please review: revamp of kernel debugging code Date: 2004-07-06 5:33:51 Gang, I reworked the kernel debugging support to achieve the following: 1. Allow any device to be used as debug port, not just sio(4). This is required on platforms that don't support sio(4). Such as ia64. 2. Unify the remote GDB stubs and improve remote debugging. This applies to sparc64 and ia64. 3. Improve speed of remote GDB by implementing compression. This is pretty much required on ia64, where the register context is 9KB. 3. Add thread awareness to both remote GDB and DDB. This includes the ability to switch the active thread and provide backtraces for them. 4. Remove the NO_SIO option added on alpha to work around console braindeadness. Alpha now looks like a normal platform :-) 5. Detangle remote GDB support from DDB code to allow only remote GDB to be configured, but not DDB (and obviously vice versa). This also allows other debugger implementations to be added. 6. Improve symbol handling in DDB, especially for the pre-linker case. I probably forgot some items, but you get the gist. The patch applies to alpha, amd64, i386, ia64 and sparc64. amd64 is known to compile but I can't test this stuff yet due to lack of hardware. Typically you'll see that #ifdef DDB is being replaced with #ifdef KDB. This is because DDB indicates whether you want the DDB debugger, but not having DDB doesn't mean that there isn't any debugger at all. So a new option KDB as been added to indicate that certain debugging code should be compiled in. Please apply the patch and try it out. Note that the patch is quite large (~363KB), so http://people.freebsd.org/~marcel/gdb.diff I'll probably commit it in about a week or so if there aren't any showshopper issues. FYI, -- Marcel Moolenaar
From: Poul-Henning Kamp [email blocked] To: freebsd-arch Subject: Re: Please review: revamp of kernel debugging code Date: 2004-07-06 8:39:50 Marcel Moolenaar writes: > Gang, > > I reworked the kernel debugging support to achieve the following: Thankyou! I'll stick it in my tree here ASAP. -- Poul-Henning Kamp