Hi, Attached patches add kgdb support to gdb. They define two new targets i386-lk and x86_64-lk. Because of the definition of these targets, one can build a gdb with does not contain the linux operating environment specific things which are inappropriate for the kernel, like signal trampoline frame parsing. Linux operating environment specific things create problems while debugging the kernel. e.g. On ppc processors modules are loaded above the kernel stack. This causes gdb to think that it's executing a code in the stack and it interprets it as a signal handler. These patches have been tested on i386 kgdb and found to work as expected. The x86_64 support is still being fixed. I have written a short description for both these patches below. Could the gdb gurus please look at these patches and let me know whether they are appropriate for inclusion in mainline gdb? Any feedback/comments are most welcome. Thanks. -Amit lk.patch: This patch adds basic support for targets i386-lk and x86_64-lk. Lets a user connect to a kgdb kernel. It increases the minimum value of the size of remote_patcket_size from 399 to 1023 since kgdb packets can potentially send that packets that long. context.patch: This patch defines a frame CONTEXT_FRAME. This frame is used to represent the context switch in a kernel. A context frame appears very much like an inline function. It convers the switch_to code and reports the previous frame to begin at the place where switch_to ends (inside schedule). It also makes adjustments for PC and SP since PC and SP are modified inside switch_to code before the control goes to schedule. Without this support gdb has real problems when showing a backtrace that begins from switch_to. This patch also suppresses printing of CONTEXT_FRAMES and frames that contain scheduling functions in info threads listing. This is very similar to reporting of the WCHAN field in ps output, where scheduling functions are not reported. This supressing doesn't apply to backtrace command, so that full backtrace can be obtained by switching to a thread. Suppressing of scheduling frames should be useful for multithread applications too. I have seen threads sleeping in libc_nanosleep too many times in the info threads output. We can tweak this code so that info threads listing shows the caller of libc_nanosleep.