Hi - I've been trying to track down a problem I've had with a USB CD-Burner locking up. In the course of my investigations I ported the i386 remote gdb stuff to the Linux kernel, because I'm used to using gdb on the kernel (it works on SPARC and PPC) instead of trying to read oopses. For those not familiar with the remote debug feature, you use two computers, connected together with a null modem serial line. One computer has a complete Linux kernel tree on it, compiled with debugging information (-g); the other computer is the one running the kernel under test. You can breakpoint and halt the kernel, which puts it in a tight little loop reading packets (gdb, not IP) from the serial port and responding to the debugger. You get almost all the features you're used to with gdb - stack backtraces, single stepping, source-based variable names, intelligent structure decodes, etc. Anyway, I'm attaching the patch (against 2.4.6). After installing, a menu option appears under "Kernel hacking" for remote debugging. Recompile the whole kernel (make clean) so that it compiles with debugging info. Then supply the "kgdb" switch to the kernel command line, make sure the debugging computer is attached on COM1 (or whatever you want to call it), and run "target remote /dev/whatever" on the debugging computer. See arch/i386/kernel/stub-i386.c for more info. Known problems: - only runs on COM1. Shouldn't be hard to fix this - doesn't switch stacks, so you can't use gdb's "call" feature, which scribbles on the stack. Other than that, no problem. - doesn't support SMP, since I don't have an Intel SMP box. I'd guess what you'd want it to do is an smp_call_function that would halt all the processors and put them into some tight little loop while gdb fiddles things. ideas? - doesn't support any concept of multiple tasks/threads, though GDB can do this with it's remote protocol, and I've discovered that it'd be really nice to switch to another task within the kernel. Lacking this, you have to do stack backtraces by hand for other tasks. - we have to compile Linux with -O2 to get inline functions, and this can confuse GDB sometimes. When in doubt, study the assembly. And it still sometimes does some strange things, so might need some tweaks here and there, but works 95% of the time. Please try it out and let me know what you think. -- -bwb Brent Baccala baccala@freesoft.org ============================================================================== For news from freesoft.org, subscribe to announce@freesoft.org: mailto:announce-request@freesoft.org?subject=subscribe&body=subscribe ==============================================================================