Index: src/config.sub =================================================================== --- src.orig/config.sub 2004-09-04 13:23:53.000000000 +0530 +++ src/config.sub 2004-10-01 12:58:49.000000000 +0530 @@ -1297,6 +1297,9 @@ -kaos*) os=-kaos ;; + -lk*) + os=-lk + ;; -none) ;; *) Index: src/bfd/config.bfd =================================================================== --- src.orig/bfd/config.bfd 2004-09-03 22:45:31.000000000 +0530 +++ src/bfd/config.bfd 2004-10-01 12:58:49.000000000 +0530 @@ -521,6 +521,11 @@ targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" targ64_selvecs=bfd_elf64_x86_64_vec ;; + i[3-7]86-*-lk*) + targ_defvec=bfd_elf32_i386_vec + targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" + targ64_selvecs=bfd_elf64_x86_64_vec + ;; #ifdef BFD64 x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) targ_defvec=bfd_elf64_x86_64_vec @@ -534,6 +539,10 @@ targ_defvec=bfd_elf64_x86_64_vec targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec" ;; + x86_64-*-lk*) + targ_defvec=bfd_elf64_x86_64_vec + targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec" + ;; #endif i[3-7]86-*-lynxos*) targ_defvec=bfd_elf32_i386_vec Index: src/gdb/configure.tgt =================================================================== --- src.orig/gdb/configure.tgt 2004-09-29 02:09:17.000000000 +0530 +++ src/gdb/configure.tgt 2004-10-01 12:59:23.000000000 +0530 @@ -93,6 +93,7 @@ i[34567]86-*-linux*) gdb_target=linux build_gdbserver=yes ;; +i[34567]86-*-lk*) gdb_target=lk ;; i[34567]86-*-gnu*) gdb_target=i386gnu ;; i[34567]86-*-netware*) gdb_target=i386 configdirs="${configdirs} nlm" ;; @@ -212,6 +213,7 @@ * ) ;; esac ;; +x86_64-*-lk*) gdb_target=x86-64lk ;; x86_64-*-linux*) gdb_target=linux64 build_gdbserver=yes @@ -232,4 +234,5 @@ *-*-solaris*) gdb_osabi=GDB_OSABI_SOLARIS ;; *-*-*-gnu*) ;; # prevent non-GNU kernels to match the Hurd rule below *-*-gnu*) gdb_osabi=GDB_OSABI_HURD ;; +*-*-lk*) gdb_osabi=GDB_OSABI_LK ;; esac Index: src/gdb/defs.h =================================================================== --- src.orig/gdb/defs.h 2004-10-01 01:27:54.000000000 +0530 +++ src/gdb/defs.h 2004-10-01 12:58:49.000000000 +0530 @@ -1046,6 +1046,8 @@ GDB_OSABI_CYGWIN, + GDB_OSABI_LK, + GDB_OSABI_INVALID /* keep this last */ }; Index: src/gdb/osabi.c =================================================================== --- src.orig/gdb/osabi.c 2004-07-03 02:57:17.000000000 +0530 +++ src/gdb/osabi.c 2004-10-01 12:58:49.000000000 +0530 @@ -78,6 +78,8 @@ "Cygwin", + "Linux kernel", + "" }; Index: src/gdb/config/i386/lk.mt =================================================================== --- src.orig/gdb/config/i386/lk.mt 2003-01-30 15:54:37.000000000 +0530 +++ src/gdb/config/i386/lk.mt 2004-10-01 12:58:49.000000000 +0530 @@ -0,0 +1,3 @@ +# Target: Intel i386 running Linux kernel +TDEPFILES = i386-tdep.o i386-lk-tdep.o i387-tdep.o +TM_FILE= tm-lk.h Index: src/gdb/config/i386/tm-lk.h =================================================================== --- src.orig/gdb/config/i386/tm-lk.h 2003-01-30 15:54:37.000000000 +0530 +++ src/gdb/config/i386/tm-lk.h 2004-10-01 12:58:49.000000000 +0530 @@ -0,0 +1,6 @@ +#ifndef TM_LK_H +#define TM_LK_H + +#include "config/tm-lk.h" + +#endif /* #ifndef TM_LK_H */ Index: src/gdb/config/i386/tm-x86-64lk.h =================================================================== --- src.orig/gdb/config/i386/tm-x86-64lk.h 2003-01-30 15:54:37.000000000 +0530 +++ src/gdb/config/i386/tm-x86-64lk.h 2004-10-01 12:58:49.000000000 +0530 @@ -0,0 +1,25 @@ +/* Definitions to target GDB to Linux Kernel on x86-64. + + Copyright 2004 LinSysSoft Technologies Pvt. Ltd. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef TM_X86_64LK_H +#define TM_X86_64LK_H + +/* Nothing as yet */ + +#endif /* #ifndef TM_X86_64LK_H */ Index: src/gdb/config/i386/x86-64lk.mt =================================================================== --- src.orig/gdb/config/i386/x86-64lk.mt 2003-01-30 15:54:37.000000000 +0530 +++ src/gdb/config/i386/x86-64lk.mt 2004-10-01 12:58:49.000000000 +0530 @@ -0,0 +1,7 @@ +# Target: AMD x86-64 running Linux Kernel +TDEPFILES= x86-64-tdep.o x86-64-lk-tdep.o \ + i386-tdep.o i387-tdep.o i386-lk-tdep.o + +GDB_MULTI_ARCH=GDB_MULTI_ARCH_TM + +TM_FILE=tm-x86-64lk.h Index: src/gdb/config/tm-lk.h =================================================================== --- src.orig/gdb/config/tm-lk.h 2003-01-30 15:54:37.000000000 +0530 +++ src/gdb/config/tm-lk.h 2004-10-01 12:58:49.000000000 +0530 @@ -0,0 +1,19 @@ +/* Native support for Linux kernel, for GDB, the GNU debugger. + Copyright 2004 LinSysSoft Technologies Pvt. Ltd. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Nothing */ Index: src/gdb/i386-lk-tdep.c =================================================================== --- src.orig/gdb/i386-lk-tdep.c 2003-01-30 15:54:37.000000000 +0530 +++ src/gdb/i386-lk-tdep.c 2004-10-01 12:58:49.000000000 +0530 @@ -0,0 +1,49 @@ +/* Target-dependent code for Linux kernel running on i386's, for GDB. + + Copyright 2004 LinSysSoft Technologies Pvt. Ltd. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "defs.h" + +#include "osabi.h" + +#include "i386-tdep.h" +#include "i386-linux-tdep.h" + +static void +i386_lk_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + /* Linux kernel has an elf vmlinux file and uses elf format modules. */ + i386_elf_init_abi (info, gdbarch); + + set_gdbarch_num_regs (gdbarch, I386_NUM_GREGS); + set_gdbarch_register_name (gdbarch, i386_register_name); + set_gdbarch_register_reggroup_p (gdbarch, i386_register_reggroup_p); + + tdep->jb_pc_offset = 20; /* From . */ +} + +/* Provide a prototype to silence -Wmissing-prototypes. */ +extern void _initialize_i386_lk_tdep (void); + +void +_initialize_i386_lk_tdep (void) +{ + gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LK, i386_lk_init_abi); +} Index: src/gdb/x86-64-lk-tdep.c =================================================================== --- src.orig/gdb/x86-64-lk-tdep.c 2003-01-30 15:54:37.000000000 +0530 +++ src/gdb/x86-64-lk-tdep.c 2004-10-01 12:58:49.000000000 +0530 @@ -0,0 +1,43 @@ +/* Target-dependent code for Linux kernel running on x86_64's, for GDB. + + Copyright 2004 LinSysSoft Technologies Pvt. Ltd. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "defs.h" + +#include "osabi.h" + +#include "x86-64-tdep.h" +#include "x86-64-linux-tdep.h" + + +static void +x86_64_lk_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + x86_64_init_abi (info, gdbarch); +} + +/* Provide a prototype to silence -Wmissing-prototypes. */ +extern void _initialize_x86_64_lk_tdep (void); + +void +_initialize_x86_64_lk_tdep (void) +{ + gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_LK, + x86_64_lk_init_abi); +} Index: src/gdb/remote.c =================================================================== --- src.orig/gdb/remote.c 2004-09-25 01:21:18.000000000 +0530 +++ src/gdb/remote.c 2004-10-01 12:58:49.000000000 +0530 @@ -271,12 +271,13 @@ /* Default maximum number of characters in a packet body. Many remote stubs have a hardwired buffer size of 400 bytes - (c.f. BUFMAX in m68k-stub.c and i386-stub.c). BUFMAX-1 is used + (c.f. BUFMAX in m68k-stub.c and i386-stub.c). + BUFMAX is defined as 1024 in most kgdb stubs. BUFMAX-1 is used as the maximum packet-size to ensure that the packet and an extra NUL character can always fit in the buffer. This stops GDB trashing stubs that try to squeeze an extra NUL into what is already a full buffer (As of 1999-12-04 that was most stubs. */ - rs->remote_packet_size = 400 - 1; + rs->remote_packet_size = 1024 - 1; /* Should rs->sizeof_g_packet needs more space than the default, adjust the size accordingly. Remember that each byte is