Debug facilities:
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu May 17 16:22:51 2007 +0000 (2007-05-17)
changeset 96aa1a9fbd6eb8
parent 95 57694569322b
child 97 63a30dd47eb8
Debug facilities:
- add a framework to easily add new ones
- add gdb as a first debug facility
- add patches for gdb
After the kernel checked its installed headers, clean up the mess of .checked.* files.
Reorder scripts/crosstool.sh:
- dump the configuration early
- renice early
- get info about build system early, when setting up the environment
- when in cross or native, the host tools are those of the build system, and only in this case
- elapsed time calculations moved to scripts/functions
Remove handling of the color: it's gone once and for all.
Update tools/addToolVersion.sh:
- handle debug facilities
- commonalise some code
- remove dead tools (cygwin, tcc)
Point to my address for bug reports.
Makefile
README
config/config.in
config/debug.in
config/debug/gdb.in
config/global.in
config/toolchain.in
patches/gdb/6.2.1/100-uclibc-conf.patch
patches/gdb/6.2.1/200-uclibc-readline-conf.patch
patches/gdb/6.2.1/400-mips-coredump.patch-2.4.23-29
patches/gdb/6.2.1/500-thread-timeout.patch
patches/gdb/6.3/100-uclibc-conf.patch
patches/gdb/6.3/200-uclibc-readline-conf.patch
patches/gdb/6.3/400-mips-coredump.patch-2.4.23-29
patches/gdb/6.3/500-thread-timeout.patch
patches/gdb/6.3/600-debian_10.selected-frame.patch
patches/gdb/6.3/620-debian_static-thread-db.patch
patches/gdb/6.3/630-debian_24.tracepoint-segv.patch
patches/gdb/6.3/640-debian_dwarf2-frame-signal-unwinder.patch
patches/gdb/6.3/650-debian_vsyscall-gdb-support.patch
patches/gdb/6.3/660-debian_dwarf-cfa-restore.patch
patches/gdb/6.3/680-debian_sim-destdir.patch
patches/gdb/6.3/690-debian_member-field-symtab.patch
patches/gdb/6.3/700-debian_cp-pass-by-reference.patch
patches/gdb/6.3/710-debian_thread-db-multiple-libraries.patch
patches/gdb/6.3/720-debian_static-threads-test.patch
patches/gdb/6.3/730-debian_gdb-fix-tracefork-check.patch
patches/gdb/6.3/740-debian_make-cv-type-crash.patch
patches/gdb/6.3/750-debian_sparc-singlestep.patch
patches/gdb/6.3/760-debian_vsyscall-bfd-close-result.patch
patches/gdb/6.3/770-debian_vfork-done-spelling.patch
patches/gdb/6.3/780-debian_gdbserver-rdynamic.patch
patches/gdb/6.3/790-debian_dwarf2-cfi-warning.patch
patches/gdb/6.3/800-debian_linux-use-underscore-exit.patch
patches/gdb/6.3/810-debian_bfd-no-kylix-crash.patch
patches/gdb/6.3/820-debian_disable-linux-fork-messages.patch
patches/gdb/6.4/100-uclibc-conf.patch
patches/gdb/6.4/200-uclibc-readline-conf.patch
patches/gdb/6.4/400-mips-coredump.patch-2.4.23-29
patches/gdb/6.4/500-thread-timeout.patch
patches/gdb/6.4/600-fix-compile-flag-mismatch.patch
patches/gdb/6.5/100-uclibc-conf.patch
patches/gdb/6.5/200-uclibc-readline-conf.patch
patches/gdb/6.5/400-mips-coredump.patch-2.4.23-29
patches/gdb/6.5/500-thread-timeout.patch
patches/gdb/6.5/600-fix-compile-flag-mismatch.patch
patches/gdb/6.6/100-uclibc-conf.patch
patches/gdb/6.6/600-fix-compile-flag-mismatch.patch
scripts/build/debug.sh
scripts/build/debug/gdb.sh
scripts/build/kernel_linux.sh
scripts/crosstool.sh
scripts/functions
tools/addToolVersion.sh
     1.1 --- a/Makefile	Mon May 14 19:59:41 2007 +0000
     1.2 +++ b/Makefile	Thu May 17 16:22:51 2007 +0000
     1.3 @@ -34,9 +34,7 @@
     1.4  	@echo  'Execute "make" or "make all" to build all targets marked with [*]'
     1.5  
     1.6  .config: $(shell find $(CT_TOP_DIR)/config -type f -name '*.in')
     1.7 -	@make menuconfig
     1.8 -	@# Because exiting menuconfig without saving is not an error to menuconfig
     1.9 -	@test -f .config
    1.10 +	@make oldconfig
    1.11  
    1.12  # Actual build
    1.13  build: .config
     2.1 --- a/README	Mon May 14 19:59:41 2007 +0000
     2.2 +++ b/README	Thu May 17 16:22:51 2007 +0000
     2.3 @@ -7,3 +7,7 @@
     2.4  
     2.5  You can also point your browser to
     2.6    http://ymorin.is-a-geek.org/dokuwiki/projects/crosstool
     2.7 +
     2.8 +If you need to send a bug report or a patch, please mail:
     2.9 +   yann.morin.1998 (at) anciens.enib.fr
    2.10 +with subject prefixed with "[CT_NG]"
     3.1 --- a/config/config.in	Mon May 14 19:59:41 2007 +0000
     3.2 +++ b/config/config.in	Thu May 17 16:22:51 2007 +0000
     3.3 @@ -5,3 +5,4 @@
     3.4  source config/binutils.in
     3.5  source config/cc.in
     3.6  source config/libc.in
     3.7 +source config/debug.in
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/config/debug.in	Thu May 17 16:22:51 2007 +0000
     4.3 @@ -0,0 +1,7 @@
     4.4 +# Debug facilities menu
     4.5 +
     4.6 +menu "Debug facilities"
     4.7 +
     4.8 +source config/debug/gdb.in
     4.9 +
    4.10 +endmenu
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/config/debug/gdb.in	Thu May 17 16:22:51 2007 +0000
     5.3 @@ -0,0 +1,75 @@
     5.4 +# GDB menu
     5.5 +
     5.6 +menuconfig GDB
     5.7 +    bool
     5.8 +    prompt "gdb"
     5.9 +    default n
    5.10 +    depends on EXPERIMENTAL
    5.11 +    help
    5.12 +      Enable gdb for the target
    5.13 +
    5.14 +if GDB
    5.15 +
    5.16 +config GDB_CROSS
    5.17 +    bool
    5.18 +    prompt "Cross-gdb"
    5.19 +    default y
    5.20 +    help
    5.21 +      Build and install a cross-gdb for the target, and to run on host.
    5.22 +
    5.23 +config GDB_NATIVE
    5.24 +    bool
    5.25 +    prompt "Native gdb"
    5.26 +    default n
    5.27 +    help
    5.28 +      Build and install a native gdb for the target, to run on the target.
    5.29 +
    5.30 +choice
    5.31 +    bool
    5.32 +    prompt "gdb version"
    5.33 +
    5.34 +config GDB_V_snapshot
    5.35 +    bool
    5.36 +    prompt "snapshot"
    5.37 +    depends on EXPERIMENTAL
    5.38 +
    5.39 +config GDB_V_6_2_1
    5.40 +    bool
    5.41 +    prompt "6.2.1"
    5.42 +    depends on OBSOLETE
    5.43 +
    5.44 +config GDB_V_6_3
    5.45 +    bool
    5.46 +    prompt "6.3"
    5.47 +    depends on OBSOLETE
    5.48 +
    5.49 +config GDB_V_6_4
    5.50 +    bool
    5.51 +    prompt "6.4"
    5.52 +    depends on OBSOLETE
    5.53 +
    5.54 +config GDB_V_6_5
    5.55 +    bool
    5.56 +    prompt "6.5"
    5.57 +
    5.58 +config GDB_V_6_6
    5.59 +    bool
    5.60 +    prompt "6.6"
    5.61 +
    5.62 +# CT_INSERT_VERSION_ABOVE
    5.63 +# Don't remove above line!
    5.64 +endchoice
    5.65 +
    5.66 +config GDB_VERSION
    5.67 +    string
    5.68 +    default "snapshot" if GDB_V_snapshot
    5.69 +    default "6.2.1" if GDB_V_6_2_1
    5.70 +    default "6.3" if GDB_V_6_3
    5.71 +    default "6.4" if GDB_V_6_4
    5.72 +    default "6.5" if GDB_V_6_5
    5.73 +    default "6.6" if GDB_V_6_6
    5.74 +# CT_INSERT_VERSION_STRING_ABOVE
    5.75 +# Don't remove above line!
    5.76 +
    5.77 +endif
    5.78 +
     6.1 --- a/config/global.in	Mon May 14 19:59:41 2007 +0000
     6.2 +++ b/config/global.in	Thu May 17 16:22:51 2007 +0000
     6.3 @@ -262,18 +262,6 @@
     6.4        WARNING! Very CPU intensive! If you have spare CPU, then you can use it,
     6.5        otherwise, refrain from using it.
     6.6  
     6.7 -config LOG_USE_COLORS
     6.8 -    bool
     6.9 -    prompt "Use colors for logging to console"
    6.10 -    default n
    6.11 -    help
    6.12 -      Use colors to highlight important messages.
    6.13 -      ERROR: bright red
    6.14 -      WARN : bright yellow
    6.15 -      INFO : bright green
    6.16 -      EXTRA: dim green
    6.17 -      DEBUG: dim white
    6.18 -
    6.19  config LOG_TO_FILE
    6.20      bool
    6.21      prompt "Log to a file"
     7.1 --- a/config/toolchain.in	Mon May 14 19:59:41 2007 +0000
     7.2 +++ b/config/toolchain.in	Thu May 17 16:22:51 2007 +0000
     7.3 @@ -109,6 +109,13 @@
     7.4  
     7.5  endchoice
     7.6  
     7.7 +config TOOLCHAIN_TYPE
     7.8 +    string
     7.9 +    default "native"        if NATIVE
    7.10 +    default "cross"         if CROSS
    7.11 +    default "cross-native"  if CROSS_NATIVE
    7.12 +    default "canadian"      if CANADIAN
    7.13 +
    7.14  config BUILD 
    7.15      string
    7.16      prompt "Build system triplet"
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/patches/gdb/6.2.1/100-uclibc-conf.patch	Thu May 17 16:22:51 2007 +0000
     8.3 @@ -0,0 +1,290 @@
     8.4 +diff -urN gdb-6.2-dist/bfd/config.bfd gdb-6.2/bfd/config.bfd
     8.5 +--- gdb-6.2-dist/bfd/config.bfd	2004-07-09 07:32:35.000000000 -0500
     8.6 ++++ gdb-6.2/bfd/config.bfd	2004-08-08 04:23:19.000000000 -0500
     8.7 +@@ -129,7 +129,7 @@
     8.8 +     targ_defvec=ecoffalpha_little_vec
     8.9 +     targ_selvecs=bfd_elf64_alpha_vec
    8.10 +     ;;
    8.11 +-  alpha*-*-linux-gnu* | alpha*-*-elf*)
    8.12 ++  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
    8.13 +     targ_defvec=bfd_elf64_alpha_vec
    8.14 +     targ_selvecs=ecoffalpha_little_vec
    8.15 +     ;;
    8.16 +@@ -139,7 +139,7 @@
    8.17 +   alpha*-*-*)
    8.18 +     targ_defvec=ecoffalpha_little_vec
    8.19 +     ;;
    8.20 +-  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
    8.21 ++  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu | ia64*-*-linux-uclibc*)
    8.22 +     targ_defvec=bfd_elf64_ia64_little_vec
    8.23 +     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
    8.24 +     ;;
    8.25 +@@ -216,7 +216,7 @@
    8.26 +     targ_defvec=bfd_elf32_littlearm_vec
    8.27 +     targ_selvecs=bfd_elf32_bigarm_vec
    8.28 +     ;;
    8.29 +-  armeb-*-elf | arm*b-*-linux-gnu*)
    8.30 ++  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
    8.31 +     targ_defvec=bfd_elf32_bigarm_vec
    8.32 +     targ_selvecs=bfd_elf32_littlearm_vec
    8.33 +     ;;
    8.34 +@@ -224,7 +224,7 @@
    8.35 +     targ_defvec=bfd_elf32_littlearm_vec
    8.36 +     targ_selvecs=bfd_elf32_bigarm_vec
    8.37 +     ;;
    8.38 +-  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
    8.39 ++  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
    8.40 +   arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
    8.41 +     targ_defvec=bfd_elf32_littlearm_vec
    8.42 +     targ_selvecs=bfd_elf32_bigarm_vec
    8.43 +@@ -373,7 +373,7 @@
    8.44 +     ;;
    8.45 + 
    8.46 + #ifdef BFD64
    8.47 +-  hppa*64*-*-linux-gnu*)
    8.48 ++  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
    8.49 +     targ_defvec=bfd_elf64_hppa_linux_vec
    8.50 +     targ_selvecs=bfd_elf64_hppa_vec
    8.51 +     ;;
    8.52 +@@ -384,7 +384,7 @@
    8.53 +     ;;
    8.54 + #endif
    8.55 + 
    8.56 +-  hppa*-*-linux-gnu* | hppa*-*-netbsd*)
    8.57 ++  hppa*-*-linux-gnu* | hppa*-*-netbsd* | hppa*-*-linux-uclibc*)
    8.58 +     targ_defvec=bfd_elf32_hppa_linux_vec
    8.59 +     targ_selvecs=bfd_elf32_hppa_vec
    8.60 +     ;;
    8.61 +@@ -507,7 +507,7 @@
    8.62 +     targ_selvecs=bfd_elf32_i386_vec
    8.63 +     targ_underscore=yes
    8.64 +     ;;
    8.65 +-  i[3-7]86-*-linux-gnu*)
    8.66 ++  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
    8.67 +     targ_defvec=bfd_elf32_i386_vec
    8.68 +     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
    8.69 +     targ64_selvecs=bfd_elf64_x86_64_vec
    8.70 +@@ -521,7 +521,7 @@
    8.71 +     targ_defvec=bfd_elf64_x86_64_vec
    8.72 +     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
    8.73 +     ;;
    8.74 +-  x86_64-*-linux-gnu*)
    8.75 ++  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
    8.76 +     targ_defvec=bfd_elf64_x86_64_vec
    8.77 +     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
    8.78 +     ;;
    8.79 +@@ -691,7 +691,7 @@
    8.80 +     targ_defvec=hp300hpux_vec
    8.81 +     targ_underscore=yes
    8.82 +     ;;
    8.83 +-  m68*-*-linux*aout*)
    8.84 ++  m68*-*-linux*aout* | m68*-*-linux-uclibc*)
    8.85 +     targ_defvec=m68klinux_vec
    8.86 +     targ_selvecs=bfd_elf32_m68k_vec
    8.87 +     targ_underscore=yes
    8.88 +@@ -972,8 +972,8 @@
    8.89 +     ;;
    8.90 + #endif
    8.91 +   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
    8.92 +-  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
    8.93 +-  powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
    8.94 ++  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | powerpc-*-rtems* | \
    8.95 ++  powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss* )
    8.96 +     targ_defvec=bfd_elf32_powerpc_vec
    8.97 +     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
    8.98 +     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
    8.99 +@@ -1009,8 +1009,8 @@
   8.100 +     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
   8.101 +     ;;
   8.102 +   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
   8.103 +-  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
   8.104 +-  powerpcle-*-rtems*)
   8.105 ++  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* | \
   8.106 ++  powerpcle-*-vxworks* | powerpcle-*-rtems*)
   8.107 +     targ_defvec=bfd_elf32_powerpcle_vec
   8.108 +     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
   8.109 +     targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
   8.110 +@@ -1177,7 +1177,7 @@
   8.111 +     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
   8.112 +     targ_underscore=yes
   8.113 +     ;;
   8.114 +-  sparc-*-linux-gnu*)
   8.115 ++  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
   8.116 +     targ_defvec=bfd_elf32_sparc_vec
   8.117 +     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
   8.118 +     ;;
   8.119 +@@ -1224,7 +1224,7 @@
   8.120 +     targ_defvec=sunos_big_vec
   8.121 +     targ_underscore=yes
   8.122 +     ;;
   8.123 +-  sparc64-*-linux-gnu*)
   8.124 ++  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
   8.125 +     targ_defvec=bfd_elf64_sparc_vec
   8.126 +     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
   8.127 +     ;;
   8.128 +@@ -1293,7 +1293,7 @@
   8.129 +     targ_underscore=yes
   8.130 +     ;;
   8.131 + 
   8.132 +-  vax-*-linux-gnu*)
   8.133 ++  vax-*-linux-gnu* | vax-*-linux-uclibc*)
   8.134 +     targ_defvec=bfd_elf32_vax_vec
   8.135 +     ;;
   8.136 + 
   8.137 +diff -urN gdb-6.2-dist/bfd/configure gdb-6.2/bfd/configure
   8.138 +--- gdb-6.2-dist/bfd/configure	2004-07-07 12:28:45.000000000 -0500
   8.139 ++++ gdb-6.2/bfd/configure	2004-08-08 04:27:01.000000000 -0500
   8.140 +@@ -1698,6 +1698,11 @@
   8.141 +   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   8.142 +   ;;
   8.143 + 
   8.144 ++linux-uclibc*)
   8.145 ++  lt_cv_deplibs_check_method=pass_all
   8.146 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   8.147 ++  ;;
   8.148 ++
   8.149 + netbsd*)
   8.150 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   8.151 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   8.152 +@@ -5264,7 +5269,7 @@
   8.153 +   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
   8.154 + 	COREFILE=''
   8.155 + 	;;
   8.156 +-  alpha*-*-linux-gnu*)
   8.157 ++  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
   8.158 + 	COREFILE=trad-core.lo
   8.159 + 	TRAD_HEADER='"hosts/alphalinux.h"'
   8.160 + 	;;
   8.161 +@@ -5328,7 +5333,7 @@
   8.162 + 	COREFILE=trad-core.lo
   8.163 + 	TRAD_HEADER='"hosts/i386mach3.h"'
   8.164 + 	;;
   8.165 +-  i[3-7]86-*-linux-gnu*)
   8.166 ++  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
   8.167 + 	COREFILE=trad-core.lo
   8.168 + 	TRAD_HEADER='"hosts/i386linux.h"'
   8.169 + 	;;
   8.170 +@@ -5366,7 +5371,7 @@
   8.171 + 	COREFILE=trad-core.lo
   8.172 + 	TRAD_HEADER='"hosts/hp300bsd.h"'
   8.173 + 	;;
   8.174 +-  m68*-*-linux-gnu*)
   8.175 ++  m68*-*-linux-gnu* | m68*-*-linux-uclibc)
   8.176 + 	COREFILE=trad-core.lo
   8.177 + 	TRAD_HEADER='"hosts/m68klinux.h"'
   8.178 + 	;;
   8.179 +@@ -5470,7 +5475,7 @@
   8.180 + 	COREFILE=trad-core.lo
   8.181 + 	TRAD_HEADER='"hosts/vaxult2.h"'
   8.182 + 	;;
   8.183 +-  vax-*-linux-gnu*)
   8.184 ++  vax-*-linux-gnu* | vax-*-linux-uclibc*)
   8.185 + 	COREFILE=trad-core.lo
   8.186 + 	TRAD_HEADER='"hosts/vaxlinux.h"'
   8.187 + 	;;
   8.188 +diff -urN gdb-6.2-dist/bfd/configure.in gdb-6.2/bfd/configure.in
   8.189 +--- gdb-6.2-dist/bfd/configure.in	2004-07-07 12:28:45.000000000 -0500
   8.190 ++++ gdb-6.2/bfd/configure.in	2004-08-08 04:28:07.000000000 -0500
   8.191 +@@ -164,7 +164,7 @@
   8.192 +   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
   8.193 + 	COREFILE=''
   8.194 + 	;;
   8.195 +-  alpha*-*-linux-gnu*)
   8.196 ++  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
   8.197 + 	COREFILE=trad-core.lo
   8.198 + 	TRAD_HEADER='"hosts/alphalinux.h"'
   8.199 + 	;;
   8.200 +@@ -249,7 +249,7 @@
   8.201 + 	TRAD_HEADER='"hosts/i386mach3.h"'
   8.202 + 	;;
   8.203 + changequote(,)dnl
   8.204 +-  i[3-7]86-*-linux-gnu*)
   8.205 ++  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
   8.206 + changequote([,])dnl
   8.207 + 	COREFILE=trad-core.lo
   8.208 + 	TRAD_HEADER='"hosts/i386linux.h"'
   8.209 +@@ -290,7 +290,7 @@
   8.210 + 	COREFILE=trad-core.lo
   8.211 + 	TRAD_HEADER='"hosts/hp300bsd.h"'
   8.212 + 	;;
   8.213 +-  m68*-*-linux-gnu*)
   8.214 ++  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
   8.215 + 	COREFILE=trad-core.lo
   8.216 + 	TRAD_HEADER='"hosts/m68klinux.h"'
   8.217 + 	;;
   8.218 +@@ -378,7 +378,7 @@
   8.219 + 	COREFILE=trad-core.lo
   8.220 + 	TRAD_HEADER='"hosts/vaxult2.h"'
   8.221 + 	;;
   8.222 +-  vax-*-linux-gnu*)
   8.223 ++  vax-*-linux-gnu* | vax-*-linux-uclibc*)
   8.224 + 	COREFILE=trad-core.lo
   8.225 + 	TRAD_HEADER='"hosts/vaxlinux.h"'
   8.226 + 	;;
   8.227 +diff -urN gdb-6.2-dist/libtool.m4 gdb-6.2/libtool.m4
   8.228 +--- gdb-6.2-dist/libtool.m4	2003-04-10 22:58:39.000000000 -0500
   8.229 ++++ gdb-6.2/libtool.m4	2004-08-08 03:48:33.000000000 -0500
   8.230 +@@ -645,6 +645,11 @@
   8.231 +   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   8.232 +   ;;
   8.233 + 
   8.234 ++linux-uclibc*)
   8.235 ++  lt_cv_deplibs_check_method=pass_all
   8.236 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   8.237 ++  ;;
   8.238 ++
   8.239 + netbsd*)
   8.240 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   8.241 +     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
   8.242 +diff -urN gdb-6.2-dist/ltconfig gdb-6.2/ltconfig
   8.243 +--- gdb-6.2-dist/ltconfig	2003-10-03 23:54:47.000000000 -0500
   8.244 ++++ gdb-6.2/ltconfig	2004-08-08 03:48:33.000000000 -0500
   8.245 +@@ -602,7 +602,7 @@
   8.246 + 
   8.247 + # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
   8.248 + case $host_os in
   8.249 +-linux-gnu*) ;;
   8.250 ++linux-gnu*|linux-uclibc*) ;;
   8.251 + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
   8.252 + esac
   8.253 + 
   8.254 +@@ -1259,6 +1259,24 @@
   8.255 +   dynamic_linker='GNU/Linux ld.so'
   8.256 +   ;;
   8.257 + 
   8.258 ++linux-uclibc*)
   8.259 ++  version_type=linux
   8.260 ++  need_lib_prefix=no
   8.261 ++  need_version=no
   8.262 ++  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
   8.263 ++  soname_spec='${libname}${release}.so$major'
   8.264 ++  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   8.265 ++  shlibpath_var=LD_LIBRARY_PATH
   8.266 ++  shlibpath_overrides_runpath=no
   8.267 ++  # This implies no fast_install, which is unacceptable.
   8.268 ++  # Some rework will be needed to allow for fast_install
   8.269 ++  # before this can be enabled.
   8.270 ++  # Note: copied from linux-gnu, and may not be appropriate.
   8.271 ++  hardcode_into_libs=yes
   8.272 ++  # Assume using the uClibc dynamic linker.
   8.273 ++  dynamic_linker="uClibc ld.so"
   8.274 ++  ;;
   8.275 ++
   8.276 + netbsd*)
   8.277 +   need_lib_prefix=no
   8.278 +   need_version=no
   8.279 +diff -urN gdb-6.2-dist/opcodes/configure gdb-6.2/opcodes/configure
   8.280 +--- gdb-6.2-dist/opcodes/configure	2004-07-07 12:28:53.000000000 -0500
   8.281 ++++ gdb-6.2/opcodes/configure	2004-08-08 04:53:55.000000000 -0500
   8.282 +@@ -1701,6 +1701,11 @@
   8.283 +   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
   8.284 +   ;;
   8.285 + 
   8.286 ++linux-uclibc*)
   8.287 ++  lt_cv_deplibs_check_method=pass_all
   8.288 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   8.289 ++  ;;
   8.290 ++
   8.291 + netbsd*)
   8.292 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   8.293 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/patches/gdb/6.2.1/200-uclibc-readline-conf.patch	Thu May 17 16:22:51 2007 +0000
     9.3 @@ -0,0 +1,15 @@
     9.4 +--- gdb-6.1.1-dist/readline/configure	2003-05-27 18:29:47.000000000 -0500
     9.5 ++++ gdb-6.1.1/readline/configure	2004-08-09 14:20:23.000000000 -0500
     9.6 +@@ -6249,7 +6249,12 @@
     9.7 + 
     9.8 + 
     9.9 + echo "$as_me:$LINENO: checking for mbstate_t" >&5
    9.10 ++echo $ECHO_N "bash_cv_have_mbstate_t=$bash_cv_have_mbstate_t" >&6
    9.11 + echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
    9.12 ++if test "${bash_cv_have_mbstate_t+set}" != set; then
    9.13 ++  bash_cv_have_mbstate_t=yes
    9.14 ++  echo $ECHO_N "WARNING!! forcing to yes!!! $ECHO_C" >&6
    9.15 ++fi
    9.16 + if test "${bash_cv_have_mbstate_t+set}" = set; then
    9.17 +   echo $ECHO_N "(cached) $ECHO_C" >&6
    9.18 + else
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/patches/gdb/6.2.1/400-mips-coredump.patch-2.4.23-29	Thu May 17 16:22:51 2007 +0000
    10.3 @@ -0,0 +1,28 @@
    10.4 +Sometime around 2.4.22-23, the mips pt_regs.h fields were reordered, breaking
    10.5 +coredump handling by gdb for current kernels.  Update the hardcoded constants
    10.6 +to reflect the change.
    10.7 +--- gdb-6.2.1/gdb/mips-linux-tdep.c-orig	2004-10-29 14:23:55.000000000 -0500
    10.8 ++++ gdb-6.2.1/gdb/mips-linux-tdep.c	2004-10-29 14:26:44.000000000 -0500
    10.9 +@@ -53,12 +53,22 @@
   10.10 + 
   10.11 + #define EF_REG0			6
   10.12 + #define EF_REG31		37
   10.13 ++
   10.14 ++#if 0
   10.15 + #define EF_LO			38
   10.16 + #define EF_HI			39
   10.17 + #define EF_CP0_EPC		40
   10.18 + #define EF_CP0_BADVADDR		41
   10.19 + #define EF_CP0_STATUS		42
   10.20 + #define EF_CP0_CAUSE		43
   10.21 ++#else
   10.22 ++#define EF_CP0_STATUS		38
   10.23 ++#define EF_LO			39
   10.24 ++#define EF_HI			40
   10.25 ++#define EF_CP0_BADVADDR		41
   10.26 ++#define EF_CP0_CAUSE		42
   10.27 ++#define EF_CP0_EPC		43
   10.28 ++#endif
   10.29 + 
   10.30 + #define EF_SIZE			180
   10.31 + 
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/patches/gdb/6.2.1/500-thread-timeout.patch	Thu May 17 16:22:51 2007 +0000
    11.3 @@ -0,0 +1,34 @@
    11.4 +--- gdb-6.3.org/gdb/gdbserver/thread-db.c	2004-10-17 02:42:00.000000000 +0900
    11.5 ++++ gdb-6.3/gdb/gdbserver/thread-db.c	2005-01-27 12:19:29.000000000 +0900
    11.6 +@@ -21,6 +21,7 @@
    11.7 +    Foundation, Inc., 59 Temple Place - Suite 330,
    11.8 +    Boston, MA 02111-1307, USA.  */
    11.9 + 
   11.10 ++#include <unistd.h>
   11.11 + #include "server.h"
   11.12 + 
   11.13 + #include "linux-low.h"
   11.14 +@@ -142,6 +143,7 @@
   11.15 +   td_event_msg_t msg;
   11.16 +   td_err_e err;
   11.17 +   struct inferior_linux_data *tdata;
   11.18 ++  int timeout;
   11.19 + 
   11.20 +   if (debug_threads)
   11.21 +     fprintf (stderr, "Thread creation event.\n");
   11.22 +@@ -152,7 +154,13 @@
   11.23 +      In the LinuxThreads implementation, this is safe,
   11.24 +      because all events come from the manager thread
   11.25 +      (except for its own creation, of course).  */
   11.26 +-  err = td_ta_event_getmsg (thread_agent, &msg);
   11.27 ++  for (timeout = 0; timeout < 50000; timeout++)
   11.28 ++    {
   11.29 ++      err = td_ta_event_getmsg (thread_agent, &msg);
   11.30 ++      if (err != TD_NOMSG)
   11.31 ++	break;
   11.32 ++      usleep(1000);
   11.33 ++    }
   11.34 +   if (err != TD_OK)
   11.35 +     fprintf (stderr, "thread getmsg err: %s\n",
   11.36 + 	     thread_db_err_str (err));
   11.37 +
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/patches/gdb/6.3/100-uclibc-conf.patch	Thu May 17 16:22:51 2007 +0000
    12.3 @@ -0,0 +1,280 @@
    12.4 +--- gdb-6.3/bfd/config.bfd.orig	Fri Oct 15 07:47:11 2004
    12.5 ++++ gdb-6.3/bfd/config.bfd	Mon Feb 28 00:04:43 2005
    12.6 +@@ -129,7 +129,7 @@
    12.7 +     targ_defvec=ecoffalpha_little_vec
    12.8 +     targ_selvecs=bfd_elf64_alpha_vec
    12.9 +     ;;
   12.10 +-  alpha*-*-linux-gnu* | alpha*-*-elf*)
   12.11 ++  alpha*-*-linux-* | alpha*-*-elf*)
   12.12 +     targ_defvec=bfd_elf64_alpha_vec
   12.13 +     targ_selvecs=ecoffalpha_little_vec
   12.14 +     ;;
   12.15 +@@ -139,7 +139,7 @@
   12.16 +   alpha*-*-*)
   12.17 +     targ_defvec=ecoffalpha_little_vec
   12.18 +     ;;
   12.19 +-  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
   12.20 ++  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
   12.21 +     targ_defvec=bfd_elf64_ia64_little_vec
   12.22 +     targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
   12.23 +     ;;
   12.24 +@@ -216,7 +216,7 @@
   12.25 +     targ_defvec=bfd_elf32_littlearm_vec
   12.26 +     targ_selvecs=bfd_elf32_bigarm_vec
   12.27 +     ;;
   12.28 +-  armeb-*-elf | arm*b-*-linux-gnu*)
   12.29 ++  armeb-*-elf | arm*b-*-linux-*)
   12.30 +     targ_defvec=bfd_elf32_bigarm_vec
   12.31 +     targ_selvecs=bfd_elf32_littlearm_vec
   12.32 +     ;;
   12.33 +@@ -224,7 +224,7 @@
   12.34 +     targ_defvec=bfd_elf32_littlearm_vec
   12.35 +     targ_selvecs=bfd_elf32_bigarm_vec
   12.36 +     ;;
   12.37 +-  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
   12.38 ++  arm-*-elf | arm-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \
   12.39 +   arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks | \
   12.40 +   arm*-*-eabi* )
   12.41 +     targ_defvec=bfd_elf32_littlearm_vec
   12.42 +@@ -378,7 +378,7 @@
   12.43 +     ;;
   12.44 + 
   12.45 + #ifdef BFD64
   12.46 +-  hppa*64*-*-linux-gnu*)
   12.47 ++  hppa*64*-*-linux-*)
   12.48 +     targ_defvec=bfd_elf64_hppa_linux_vec
   12.49 +     targ_selvecs=bfd_elf64_hppa_vec
   12.50 +     ;;
   12.51 +@@ -389,7 +389,7 @@
   12.52 +     ;;
   12.53 + #endif
   12.54 + 
   12.55 +-  hppa*-*-linux-gnu*)
   12.56 ++  hppa*-*-linux-*)
   12.57 +     targ_defvec=bfd_elf32_hppa_linux_vec
   12.58 +     targ_selvecs=bfd_elf32_hppa_vec
   12.59 +     ;;
   12.60 +@@ -522,7 +522,7 @@
   12.61 +     targ_selvecs=bfd_elf32_i386_vec
   12.62 +     targ_underscore=yes
   12.63 +     ;;
   12.64 +-  i[3-7]86-*-linux-gnu*)
   12.65 ++  i[3-7]86-*-linux-*)
   12.66 +     targ_defvec=bfd_elf32_i386_vec
   12.67 +     targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
   12.68 +     targ64_selvecs=bfd_elf64_x86_64_vec
   12.69 +@@ -536,7 +536,7 @@
   12.70 +     targ_defvec=bfd_elf64_x86_64_vec
   12.71 +     targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
   12.72 +     ;;
   12.73 +-  x86_64-*-linux-gnu*)
   12.74 ++  x86_64-*-linux-*)
   12.75 +     targ_defvec=bfd_elf64_x86_64_vec
   12.76 +     targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
   12.77 +     ;;
   12.78 +@@ -706,7 +706,7 @@
   12.79 +     targ_defvec=hp300hpux_vec
   12.80 +     targ_underscore=yes
   12.81 +     ;;
   12.82 +-  m68*-*-linux*aout*)
   12.83 ++  m68*-*-linux*aout* | m68*-*-linux-uclibc*)
   12.84 +     targ_defvec=m68klinux_vec
   12.85 +     targ_selvecs=bfd_elf32_m68k_vec
   12.86 +     targ_underscore=yes
   12.87 +@@ -987,7 +987,7 @@
   12.88 +     ;;
   12.89 + #endif
   12.90 +   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
   12.91 +-  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
   12.92 ++  powerpc-*-solaris2* | powerpc-*-linux-* | powerpc-*-rtems* | \
   12.93 +   powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
   12.94 +     targ_defvec=bfd_elf32_powerpc_vec
   12.95 +     targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
   12.96 +@@ -1024,7 +1024,7 @@
   12.97 +     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
   12.98 +     ;;
   12.99 +   powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
  12.100 +-  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
  12.101 ++  powerpcle-*-solaris2* | powerpcle-*-linux-* | powerpcle-*-vxworks* |\
  12.102 +   powerpcle-*-rtems*)
  12.103 +     targ_defvec=bfd_elf32_powerpcle_vec
  12.104 +     targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
  12.105 +@@ -1192,7 +1192,7 @@
  12.106 +     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
  12.107 +     targ_underscore=yes
  12.108 +     ;;
  12.109 +-  sparc-*-linux-gnu*)
  12.110 ++  sparc-*-linux-*)
  12.111 +     targ_defvec=bfd_elf32_sparc_vec
  12.112 +     targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
  12.113 +     ;;
  12.114 +@@ -1239,7 +1239,7 @@
  12.115 +     targ_defvec=sunos_big_vec
  12.116 +     targ_underscore=yes
  12.117 +     ;;
  12.118 +-  sparc64-*-linux-gnu*)
  12.119 ++  sparc64-*-linux-*)
  12.120 +     targ_defvec=bfd_elf64_sparc_vec
  12.121 +     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
  12.122 +     ;;
  12.123 +@@ -1308,7 +1308,7 @@
  12.124 +     targ_underscore=yes
  12.125 +     ;;
  12.126 + 
  12.127 +-  vax-*-linux-gnu*)
  12.128 ++  vax-*-linux-*)
  12.129 +     targ_defvec=bfd_elf32_vax_vec
  12.130 +     ;;
  12.131 + 
  12.132 +--- gdb-6.3/bfd/configure.orig	Fri Oct  8 16:53:56 2004
  12.133 ++++ gdb-6.3/bfd/configure	Sun Feb 27 18:32:58 2005
  12.134 +@@ -3583,6 +3583,11 @@
  12.135 +   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
  12.136 +   ;;
  12.137 + 
  12.138 ++linux-uclibc*)
  12.139 ++  lt_cv_deplibs_check_method=pass_all
  12.140 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
  12.141 ++  ;;
  12.142 ++
  12.143 + netbsd* | knetbsd*-gnu)
  12.144 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  12.145 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
  12.146 +@@ -9914,7 +9919,7 @@
  12.147 +   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
  12.148 + 	COREFILE=''
  12.149 + 	;;
  12.150 +-  alpha*-*-linux-gnu*)
  12.151 ++  alpha*-*-linux-*)
  12.152 + 	COREFILE=trad-core.lo
  12.153 + 	TRAD_HEADER='"hosts/alphalinux.h"'
  12.154 + 	;;
  12.155 +@@ -9978,7 +9983,7 @@
  12.156 + 	COREFILE=trad-core.lo
  12.157 + 	TRAD_HEADER='"hosts/i386mach3.h"'
  12.158 + 	;;
  12.159 +-  i[3-7]86-*-linux-gnu*)
  12.160 ++  i[3-7]86-*-linux-*)
  12.161 + 	COREFILE=trad-core.lo
  12.162 + 	TRAD_HEADER='"hosts/i386linux.h"'
  12.163 + 	;;
  12.164 +@@ -10016,7 +10021,7 @@
  12.165 + 	COREFILE=trad-core.lo
  12.166 + 	TRAD_HEADER='"hosts/hp300bsd.h"'
  12.167 + 	;;
  12.168 +-  m68*-*-linux-gnu*)
  12.169 ++  m68*-*-linux-*)
  12.170 + 	COREFILE=trad-core.lo
  12.171 + 	TRAD_HEADER='"hosts/m68klinux.h"'
  12.172 + 	;;
  12.173 +@@ -10150,7 +10155,7 @@
  12.174 + 	COREFILE=trad-core.lo
  12.175 + 	TRAD_HEADER='"hosts/vaxult2.h"'
  12.176 + 	;;
  12.177 +-  vax-*-linux-gnu*)
  12.178 ++  vax-*-linux-*)
  12.179 + 	COREFILE=trad-core.lo
  12.180 + 	TRAD_HEADER='"hosts/vaxlinux.h"'
  12.181 + 	;;
  12.182 +--- gdb-6.3/bfd/configure.in.orig	Fri Oct  8 16:53:59 2004
  12.183 ++++ gdb-6.3/bfd/configure.in	Sun Feb 27 18:14:41 2005
  12.184 +@@ -163,7 +163,7 @@
  12.185 +   alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
  12.186 + 	COREFILE=''
  12.187 + 	;;
  12.188 +-  alpha*-*-linux-gnu*)
  12.189 ++  alpha*-*-linux-*)
  12.190 + 	COREFILE=trad-core.lo
  12.191 + 	TRAD_HEADER='"hosts/alphalinux.h"'
  12.192 + 	;;
  12.193 +@@ -248,7 +248,7 @@
  12.194 + 	TRAD_HEADER='"hosts/i386mach3.h"'
  12.195 + 	;;
  12.196 + changequote(,)dnl
  12.197 +-  i[3-7]86-*-linux-gnu*)
  12.198 ++  i[3-7]86-*-linux-*)
  12.199 + changequote([,])dnl
  12.200 + 	COREFILE=trad-core.lo
  12.201 + 	TRAD_HEADER='"hosts/i386linux.h"'
  12.202 +@@ -289,7 +289,7 @@
  12.203 + 	COREFILE=trad-core.lo
  12.204 + 	TRAD_HEADER='"hosts/hp300bsd.h"'
  12.205 + 	;;
  12.206 +-  m68*-*-linux-gnu*)
  12.207 ++  m68*-*-linux-*)
  12.208 + 	COREFILE=trad-core.lo
  12.209 + 	TRAD_HEADER='"hosts/m68klinux.h"'
  12.210 + 	;;
  12.211 +@@ -375,7 +375,7 @@
  12.212 + 	COREFILE=trad-core.lo
  12.213 + 	TRAD_HEADER='"hosts/vaxult2.h"'
  12.214 + 	;;
  12.215 +-  vax-*-linux-gnu*)
  12.216 ++  vax-*-linux-*)
  12.217 + 	COREFILE=trad-core.lo
  12.218 + 	TRAD_HEADER='"hosts/vaxlinux.h"'
  12.219 + 	;;
  12.220 +--- gdb-6.3/libtool.m4.orig	Wed Jul 21 21:21:41 2004
  12.221 ++++ gdb-6.3/libtool.m4	Mon Feb 28 00:08:11 2005
  12.222 +@@ -653,6 +653,11 @@
  12.223 +   fi
  12.224 +   ;;
  12.225 + 
  12.226 ++linux-uclibc*)
  12.227 ++  lt_cv_deplibs_check_method=pass_all
  12.228 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
  12.229 ++  ;;
  12.230 ++
  12.231 + newsos6)
  12.232 +   [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
  12.233 +   lt_cv_file_magic_cmd=/usr/bin/file
  12.234 +--- gdb-6.3/ltconfig.orig	Tue Oct  5 15:34:42 2004
  12.235 ++++ gdb-6.3/ltconfig	Sun Feb 27 18:14:41 2005
  12.236 +@@ -602,7 +602,7 @@
  12.237 + 
  12.238 + # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
  12.239 + case $host_os in
  12.240 +-linux-gnu*) ;;
  12.241 ++linux-gnu*|linux-uclibc*) ;;
  12.242 + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
  12.243 + esac
  12.244 + 
  12.245 +@@ -1270,6 +1270,24 @@
  12.246 +   dynamic_linker='GNU/Linux ld.so'
  12.247 +   ;;
  12.248 + 
  12.249 ++linux-uclibc*)
  12.250 ++  version_type=linux
  12.251 ++  need_lib_prefix=no
  12.252 ++  need_version=no
  12.253 ++  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  12.254 ++  soname_spec='${libname}${release}.so$major'
  12.255 ++  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
  12.256 ++  shlibpath_var=LD_LIBRARY_PATH
  12.257 ++  shlibpath_overrides_runpath=no
  12.258 ++  # This implies no fast_install, which is unacceptable.
  12.259 ++  # Some rework will be needed to allow for fast_install
  12.260 ++  # before this can be enabled.
  12.261 ++  # Note: copied from linux-gnu, and may not be appropriate.
  12.262 ++  hardcode_into_libs=yes
  12.263 ++  # Assume using the uClibc dynamic linker.
  12.264 ++  dynamic_linker="uClibc ld.so"
  12.265 ++  ;;
  12.266 ++
  12.267 + netbsd*)
  12.268 +   need_lib_prefix=no
  12.269 +   need_version=no
  12.270 +--- gdb-6.3/opcodes/configure.orig	Fri Sep 17 08:13:38 2004
  12.271 ++++ gdb-6.3/opcodes/configure	Mon Feb 28 00:09:42 2005
  12.272 +@@ -3595,6 +3595,11 @@
  12.273 +   fi
  12.274 +   ;;
  12.275 + 
  12.276 ++linux-uclibc*)
  12.277 ++  lt_cv_deplibs_check_method=pass_all
  12.278 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
  12.279 ++  ;;
  12.280 ++
  12.281 + newsos6)
  12.282 +   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
  12.283 +   lt_cv_file_magic_cmd=/usr/bin/file
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/patches/gdb/6.3/200-uclibc-readline-conf.patch	Thu May 17 16:22:51 2007 +0000
    13.3 @@ -0,0 +1,15 @@
    13.4 +--- gdb-6.1.1-dist/readline/configure	2003-05-27 18:29:47.000000000 -0500
    13.5 ++++ gdb-6.1.1/readline/configure	2004-08-09 14:20:23.000000000 -0500
    13.6 +@@ -6249,7 +6249,12 @@
    13.7 + 
    13.8 + 
    13.9 + echo "$as_me:$LINENO: checking for mbstate_t" >&5
   13.10 ++echo $ECHO_N "bash_cv_have_mbstate_t=$bash_cv_have_mbstate_t" >&6
   13.11 + echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
   13.12 ++if test "${bash_cv_have_mbstate_t+set}" != set; then
   13.13 ++  bash_cv_have_mbstate_t=yes
   13.14 ++  echo $ECHO_N "WARNING!! forcing to yes!!! $ECHO_C" >&6
   13.15 ++fi
   13.16 + if test "${bash_cv_have_mbstate_t+set}" = set; then
   13.17 +   echo $ECHO_N "(cached) $ECHO_C" >&6
   13.18 + else
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/patches/gdb/6.3/400-mips-coredump.patch-2.4.23-29	Thu May 17 16:22:51 2007 +0000
    14.3 @@ -0,0 +1,28 @@
    14.4 +Sometime around 2.4.22-23, the mips pt_regs.h fields were reordered, breaking
    14.5 +coredump handling by gdb for current kernels.  Update the hardcoded constants
    14.6 +to reflect the change.
    14.7 +--- gdb-6.2.1/gdb/mips-linux-tdep.c-orig	2004-10-29 14:23:55.000000000 -0500
    14.8 ++++ gdb-6.2.1/gdb/mips-linux-tdep.c	2004-10-29 14:26:44.000000000 -0500
    14.9 +@@ -53,12 +53,22 @@
   14.10 + 
   14.11 + #define EF_REG0			6
   14.12 + #define EF_REG31		37
   14.13 ++
   14.14 ++#if 0
   14.15 + #define EF_LO			38
   14.16 + #define EF_HI			39
   14.17 + #define EF_CP0_EPC		40
   14.18 + #define EF_CP0_BADVADDR		41
   14.19 + #define EF_CP0_STATUS		42
   14.20 + #define EF_CP0_CAUSE		43
   14.21 ++#else
   14.22 ++#define EF_CP0_STATUS		38
   14.23 ++#define EF_LO			39
   14.24 ++#define EF_HI			40
   14.25 ++#define EF_CP0_BADVADDR		41
   14.26 ++#define EF_CP0_CAUSE		42
   14.27 ++#define EF_CP0_EPC		43
   14.28 ++#endif
   14.29 + 
   14.30 + #define EF_SIZE			180
   14.31 + 
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/patches/gdb/6.3/500-thread-timeout.patch	Thu May 17 16:22:51 2007 +0000
    15.3 @@ -0,0 +1,34 @@
    15.4 +--- gdb-6.3.org/gdb/gdbserver/thread-db.c	2004-10-17 02:42:00.000000000 +0900
    15.5 ++++ gdb-6.3/gdb/gdbserver/thread-db.c	2005-01-27 12:19:29.000000000 +0900
    15.6 +@@ -21,6 +21,7 @@
    15.7 +    Foundation, Inc., 59 Temple Place - Suite 330,
    15.8 +    Boston, MA 02111-1307, USA.  */
    15.9 + 
   15.10 ++#include <unistd.h>
   15.11 + #include "server.h"
   15.12 + 
   15.13 + #include "linux-low.h"
   15.14 +@@ -142,6 +143,7 @@
   15.15 +   td_event_msg_t msg;
   15.16 +   td_err_e err;
   15.17 +   struct inferior_linux_data *tdata;
   15.18 ++  int timeout;
   15.19 + 
   15.20 +   if (debug_threads)
   15.21 +     fprintf (stderr, "Thread creation event.\n");
   15.22 +@@ -152,7 +154,13 @@
   15.23 +      In the LinuxThreads implementation, this is safe,
   15.24 +      because all events come from the manager thread
   15.25 +      (except for its own creation, of course).  */
   15.26 +-  err = td_ta_event_getmsg (thread_agent, &msg);
   15.27 ++  for (timeout = 0; timeout < 50000; timeout++)
   15.28 ++    {
   15.29 ++      err = td_ta_event_getmsg (thread_agent, &msg);
   15.30 ++      if (err != TD_NOMSG)
   15.31 ++	break;
   15.32 ++      usleep(1000);
   15.33 ++    }
   15.34 +   if (err != TD_OK)
   15.35 +     fprintf (stderr, "thread getmsg err: %s\n",
   15.36 + 	     thread_db_err_str (err));
   15.37 +
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/patches/gdb/6.3/600-debian_10.selected-frame.patch	Thu May 17 16:22:51 2007 +0000
    16.3 @@ -0,0 +1,552 @@
    16.4 +2004-10-11
    16.5 +
    16.6 +This patch is not submitted.  Many of these functions should be passing
    16.7 +a frame around rather than calling get_selected_frame, but at least it
    16.8 +is an improvement over deprecated_selected_frame.
    16.9 +
   16.10 +Index: gdb-6.3/gdb/breakpoint.c
   16.11 +===================================================================
   16.12 +--- gdb-6.3.orig/gdb/breakpoint.c	2004-10-08 13:30:46.000000000 -0400
   16.13 ++++ gdb-6.3/gdb/breakpoint.c	2004-11-09 22:55:11.231620957 -0500
   16.14 +@@ -922,7 +922,7 @@ insert_bp_location (struct bp_location *
   16.15 +       /* FIXME drow/2003-09-09: It would be nice if evaluate_expression
   16.16 + 	 took a frame parameter, so that we didn't have to change the
   16.17 + 	 selected frame.  */
   16.18 +-      saved_frame_id = get_frame_id (deprecated_selected_frame);
   16.19 ++      saved_frame_id = get_frame_id (get_selected_frame ());
   16.20 + 
   16.21 +       /* Determine if the watchpoint is within scope.  */
   16.22 +       if (bpt->owner->exp_valid_block == NULL)
   16.23 +@@ -5464,14 +5464,9 @@ break_at_finish_at_depth_command_1 (char
   16.24 + 
   16.25 +       if (default_breakpoint_valid)
   16.26 + 	{
   16.27 +-	  if (deprecated_selected_frame)
   16.28 +-	    {
   16.29 +-	      selected_pc = get_frame_pc (deprecated_selected_frame);
   16.30 +-	      if (arg)
   16.31 +-		if_arg = 1;
   16.32 +-	    }
   16.33 +-	  else
   16.34 +-	    error ("No selected frame.");
   16.35 ++	  selected_pc = get_frame_pc (get_selected_frame ());
   16.36 ++	  if (arg)
   16.37 ++	    if_arg = 1;
   16.38 + 	}
   16.39 +       else
   16.40 + 	error ("No default breakpoint address now.");
   16.41 +@@ -5542,15 +5537,10 @@ break_at_finish_command_1 (char *arg, in
   16.42 +     {
   16.43 +       if (default_breakpoint_valid)
   16.44 + 	{
   16.45 +-	  if (deprecated_selected_frame)
   16.46 +-	    {
   16.47 +-	      addr_string = xstrprintf ("*0x%s",
   16.48 +-					paddr_nz (get_frame_pc (deprecated_selected_frame)));
   16.49 +-	      if (arg)
   16.50 +-		if_arg = 1;
   16.51 +-	    }
   16.52 +-	  else
   16.53 +-	    error ("No selected frame.");
   16.54 ++	  addr_string = xstrprintf ("*0x%s",
   16.55 ++				    paddr_nz (get_frame_pc (get_selected_frame ())));
   16.56 ++	  if (arg)
   16.57 ++	    if_arg = 1;
   16.58 + 	}
   16.59 +       else
   16.60 + 	error ("No default breakpoint address now.");
   16.61 +@@ -6082,7 +6072,7 @@ until_break_command (char *arg, int from
   16.62 + {
   16.63 +   struct symtabs_and_lines sals;
   16.64 +   struct symtab_and_line sal;
   16.65 +-  struct frame_info *prev_frame = get_prev_frame (deprecated_selected_frame);
   16.66 ++  struct frame_info *prev_frame = get_prev_frame (get_selected_frame ());
   16.67 +   struct breakpoint *breakpoint;
   16.68 +   struct cleanup *old_chain;
   16.69 +   struct continuation_arg *arg1;
   16.70 +@@ -6119,7 +6109,7 @@ until_break_command (char *arg, int from
   16.71 +     /* Otherwise, specify the current frame, because we want to stop only
   16.72 +        at the very same frame.  */
   16.73 +     breakpoint = set_momentary_breakpoint (sal,
   16.74 +-					   get_frame_id (deprecated_selected_frame),
   16.75 ++					   get_frame_id (get_selected_frame ()),
   16.76 + 					   bp_until);
   16.77 + 
   16.78 +   if (!target_can_async_p ())
   16.79 +Index: gdb-6.3/gdb/cli/cli-cmds.c
   16.80 +===================================================================
   16.81 +--- gdb-6.3.orig/gdb/cli/cli-cmds.c	2004-09-11 06:24:53.000000000 -0400
   16.82 ++++ gdb-6.3/gdb/cli/cli-cmds.c	2004-11-09 22:51:07.323246218 -0500
   16.83 +@@ -845,10 +845,7 @@ disassemble_command (char *arg, int from
   16.84 +   name = NULL;
   16.85 +   if (!arg)
   16.86 +     {
   16.87 +-      if (!deprecated_selected_frame)
   16.88 +-	error ("No frame selected.\n");
   16.89 +-
   16.90 +-      pc = get_frame_pc (deprecated_selected_frame);
   16.91 ++      pc = get_frame_pc (get_selected_frame ());
   16.92 +       if (find_pc_partial_function (pc, &name, &low, &high) == 0)
   16.93 + 	error ("No function contains program counter for selected frame.\n");
   16.94 + #if defined(TUI)
   16.95 +Index: gdb-6.3/gdb/f-valprint.c
   16.96 +===================================================================
   16.97 +--- gdb-6.3.orig/gdb/f-valprint.c	2003-10-14 02:51:14.000000000 -0400
   16.98 ++++ gdb-6.3/gdb/f-valprint.c	2004-11-09 22:51:07.326245632 -0500
   16.99 +@@ -76,7 +76,7 @@ f77_get_dynamic_lowerbound (struct type 
  16.100 +   switch (TYPE_ARRAY_LOWER_BOUND_TYPE (type))
  16.101 +     {
  16.102 +     case BOUND_BY_VALUE_ON_STACK:
  16.103 +-      current_frame_addr = get_frame_base (deprecated_selected_frame);
  16.104 ++      current_frame_addr = get_frame_base (get_selected_frame ());
  16.105 +       if (current_frame_addr > 0)
  16.106 + 	{
  16.107 + 	  *lower_bound =
  16.108 +@@ -100,7 +100,7 @@ f77_get_dynamic_lowerbound (struct type 
  16.109 +       break;
  16.110 + 
  16.111 +     case BOUND_BY_REF_ON_STACK:
  16.112 +-      current_frame_addr = get_frame_base (deprecated_selected_frame);
  16.113 ++      current_frame_addr = get_frame_base (get_selected_frame ());
  16.114 +       if (current_frame_addr > 0)
  16.115 + 	{
  16.116 + 	  ptr_to_lower_bound =
  16.117 +@@ -134,7 +134,7 @@ f77_get_dynamic_upperbound (struct type 
  16.118 +   switch (TYPE_ARRAY_UPPER_BOUND_TYPE (type))
  16.119 +     {
  16.120 +     case BOUND_BY_VALUE_ON_STACK:
  16.121 +-      current_frame_addr = get_frame_base (deprecated_selected_frame);
  16.122 ++      current_frame_addr = get_frame_base (get_selected_frame ());
  16.123 +       if (current_frame_addr > 0)
  16.124 + 	{
  16.125 + 	  *upper_bound =
  16.126 +@@ -163,7 +163,7 @@ f77_get_dynamic_upperbound (struct type 
  16.127 +       break;
  16.128 + 
  16.129 +     case BOUND_BY_REF_ON_STACK:
  16.130 +-      current_frame_addr = get_frame_base (deprecated_selected_frame);
  16.131 ++      current_frame_addr = get_frame_base (get_selected_frame ());
  16.132 +       if (current_frame_addr > 0)
  16.133 + 	{
  16.134 + 	  ptr_to_upper_bound =
  16.135 +@@ -630,10 +630,7 @@ info_common_command (char *comname, int 
  16.136 +      first make sure that it is visible and if so, let 
  16.137 +      us display its contents */
  16.138 + 
  16.139 +-  fi = deprecated_selected_frame;
  16.140 +-
  16.141 +-  if (fi == NULL)
  16.142 +-    error ("No frame selected");
  16.143 ++  fi = get_selected_frame ();
  16.144 + 
  16.145 +   /* The following is generally ripped off from stack.c's routine 
  16.146 +      print_frame_info() */
  16.147 +@@ -722,10 +719,7 @@ there_is_a_visible_common_named (char *c
  16.148 +   if (comname == NULL)
  16.149 +     error ("Cannot deal with NULL common name!");
  16.150 + 
  16.151 +-  fi = deprecated_selected_frame;
  16.152 +-
  16.153 +-  if (fi == NULL)
  16.154 +-    error ("No frame selected");
  16.155 ++  fi = get_selected_frame ();
  16.156 + 
  16.157 +   /* The following is generally ripped off from stack.c's routine 
  16.158 +      print_frame_info() */
  16.159 +Index: gdb-6.3/gdb/infcmd.c
  16.160 +===================================================================
  16.161 +--- gdb-6.3.orig/gdb/infcmd.c	2004-09-13 14:26:28.000000000 -0400
  16.162 ++++ gdb-6.3/gdb/infcmd.c	2004-11-09 22:57:37.274099559 -0500
  16.163 +@@ -1214,10 +1214,8 @@ finish_command (char *arg, int from_tty)
  16.164 +     error ("The \"finish\" command does not take any arguments.");
  16.165 +   if (!target_has_execution)
  16.166 +     error ("The program is not running.");
  16.167 +-  if (deprecated_selected_frame == NULL)
  16.168 +-    error ("No selected frame.");
  16.169 + 
  16.170 +-  frame = get_prev_frame (deprecated_selected_frame);
  16.171 ++  frame = get_prev_frame (get_selected_frame ());
  16.172 +   if (frame == 0)
  16.173 +     error ("\"finish\" not meaningful in the outermost frame.");
  16.174 + 
  16.175 +@@ -1235,7 +1233,7 @@ finish_command (char *arg, int from_tty)
  16.176 + 
  16.177 +   /* Find the function we will return from.  */
  16.178 + 
  16.179 +-  function = find_pc_function (get_frame_pc (deprecated_selected_frame));
  16.180 ++  function = find_pc_function (get_frame_pc (get_selected_frame ()));
  16.181 + 
  16.182 +   /* Print info on the selected frame, including level number but not
  16.183 +      source.  */
  16.184 +@@ -1600,13 +1598,11 @@ registers_info (char *addr_exp, int fpre
  16.185 + 
  16.186 +   if (!target_has_registers)
  16.187 +     error ("The program has no registers now.");
  16.188 +-  if (deprecated_selected_frame == NULL)
  16.189 +-    error ("No selected frame.");
  16.190 + 
  16.191 +   if (!addr_exp)
  16.192 +     {
  16.193 +       gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
  16.194 +-				    deprecated_selected_frame, -1, fpregs);
  16.195 ++				    get_selected_frame (), -1, fpregs);
  16.196 +       return;
  16.197 +     }
  16.198 + 
  16.199 +@@ -1644,7 +1640,7 @@ registers_info (char *addr_exp, int fpre
  16.200 + 	if (regnum >= 0)
  16.201 + 	  {
  16.202 + 	    gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
  16.203 +-					  deprecated_selected_frame, regnum, fpregs);
  16.204 ++					  get_selected_frame (), regnum, fpregs);
  16.205 + 	    continue;
  16.206 + 	  }
  16.207 +       }
  16.208 +@@ -1658,7 +1654,7 @@ registers_info (char *addr_exp, int fpre
  16.209 + 	    && regnum < NUM_REGS + NUM_PSEUDO_REGS)
  16.210 + 	  {
  16.211 + 	    gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
  16.212 +-					  deprecated_selected_frame, regnum, fpregs);
  16.213 ++					  get_selected_frame (), regnum, fpregs);
  16.214 + 	    continue;
  16.215 + 	  }
  16.216 +       }
  16.217 +@@ -1684,7 +1680,7 @@ registers_info (char *addr_exp, int fpre
  16.218 + 		if (gdbarch_register_reggroup_p (current_gdbarch, regnum,
  16.219 + 						 group))
  16.220 + 		  gdbarch_print_registers_info (current_gdbarch,
  16.221 +-						gdb_stdout, deprecated_selected_frame,
  16.222 ++						gdb_stdout, get_selected_frame (),
  16.223 + 						regnum, fpregs);
  16.224 + 	      }
  16.225 + 	    continue;
  16.226 +@@ -1714,8 +1710,6 @@ print_vector_info (struct gdbarch *gdbar
  16.227 + {
  16.228 +   if (!target_has_registers)
  16.229 +     error ("The program has no registers now.");
  16.230 +-  if (deprecated_selected_frame == NULL)
  16.231 +-    error ("No selected frame.");
  16.232 + 
  16.233 +   if (gdbarch_print_vector_info_p (gdbarch))
  16.234 +     gdbarch_print_vector_info (gdbarch, file, frame, args);
  16.235 +@@ -1740,7 +1734,7 @@ print_vector_info (struct gdbarch *gdbar
  16.236 + static void
  16.237 + vector_info (char *args, int from_tty)
  16.238 + {
  16.239 +-  print_vector_info (current_gdbarch, gdb_stdout, deprecated_selected_frame, args);
  16.240 ++  print_vector_info (current_gdbarch, gdb_stdout, get_selected_frame (), args);
  16.241 + }
  16.242 + 
  16.243 + 
  16.244 +@@ -1910,8 +1904,6 @@ print_float_info (struct gdbarch *gdbarc
  16.245 + {
  16.246 +   if (!target_has_registers)
  16.247 +     error ("The program has no registers now.");
  16.248 +-  if (deprecated_selected_frame == NULL)
  16.249 +-    error ("No selected frame.");
  16.250 + 
  16.251 +   if (gdbarch_print_float_info_p (gdbarch))
  16.252 +     gdbarch_print_float_info (gdbarch, file, frame, args);
  16.253 +@@ -1937,7 +1929,7 @@ No floating-point info available for thi
  16.254 + static void
  16.255 + float_info (char *args, int from_tty)
  16.256 + {
  16.257 +-  print_float_info (current_gdbarch, gdb_stdout, deprecated_selected_frame, args);
  16.258 ++  print_float_info (current_gdbarch, gdb_stdout, get_selected_frame (), args);
  16.259 + }
  16.260 + 
  16.261 + static void
  16.262 +Index: gdb-6.3/gdb/inflow.c
  16.263 +===================================================================
  16.264 +--- gdb-6.3.orig/gdb/inflow.c	2004-08-11 05:00:57.000000000 -0400
  16.265 ++++ gdb-6.3/gdb/inflow.c	2004-11-09 22:58:37.488338883 -0500
  16.266 +@@ -591,10 +591,7 @@ kill_command (char *arg, int from_tty)
  16.267 +   if (target_has_stack)
  16.268 +     {
  16.269 +       printf_filtered ("In %s,\n", target_longname);
  16.270 +-      if (deprecated_selected_frame == NULL)
  16.271 +-	fputs_filtered ("No selected stack frame.\n", gdb_stdout);
  16.272 +-      else
  16.273 +-	print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC);
  16.274 ++      print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC);
  16.275 +     }
  16.276 +   bfd_cache_close_all ();
  16.277 + }
  16.278 +Index: gdb-6.3/gdb/infrun.c
  16.279 +===================================================================
  16.280 +--- gdb-6.3.orig/gdb/infrun.c	2004-09-27 13:58:08.000000000 -0400
  16.281 ++++ gdb-6.3/gdb/infrun.c	2004-11-09 22:51:07.351240752 -0500
  16.282 +@@ -3485,7 +3485,7 @@ save_inferior_status (int restore_stack_
  16.283 + 
  16.284 +   inf_status->registers = regcache_dup (current_regcache);
  16.285 + 
  16.286 +-  inf_status->selected_frame_id = get_frame_id (deprecated_selected_frame);
  16.287 ++  inf_status->selected_frame_id = get_frame_id (get_selected_frame ());
  16.288 +   return inf_status;
  16.289 + }
  16.290 + 
  16.291 +Index: gdb-6.3/gdb/mi/mi-main.c
  16.292 +===================================================================
  16.293 +--- gdb-6.3.orig/gdb/mi/mi-main.c	2004-09-12 11:00:42.000000000 -0400
  16.294 ++++ gdb-6.3/gdb/mi/mi-main.c	2004-11-09 22:53:29.998389013 -0500
  16.295 +@@ -388,7 +388,7 @@ register_changed_p (int regnum)
  16.296 + {
  16.297 +   char raw_buffer[MAX_REGISTER_SIZE];
  16.298 + 
  16.299 +-  if (! frame_register_read (deprecated_selected_frame, regnum, raw_buffer))
  16.300 ++  if (! frame_register_read (get_selected_frame (), regnum, raw_buffer))
  16.301 +     return -1;
  16.302 + 
  16.303 +   if (memcmp (&old_regs[DEPRECATED_REGISTER_BYTE (regnum)], raw_buffer,
  16.304 +@@ -509,7 +509,7 @@ get_register (int regnum, int format)
  16.305 +   if (format == 'N')
  16.306 +     format = 0;
  16.307 + 
  16.308 +-  frame_register (deprecated_selected_frame, regnum, &optim, &lval, &addr,
  16.309 ++  frame_register (get_selected_frame (), regnum, &optim, &lval, &addr,
  16.310 + 		  &realnum, buffer);
  16.311 + 
  16.312 +   if (optim)
  16.313 +Index: gdb-6.3/gdb/mn10300-tdep.c
  16.314 +===================================================================
  16.315 +--- gdb-6.3.orig/gdb/mn10300-tdep.c	2004-08-02 22:02:22.000000000 -0400
  16.316 ++++ gdb-6.3/gdb/mn10300-tdep.c	2004-11-09 22:51:07.356239776 -0500
  16.317 +@@ -1154,7 +1154,7 @@ mn10300_print_register (const char *name
  16.318 +     printf_filtered ("%s: ", name);
  16.319 + 
  16.320 +   /* Get the data */
  16.321 +-  if (!frame_register_read (deprecated_selected_frame, regnum, raw_buffer))
  16.322 ++  if (!frame_register_read (get_selected_frame (), regnum, raw_buffer))
  16.323 +     {
  16.324 +       printf_filtered ("[invalid]");
  16.325 +       return;
  16.326 +Index: gdb-6.3/gdb/stack.c
  16.327 +===================================================================
  16.328 +--- gdb-6.3.orig/gdb/stack.c	2004-08-02 20:57:26.000000000 -0400
  16.329 ++++ gdb-6.3/gdb/stack.c	2004-11-09 22:51:07.361238800 -0500
  16.330 +@@ -758,9 +758,7 @@ parse_frame_specification (char *frame_e
  16.331 +   switch (numargs)
  16.332 +     {
  16.333 +     case 0:
  16.334 +-      if (deprecated_selected_frame == NULL)
  16.335 +-	error ("No selected frame.");
  16.336 +-      return deprecated_selected_frame;
  16.337 ++      return get_selected_frame ();
  16.338 +       /* NOTREACHED */
  16.339 +     case 1:
  16.340 +       {
  16.341 +@@ -902,10 +900,10 @@ frame_info (char *addr_exp, int from_tty
  16.342 +     }
  16.343 +   calling_frame_info = get_prev_frame (fi);
  16.344 + 
  16.345 +-  if (!addr_exp && frame_relative_level (deprecated_selected_frame) >= 0)
  16.346 ++  if (!addr_exp && frame_relative_level (get_selected_frame ()) >= 0)
  16.347 +     {
  16.348 +       printf_filtered ("Stack level %d, frame at ",
  16.349 +-		       frame_relative_level (deprecated_selected_frame));
  16.350 ++		       frame_relative_level (get_selected_frame ()));
  16.351 +       print_address_numeric (get_frame_base (fi), 1, gdb_stdout);
  16.352 +       printf_filtered (":\n");
  16.353 +     }
  16.354 +@@ -1445,9 +1443,7 @@ print_frame_label_vars (struct frame_inf
  16.355 + void
  16.356 + locals_info (char *args, int from_tty)
  16.357 + {
  16.358 +-  if (!deprecated_selected_frame)
  16.359 +-    error ("No frame selected.");
  16.360 +-  print_frame_local_vars (deprecated_selected_frame, 0, gdb_stdout);
  16.361 ++  print_frame_local_vars (get_selected_frame (), 0, gdb_stdout);
  16.362 + }
  16.363 + 
  16.364 + static void
  16.365 +@@ -1470,7 +1466,7 @@ catch_info (char *ignore, int from_tty)
  16.366 +       if (!deprecated_selected_frame)
  16.367 + 	error ("No frame selected.");
  16.368 + 
  16.369 +-      print_frame_label_vars (deprecated_selected_frame, 0, gdb_stdout);
  16.370 ++      print_frame_label_vars (get_selected_frame (), 0, gdb_stdout);
  16.371 +     }
  16.372 + }
  16.373 + 
  16.374 +@@ -1537,9 +1533,7 @@ print_frame_arg_vars (struct frame_info 
  16.375 + void
  16.376 + args_info (char *ignore, int from_tty)
  16.377 + {
  16.378 +-  if (!deprecated_selected_frame)
  16.379 +-    error ("No frame selected.");
  16.380 +-  print_frame_arg_vars (deprecated_selected_frame, gdb_stdout);
  16.381 ++  print_frame_arg_vars (get_selected_frame (), gdb_stdout);
  16.382 + }
  16.383 + 
  16.384 + 
  16.385 +@@ -1724,7 +1718,7 @@ down_silently_base (char *count_exp)
  16.386 +   if (target_has_stack == 0 || deprecated_selected_frame == 0)
  16.387 +     error ("No stack.");
  16.388 + 
  16.389 +-  frame = find_relative_frame (deprecated_selected_frame, &count1);
  16.390 ++  frame = find_relative_frame (get_selected_frame (), &count1);
  16.391 +   if (count1 != 0 && count_exp == 0)
  16.392 +     {
  16.393 + 
  16.394 +@@ -1944,7 +1938,7 @@ func_command (char *arg, int from_tty)
  16.395 + 
  16.396 +   if (!found)
  16.397 +     printf_filtered ("'%s' not within current stack frame.\n", arg);
  16.398 +-  else if (fp != deprecated_selected_frame)
  16.399 ++  else if (fp != get_selected_frame ())
  16.400 +     select_and_print_frame (fp);
  16.401 + }
  16.402 + 
  16.403 +@@ -1965,7 +1959,7 @@ get_frame_language (void)
  16.404 +          instruction of another function.  So we rely on
  16.405 +          get_frame_address_in_block(), it provides us with a PC which is
  16.406 +          guaranteed to be inside the frame's code block.  */
  16.407 +-      s = find_pc_symtab (get_frame_address_in_block (deprecated_selected_frame));
  16.408 ++      s = find_pc_symtab (get_frame_address_in_block (get_selected_frame ()));
  16.409 +       if (s)
  16.410 + 	flang = s->language;
  16.411 +       else
  16.412 +Index: gdb-6.3/gdb/tui/tui-disasm.c
  16.413 +===================================================================
  16.414 +--- gdb-6.3.orig/gdb/tui/tui-disasm.c	2004-02-24 20:10:01.000000000 -0500
  16.415 ++++ gdb-6.3/gdb/tui/tui-disasm.c	2004-11-09 22:51:07.370237044 -0500
  16.416 +@@ -382,7 +382,7 @@ tui_vertical_disassem_scroll (enum tui_s
  16.417 + 
  16.418 +       content = (tui_win_content) TUI_DISASM_WIN->generic.content;
  16.419 +       if (cursal.symtab == (struct symtab *) NULL)
  16.420 +-	s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
  16.421 ++	s = find_pc_symtab (get_frame_pc (get_selected_frame ()));
  16.422 +       else
  16.423 + 	s = cursal.symtab;
  16.424 + 
  16.425 +Index: gdb-6.3/gdb/tui/tui-source.c
  16.426 +===================================================================
  16.427 +--- gdb-6.3.orig/gdb/tui/tui-source.c	2004-02-16 16:05:09.000000000 -0500
  16.428 ++++ gdb-6.3/gdb/tui/tui-source.c	2004-11-09 22:51:07.370237044 -0500
  16.429 +@@ -326,7 +326,7 @@ tui_vertical_source_scroll (enum tui_scr
  16.430 +       struct symtab_and_line cursal = get_current_source_symtab_and_line ();
  16.431 + 
  16.432 +       if (cursal.symtab == (struct symtab *) NULL)
  16.433 +-	s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
  16.434 ++	s = find_pc_symtab (get_frame_pc (get_selected_frame ()));
  16.435 +       else
  16.436 + 	s = cursal.symtab;
  16.437 + 
  16.438 +Index: gdb-6.3/gdb/tui/tui-winsource.c
  16.439 +===================================================================
  16.440 +--- gdb-6.3.orig/gdb/tui/tui-winsource.c	2004-02-16 16:05:09.000000000 -0500
  16.441 ++++ gdb-6.3/gdb/tui/tui-winsource.c	2004-11-09 22:51:07.371236848 -0500
  16.442 +@@ -311,7 +311,7 @@ tui_horizontal_source_scroll (struct tui
  16.443 +       struct symtab_and_line cursal = get_current_source_symtab_and_line ();
  16.444 + 
  16.445 +       if (cursal.symtab == (struct symtab *) NULL)
  16.446 +-	s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
  16.447 ++	s = find_pc_symtab (get_frame_pc (get_selected_frame ()));
  16.448 +       else
  16.449 + 	s = cursal.symtab;
  16.450 + 
  16.451 +Index: gdb-6.3/gdb/valops.c
  16.452 +===================================================================
  16.453 +--- gdb-6.3.orig/gdb/valops.c	2004-09-13 23:01:48.000000000 -0400
  16.454 ++++ gdb-6.3/gdb/valops.c	2004-11-09 22:51:07.374236263 -0500
  16.455 +@@ -2663,15 +2663,10 @@ value_of_local (const char *name, int co
  16.456 +   struct block *b;
  16.457 +   struct value * ret;
  16.458 + 
  16.459 +-  if (deprecated_selected_frame == 0)
  16.460 +-    {
  16.461 +-      if (complain)
  16.462 +-	error ("no frame selected");
  16.463 +-      else
  16.464 +-	return 0;
  16.465 +-    }
  16.466 ++  if (!complain && deprecated_selected_frame == 0)
  16.467 ++    return 0;
  16.468 + 
  16.469 +-  func = get_frame_function (deprecated_selected_frame);
  16.470 ++  func = get_frame_function (get_selected_frame ());
  16.471 +   if (!func)
  16.472 +     {
  16.473 +       if (complain)
  16.474 +@@ -2700,7 +2695,7 @@ value_of_local (const char *name, int co
  16.475 + 	return NULL;
  16.476 +     }
  16.477 + 
  16.478 +-  ret = read_var_value (sym, deprecated_selected_frame);
  16.479 ++  ret = read_var_value (sym, get_selected_frame ());
  16.480 +   if (ret == 0 && complain)
  16.481 +     error ("`%s' argument unreadable", name);
  16.482 +   return ret;
  16.483 +Index: gdb-6.3/gdb/varobj.c
  16.484 +===================================================================
  16.485 +--- gdb-6.3.orig/gdb/varobj.c	2004-07-26 10:53:06.000000000 -0400
  16.486 ++++ gdb-6.3/gdb/varobj.c	2004-11-09 22:51:07.377235677 -0500
  16.487 +@@ -488,7 +488,7 @@ varobj_create (char *objname,
  16.488 +       if (fi != NULL)
  16.489 + 	{
  16.490 + 	  var->root->frame = get_frame_id (fi);
  16.491 +-	  old_fi = deprecated_selected_frame;
  16.492 ++	  old_fi = get_selected_frame ();
  16.493 + 	  select_frame (fi);
  16.494 + 	}
  16.495 + 
  16.496 +Index: gdb-6.3/gdb/testsuite/gdb.base/default.exp
  16.497 +===================================================================
  16.498 +--- gdb-6.3.orig/gdb/testsuite/gdb.base/default.exp	2003-03-20 09:45:50.000000000 -0500
  16.499 ++++ gdb-6.3/gdb/testsuite/gdb.base/default.exp	2004-11-09 22:51:07.379235287 -0500
  16.500 +@@ -167,7 +167,7 @@ gdb_test "disable breakpoints" "" "disab
  16.501 + #test disable display
  16.502 + gdb_test "disable display" "" "disable display"
  16.503 + #test disassemble
  16.504 +-gdb_test "disassemble" "No frame selected." "disassemble"
  16.505 ++gdb_test "disassemble" "No (frame selected|registers)." "disassemble"
  16.506 + #test display
  16.507 + gdb_test "display" "" "display"
  16.508 + #test do
  16.509 +@@ -229,9 +229,9 @@ gdb_expect {
  16.510 + }
  16.511 + 
  16.512 + #test frame "f" abbreviation
  16.513 +-gdb_test "f" "No stack." "frame \"f\" abbreviation"
  16.514 ++gdb_test "f" "No (stack|registers)." "frame \"f\" abbreviation"
  16.515 + #test frame
  16.516 +-gdb_test "frame" "No stack." "frame"
  16.517 ++gdb_test "frame" "No (stack|registers)." "frame"
  16.518 + #test fg
  16.519 + gdb_test "fg" "The program is not being run." "fg"
  16.520 + # FIXME: fg kills the udi connection
  16.521 +@@ -294,9 +294,9 @@ gdb_test "ignore" "Argument required .a 
  16.522 + #test info address
  16.523 + gdb_test "info address" "Argument required." "info address"
  16.524 + #test info all-registers
  16.525 +-gdb_test "info all-registers" "The program has no registers now." "info all-registers"
  16.526 ++gdb_test "info all-registers" "(The program has no registers now|No registers)." "info all-registers"
  16.527 + #test info args
  16.528 +-gdb_test "info args" "No frame selected." "info args"
  16.529 ++gdb_test "info args" "No (frame selected|registers)." "info args"
  16.530 + #test info bogus-gdb-command
  16.531 + gdb_test "info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\".  Try \"help info\".*" "info bogus-gdb-command"
  16.532 + #test info breakpoints
  16.533 +@@ -320,11 +320,11 @@ gdb_test "info frame" "No stack.|No sele
  16.534 + #test info files
  16.535 + gdb_test "info files" "" "info files"
  16.536 + #test info float
  16.537 +-gdb_test "info float" "The program has no registers now." "info float"
  16.538 ++gdb_test "info float" "(The program has no registers now|No registers)." "info float"
  16.539 + #test info functions
  16.540 + gdb_test "info functions" "All defined functions:" "info functions"
  16.541 + #test info locals
  16.542 +-gdb_test "info locals" "No frame selected." "info locals"
  16.543 ++gdb_test "info locals" "(No frame selected|No registers)." "info locals"
  16.544 + #test info program
  16.545 + gdb_test "info program" "The program being debugged is not being run." "info program"
  16.546 + #test info registers
  16.547 +@@ -352,7 +352,7 @@ gdb_test "info types" "All defined types
  16.548 + #test info variables
  16.549 + gdb_test "info variables" "All defined variables:" "info variables"
  16.550 + #test info vector
  16.551 +-gdb_test "info vector" "The program has no registers now." "info vector"
  16.552 ++gdb_test "info vector" "(The program has no registers now|No registers)." "info vector"
  16.553 + #test info warranty
  16.554 + gdb_test "info warranty" "NO WARRANTY(\[^\r\n\]*\[\r\n\])+  *11.  *BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY(\[^\r\n\]*\[\r\n\])+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN(\[^\r\n\]*\[\r\n\])+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES(\[^\r\n\]*\[\r\n\])+PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED(\[^\r\n\]*\[\r\n\])+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF(\[^\r\n\]*\[\r\n\])+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS(\[^\r\n\]*\[\r\n\])+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE(\[^\r\n\]*\[\r\n\])+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,(\[^\r\n\]*\[\r\n\])+REPAIR OR CORRECTION.(\[^\r\n\]*\[\r\n\])+  *12.  *IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING(\[^\r\n\]*\[\r\n\])+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR(\[^\r\n\]*\[\r\n\])+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,(\[^\r\n\]*\[\r\n\])+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING(\[^\r\n\]*\[\r\n\])+OUT OF THE USE OR INABILITY TO USE THE PROGRAM .INCLUDING BUT NOT LIMITED(\[^\r\n\]*\[\r\n\])+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY(\[^\r\n\]*\[\r\n\])+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER(\[^\r\n\]*\[\r\n\])+PROGRAMS., EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE(\[^\r\n\]*\[\r\n\])+POSSIBILITY OF SUCH DAMAGES.*" "info warranty"
  16.555 + #test info watchpoints
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/patches/gdb/6.3/620-debian_static-thread-db.patch	Thu May 17 16:22:51 2007 +0000
    17.3 @@ -0,0 +1,156 @@
    17.4 +Status: submitted similar patch 2004-12-08
    17.5 +
    17.6 +This patch cleans up the initialization of thread_db.  It works for static
    17.7 +binaries now.  The vsyscall patches hide this problem, since new static
    17.8 +binaries will load the vsyscall DSO and then trigger thread_db; but
    17.9 +this is still a good cleanup.
   17.10 +
   17.11 +Index: gdb-6.3/gdb/thread-db.c
   17.12 +===================================================================
   17.13 +--- gdb-6.3.orig/gdb/thread-db.c	2004-10-08 16:29:56.000000000 -0400
   17.14 ++++ gdb-6.3/gdb/thread-db.c	2004-11-10 00:19:30.626530413 -0500
   17.15 +@@ -34,6 +34,7 @@
   17.16 + #include "target.h"
   17.17 + #include "regcache.h"
   17.18 + #include "solib-svr4.h"
   17.19 ++#include "observer.h"
   17.20 + 
   17.21 + #ifdef HAVE_GNU_LIBC_VERSION_H
   17.22 + #include <gnu/libc-version.h>
   17.23 +@@ -627,59 +628,49 @@ check_thread_signals (void)
   17.24 + #endif
   17.25 + }
   17.26 + 
   17.27 ++/* Check whether thread_db is usable.  This function is called when
   17.28 ++   an inferior is created (or otherwise acquired, e.g. attached to)
   17.29 ++   and when new shared libraries are loaded into a running process.  */
   17.30 ++
   17.31 + static void
   17.32 +-thread_db_new_objfile (struct objfile *objfile)
   17.33 ++check_for_thread_db (void)
   17.34 + {
   17.35 +   td_err_e err;
   17.36 ++  static int already_loaded;
   17.37 + 
   17.38 +   /* First time through, report that libthread_db was successfuly
   17.39 +      loaded.  Can't print this in in thread_db_load as, at that stage,
   17.40 +-     the interpreter and it's console haven't started.  The real
   17.41 +-     problem here is that libthread_db is loaded too early - it should
   17.42 +-     only be loaded when there is a program to debug.  */
   17.43 +-  {
   17.44 +-    static int dejavu;
   17.45 +-    if (!dejavu)
   17.46 +-      {
   17.47 +-	Dl_info info;
   17.48 +-	const char *library = NULL;
   17.49 +-	/* Try dladdr.  */
   17.50 +-	if (dladdr ((*td_ta_new_p), &info) != 0)
   17.51 +-	  library = info.dli_fname;
   17.52 +-	/* Try dlinfo?  */
   17.53 +-	if (library == NULL)
   17.54 +-	  /* Paranoid - don't let a NULL path slip through.  */
   17.55 +-	  library = LIBTHREAD_DB_SO;
   17.56 +-	printf_unfiltered ("Using host libthread_db library \"%s\".\n",
   17.57 +-			   library);
   17.58 +-	dejavu = 1;
   17.59 +-      }
   17.60 +-  }
   17.61 ++     the interpreter and it's console haven't started.  */
   17.62 + 
   17.63 +-  /* Don't attempt to use thread_db on targets which can not run
   17.64 +-     (core files).  */
   17.65 +-  if (objfile == NULL || !target_has_execution)
   17.66 ++  if (!already_loaded)
   17.67 +     {
   17.68 +-      /* All symbols have been discarded.  If the thread_db target is
   17.69 +-         active, deactivate it now.  */
   17.70 +-      if (using_thread_db)
   17.71 +-	{
   17.72 +-	  gdb_assert (proc_handle.pid == 0);
   17.73 +-	  unpush_target (&thread_db_ops);
   17.74 +-	  using_thread_db = 0;
   17.75 +-	}
   17.76 ++      Dl_info info;
   17.77 ++      const char *library = NULL;
   17.78 ++      if (dladdr ((*td_ta_new_p), &info) != 0)
   17.79 ++	library = info.dli_fname;
   17.80 ++
   17.81 ++      /* Try dlinfo?  */
   17.82 + 
   17.83 +-      goto quit;
   17.84 ++      if (library == NULL)
   17.85 ++	/* Paranoid - don't let a NULL path slip through.  */
   17.86 ++	library = LIBTHREAD_DB_SO;
   17.87 ++
   17.88 ++      printf_unfiltered ("Using host libthread_db library \"%s\".\n",
   17.89 ++			 library);
   17.90 ++      already_loaded = 1;
   17.91 +     }
   17.92 + 
   17.93 +   if (using_thread_db)
   17.94 +     /* Nothing to do.  The thread library was already detected and the
   17.95 +        target vector was already activated.  */
   17.96 +-    goto quit;
   17.97 ++    return;
   17.98 ++
   17.99 ++  /* Don't attempt to use thread_db on targets which can not run
  17.100 ++     (executables not running yet, core files) for now.  */
  17.101 ++  if (!target_has_execution)
  17.102 ++    return;
  17.103 + 
  17.104 +-  /* Initialize the structure that identifies the child process.  Note
  17.105 +-     that at this point there is no guarantee that we actually have a
  17.106 +-     child process.  */
  17.107 ++  /* Initialize the structure that identifies the child process.  */
  17.108 +   proc_handle.pid = GET_PID (inferior_ptid);
  17.109 + 
  17.110 +   /* Now attempt to open a connection to the thread library.  */
  17.111 +@@ -706,12 +697,24 @@ thread_db_new_objfile (struct objfile *o
  17.112 + 	       thread_db_err_str (err));
  17.113 +       break;
  17.114 +     }
  17.115 ++}
  17.116 ++
  17.117 ++static void
  17.118 ++thread_db_new_objfile (struct objfile *objfile)
  17.119 ++{
  17.120 ++  if (objfile != NULL)
  17.121 ++    check_for_thread_db ();
  17.122 + 
  17.123 +-quit:
  17.124 +   if (target_new_objfile_chain)
  17.125 +     target_new_objfile_chain (objfile);
  17.126 + }
  17.127 + 
  17.128 ++static void
  17.129 ++check_for_thread_db_observer (struct target_ops *target, int from_tty)
  17.130 ++{
  17.131 ++  check_for_thread_db ();
  17.132 ++}
  17.133 ++
  17.134 + /* Attach to a new thread.  This function is called when we receive a
  17.135 +    TD_CREATE event or when we iterate over all threads and find one
  17.136 +    that wasn't already in our list.  */
  17.137 +@@ -1366,5 +1369,8 @@ _initialize_thread_db (void)
  17.138 +       /* Add ourselves to objfile event chain.  */
  17.139 +       target_new_objfile_chain = deprecated_target_new_objfile_hook;
  17.140 +       deprecated_target_new_objfile_hook = thread_db_new_objfile;
  17.141 ++
  17.142 ++      /* Register ourselves for the new inferior observer.  */
  17.143 ++      observer_attach_inferior_created (check_for_thread_db_observer);
  17.144 +     }
  17.145 + }
  17.146 +Index: gdb-6.3/gdb/Makefile.in
  17.147 +===================================================================
  17.148 +--- gdb-6.3.orig/gdb/Makefile.in	2004-11-09 23:04:57.000000000 -0500
  17.149 ++++ gdb-6.3/gdb/Makefile.in	2004-11-10 00:19:26.440347022 -0500
  17.150 +@@ -2626,7 +2626,8 @@ thread.o: thread.c $(defs_h) $(symtab_h)
  17.151 + 	$(gdbcmd_h) $(regcache_h) $(gdb_h) $(gdb_string_h) $(ui_out_h)
  17.152 + thread-db.o: thread-db.c $(defs_h) $(gdb_assert_h) $(gdb_proc_service_h) \
  17.153 + 	$(gdb_thread_db_h) $(bfd_h) $(gdbthread_h) $(inferior_h) \
  17.154 +-	$(symfile_h) $(objfiles_h) $(target_h) $(regcache_h) $(solib_svr4_h)
  17.155 ++	$(symfile_h) $(objfiles_h) $(target_h) $(regcache_h) $(solib_svr4_h) \
  17.156 ++	$(observer_h)
  17.157 + top.o: top.c $(defs_h) $(gdbcmd_h) $(call_cmds_h) $(cli_cmds_h) \
  17.158 + 	$(cli_script_h) $(cli_setshow_h) $(cli_decode_h) $(symtab_h) \
  17.159 + 	$(inferior_h) $(target_h) $(breakpoint_h) $(gdbtypes_h) \
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/patches/gdb/6.3/630-debian_24.tracepoint-segv.patch	Thu May 17 16:22:51 2007 +0000
    18.3 @@ -0,0 +1,15 @@
    18.4 +Trivial.  Still need to submit this.
    18.5 +
    18.6 +Index: gdb-6.1/gdb/tracepoint.c
    18.7 +===================================================================
    18.8 +--- gdb-6.1.orig/gdb/tracepoint.c	2004-04-05 13:26:43.000000000 -0400
    18.9 ++++ gdb-6.1/gdb/tracepoint.c	2004-04-05 13:26:45.000000000 -0400
   18.10 +@@ -853,6 +853,8 @@ read_actions (struct tracepoint *t)
   18.11 +       else
   18.12 + 	line = gdb_readline (0);
   18.13 + 
   18.14 ++      if (line == NULL || *line == EOF)
   18.15 ++	break;
   18.16 +       linetype = validate_actionline (&line, t);
   18.17 +       if (linetype == BADLINE)
   18.18 + 	continue;		/* already warned -- collect another line */
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/patches/gdb/6.3/640-debian_dwarf2-frame-signal-unwinder.patch	Thu May 17 16:22:51 2007 +0000
    19.3 @@ -0,0 +1,120 @@
    19.4 +Status: Checked in to HEAD after 6.3.
    19.5 +
    19.6 +2004-11-07  Daniel Jacobowitz  <dan@debian.org>
    19.7 +
    19.8 +	* dwarf2-frame.c (struct dwarf2_frame_ops): Add signal_frame_p.
    19.9 +	(dwarf2_frame_set_signal_frame_p, dwarf2_frame_signal_frame_p)
   19.10 +	(dwarf2_signal_frame_unwind): New.
   19.11 +	(dwarf2_frame_sniffer): Use dwarf2_frame_signal_frame_p.
   19.12 +	* dwarf2-frame.h (dwarf2_frame_set_signal_frame_p): New prototype.
   19.13 +
   19.14 +Index: src/gdb/dwarf2-frame.c
   19.15 +===================================================================
   19.16 +RCS file: /big/fsf/rsync/src-cvs/src/gdb/dwarf2-frame.c,v
   19.17 +retrieving revision 1.41
   19.18 +diff -u -p -r1.41 dwarf2-frame.c
   19.19 +--- src/gdb/dwarf2-frame.c	4 Nov 2004 21:15:15 -0000	1.41
   19.20 ++++ src/gdb/dwarf2-frame.c	7 Nov 2004 17:41:58 -0000
   19.21 +@@ -471,6 +471,10 @@ struct dwarf2_frame_ops
   19.22 + {
   19.23 +   /* Pre-initialize the register state REG for register REGNUM.  */
   19.24 +   void (*init_reg) (struct gdbarch *, int, struct dwarf2_frame_state_reg *);
   19.25 ++
   19.26 ++  /* Check whether the frame preceding NEXT_FRAME will be a signal
   19.27 ++     trampoline.  */
   19.28 ++  int (*signal_frame_p) (struct gdbarch *, struct frame_info *);
   19.29 + };
   19.30 + 
   19.31 + /* Default architecture-specific register state initialization
   19.32 +@@ -547,6 +551,33 @@ dwarf2_frame_init_reg (struct gdbarch *g
   19.33 + 
   19.34 +   ops->init_reg (gdbarch, regnum, reg);
   19.35 + }
   19.36 ++
   19.37 ++/* Set the architecture-specific signal trampoline recognition
   19.38 ++   function for GDBARCH to SIGNAL_FRAME_P.  */
   19.39 ++
   19.40 ++void
   19.41 ++dwarf2_frame_set_signal_frame_p (struct gdbarch *gdbarch,
   19.42 ++				 int (*signal_frame_p) (struct gdbarch *,
   19.43 ++							struct frame_info *))
   19.44 ++{
   19.45 ++  struct dwarf2_frame_ops *ops = gdbarch_data (gdbarch, dwarf2_frame_data);
   19.46 ++
   19.47 ++  ops->signal_frame_p = signal_frame_p;
   19.48 ++}
   19.49 ++
   19.50 ++/* Query the architecture-specific signal frame recognizer for
   19.51 ++   NEXT_FRAME.  */
   19.52 ++
   19.53 ++static int
   19.54 ++dwarf2_frame_signal_frame_p (struct gdbarch *gdbarch,
   19.55 ++			     struct frame_info *next_frame)
   19.56 ++{
   19.57 ++  struct dwarf2_frame_ops *ops = gdbarch_data (gdbarch, dwarf2_frame_data);
   19.58 ++
   19.59 ++  if (ops->signal_frame_p == NULL)
   19.60 ++    return 0;
   19.61 ++  return ops->signal_frame_p (gdbarch, next_frame);
   19.62 ++}
   19.63 + 
   19.64 + 
   19.65 + struct dwarf2_frame_cache
   19.66 +@@ -841,6 +872,13 @@ static const struct frame_unwind dwarf2_
   19.67 +   dwarf2_frame_prev_register
   19.68 + };
   19.69 + 
   19.70 ++static const struct frame_unwind dwarf2_signal_frame_unwind =
   19.71 ++{
   19.72 ++  SIGTRAMP_FRAME,
   19.73 ++  dwarf2_frame_this_id,
   19.74 ++  dwarf2_frame_prev_register
   19.75 ++};
   19.76 ++
   19.77 + const struct frame_unwind *
   19.78 + dwarf2_frame_sniffer (struct frame_info *next_frame)
   19.79 + {
   19.80 +@@ -848,10 +886,18 @@ dwarf2_frame_sniffer (struct frame_info 
   19.81 +      function.  frame_pc_unwind(), for a no-return next function, can
   19.82 +      end up returning something past the end of this function's body.  */
   19.83 +   CORE_ADDR block_addr = frame_unwind_address_in_block (next_frame);
   19.84 +-  if (dwarf2_frame_find_fde (&block_addr))
   19.85 +-    return &dwarf2_frame_unwind;
   19.86 ++  if (!dwarf2_frame_find_fde (&block_addr))
   19.87 ++    return NULL;
   19.88 + 
   19.89 +-  return NULL;
   19.90 ++  /* On some targets, signal trampolines may have unwind information.
   19.91 ++     We need to recognize them so that we set the frame type
   19.92 ++     correctly.  */
   19.93 ++
   19.94 ++  if (dwarf2_frame_signal_frame_p (get_frame_arch (next_frame),
   19.95 ++				   next_frame))
   19.96 ++    return &dwarf2_signal_frame_unwind;
   19.97 ++
   19.98 ++  return &dwarf2_frame_unwind;
   19.99 + }
  19.100 + 
  19.101 + 
  19.102 +Index: src/gdb/dwarf2-frame.h
  19.103 +===================================================================
  19.104 +RCS file: /big/fsf/rsync/src-cvs/src/gdb/dwarf2-frame.h,v
  19.105 +retrieving revision 1.6
  19.106 +diff -u -p -r1.6 dwarf2-frame.h
  19.107 +--- src/gdb/dwarf2-frame.h	28 Feb 2004 16:59:32 -0000	1.6
  19.108 ++++ src/gdb/dwarf2-frame.h	7 Nov 2004 17:40:41 -0000
  19.109 +@@ -79,6 +79,14 @@ extern void dwarf2_frame_set_init_reg (s
  19.110 + 				       void (*init_reg) (struct gdbarch *, int,
  19.111 + 					     struct dwarf2_frame_state_reg *));
  19.112 + 
  19.113 ++/* Set the architecture-specific signal trampoline recognition
  19.114 ++   function for GDBARCH to SIGNAL_FRAME_P.  */
  19.115 ++
  19.116 ++extern void
  19.117 ++  dwarf2_frame_set_signal_frame_p (struct gdbarch *gdbarch,
  19.118 ++				   int (*signal_frame_p) (struct gdbarch *,
  19.119 ++							  struct frame_info *));
  19.120 ++
  19.121 + /* Return the frame unwind methods for the function that contains PC,
  19.122 +    or NULL if it can't be handled by DWARF CFI frame unwinder.  */
  19.123 + 
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/patches/gdb/6.3/650-debian_vsyscall-gdb-support.patch	Thu May 17 16:22:51 2007 +0000
    20.3 @@ -0,0 +1,245 @@
    20.4 +Status: Checked in to HEAD after 6.3.
    20.5 +
    20.6 +2004-11-07  Andrew Cagney  <cagney@redhat.com>
    20.7 +	    Daniel Jacobowitz  <dan@debian.org>
    20.8 +	    Roland McGrath  <roland@redhat.com>
    20.9 +
   20.10 +	* Makefile.in (symfile-mem.o): Update dependencies.
   20.11 +	* i386-linux-tdep.c (i386_linux_dwarf_signal_frame_p): New.
   20.12 +	(i386_linux_init_abi): Call dwarf2_frame_set_signal_frame_p.
   20.13 +	* inf-ptrace.c (inf_ptrace_attach): Call
   20.14 +	observer_notify_inferior_created.
   20.15 +	* inftarg.c (child_attach): Likewise.
   20.16 +	* symfile-mem.c: Include "observer.h", "auxv.h", and "elf/common.h".
   20.17 +	(symbol_file_add_from_memory): Take NAME argument.  Use it for
   20.18 +	the new BFD's filename.
   20.19 +	(add_symbol_file_from_memory_command): Update call to
   20.20 +	symbol_file_add_from_memory.
   20.21 +	(struct symbol_file_add_from_memory_args, add_vsyscall_page)
   20.22 +	(symbol_file_add_from_memory_wrapper): New.
   20.23 +	(_initialize_symfile_mem): Register add_vsyscall_page as an
   20.24 +	inferior_created observer.
   20.25 +
   20.26 +Index: gdb-6.3/gdb/i386-linux-tdep.c
   20.27 +===================================================================
   20.28 +--- gdb-6.3.orig/gdb/i386-linux-tdep.c	2004-08-06 16:58:28.000000000 -0400
   20.29 ++++ gdb-6.3/gdb/i386-linux-tdep.c	2004-11-10 00:55:06.669398770 -0500
   20.30 +@@ -27,6 +27,7 @@
   20.31 + #include "inferior.h"
   20.32 + #include "osabi.h"
   20.33 + #include "reggroups.h"
   20.34 ++#include "dwarf2-frame.h"
   20.35 + 
   20.36 + #include "gdb_string.h"
   20.37 + 
   20.38 +@@ -244,6 +245,27 @@ i386_linux_sigtramp_p (struct frame_info
   20.39 + 	  || strcmp ("__restore_rt", name) == 0);
   20.40 + }
   20.41 + 
   20.42 ++/* Return one if the unwound PC from NEXT_FRAME is in a signal trampoline
   20.43 ++   which may have DWARF-2 CFI.  */
   20.44 ++
   20.45 ++static int
   20.46 ++i386_linux_dwarf_signal_frame_p (struct gdbarch *gdbarch,
   20.47 ++				 struct frame_info *next_frame)
   20.48 ++{
   20.49 ++  CORE_ADDR pc = frame_pc_unwind (next_frame);
   20.50 ++  char *name;
   20.51 ++
   20.52 ++  find_pc_partial_function (pc, &name, NULL, NULL);
   20.53 ++
   20.54 ++  /* If a vsyscall DSO is in use, the signal trampolines may have these
   20.55 ++     names.  */
   20.56 ++  if (name && (strcmp (name, "__kernel_sigreturn") == 0
   20.57 ++	       || strcmp (name, "__kernel_rt_sigreturn") == 0))
   20.58 ++    return 1;
   20.59 ++
   20.60 ++  return 0;
   20.61 ++}
   20.62 ++
   20.63 + /* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>.  */
   20.64 + #define I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 20
   20.65 + 
   20.66 +@@ -414,6 +436,8 @@ i386_linux_init_abi (struct gdbarch_info
   20.67 + 
   20.68 +   /* GNU/Linux uses the dynamic linker included in the GNU C Library.  */
   20.69 +   set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
   20.70 ++
   20.71 ++  dwarf2_frame_set_signal_frame_p (gdbarch, i386_linux_dwarf_signal_frame_p);
   20.72 + }
   20.73 + 
   20.74 + /* Provide a prototype to silence -Wmissing-prototypes.  */
   20.75 +Index: gdb-6.3/gdb/inf-ptrace.c
   20.76 +===================================================================
   20.77 +--- gdb-6.3.orig/gdb/inf-ptrace.c	2004-10-15 09:29:33.000000000 -0400
   20.78 ++++ gdb-6.3/gdb/inf-ptrace.c	2004-11-10 00:53:43.697615843 -0500
   20.79 +@@ -220,6 +220,10 @@ inf_ptrace_attach (char *args, int from_
   20.80 + 
   20.81 +   inferior_ptid = pid_to_ptid (pid);
   20.82 +   push_target (ptrace_ops_hack);
   20.83 ++
   20.84 ++  /* Do this first, before anything has had a chance to query the
   20.85 ++     inferior's symbol table or similar.  */
   20.86 ++  observer_notify_inferior_created (&current_target, from_tty);
   20.87 + }
   20.88 + 
   20.89 + static void
   20.90 +Index: gdb-6.3/gdb/inftarg.c
   20.91 +===================================================================
   20.92 +--- gdb-6.3.orig/gdb/inftarg.c	2004-10-08 16:29:47.000000000 -0400
   20.93 ++++ gdb-6.3/gdb/inftarg.c	2004-11-10 00:53:43.711613107 -0500
   20.94 +@@ -211,6 +211,10 @@ child_attach (char *args, int from_tty)
   20.95 +   
   20.96 +   inferior_ptid = pid_to_ptid (pid);
   20.97 +   push_target (&deprecated_child_ops);
   20.98 ++
   20.99 ++  /* Do this first, before anything has had a chance to query the
  20.100 ++     inferior's symbol table or similar.  */
  20.101 ++  observer_notify_inferior_created (&current_target, from_tty);
  20.102 + }
  20.103 + 
  20.104 + #if !defined(CHILD_POST_ATTACH)
  20.105 +Index: gdb-6.3/gdb/symfile-mem.c
  20.106 +===================================================================
  20.107 +--- gdb-6.3.orig/gdb/symfile-mem.c	2004-07-17 10:24:07.000000000 -0400
  20.108 ++++ gdb-6.3/gdb/symfile-mem.c	2004-11-10 00:53:43.722610958 -0500
  20.109 +@@ -52,13 +52,19 @@
  20.110 + #include "target.h"
  20.111 + #include "value.h"
  20.112 + #include "symfile.h"
  20.113 ++#include "observer.h"
  20.114 ++#include "auxv.h"
  20.115 ++#include "elf/common.h"
  20.116 + 
  20.117 + 
  20.118 + /* Read inferior memory at ADDR to find the header of a loaded object file
  20.119 +    and read its in-core symbols out of inferior memory.  TEMPL is a bfd
  20.120 +-   representing the target's format.  */
  20.121 ++   representing the target's format.  NAME is the name to use for this
  20.122 ++   symbol file in messages; it can be NULL or a malloc-allocated string
  20.123 ++   which will be attached to the BFD.  */
  20.124 + static struct objfile *
  20.125 +-symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, int from_tty)
  20.126 ++symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, char *name,
  20.127 ++			     int from_tty)
  20.128 + {
  20.129 +   struct objfile *objf;
  20.130 +   struct bfd *nbfd;
  20.131 +@@ -75,7 +81,10 @@ symbol_file_add_from_memory (struct bfd 
  20.132 +   if (nbfd == NULL)
  20.133 +     error ("Failed to read a valid object file image from memory.");
  20.134 + 
  20.135 +-  nbfd->filename = xstrdup ("shared object read from target memory");
  20.136 ++  if (name == NULL)
  20.137 ++    nbfd->filename = xstrdup ("shared object read from target memory");
  20.138 ++  else
  20.139 ++    nbfd->filename = name;
  20.140 + 
  20.141 +   if (!bfd_check_format (nbfd, bfd_object))
  20.142 +     {
  20.143 +@@ -129,7 +138,73 @@ add_symbol_file_from_memory_command (cha
  20.144 +     error ("\
  20.145 + Must use symbol-file or exec-file before add-symbol-file-from-memory.");
  20.146 + 
  20.147 +-  symbol_file_add_from_memory (templ, addr, from_tty);
  20.148 ++  symbol_file_add_from_memory (templ, addr, NULL, from_tty);
  20.149 ++}
  20.150 ++
  20.151 ++/* Arguments for symbol_file_add_from_memory_wrapper.  */
  20.152 ++
  20.153 ++struct symbol_file_add_from_memory_args
  20.154 ++{
  20.155 ++  struct bfd *bfd;
  20.156 ++  CORE_ADDR sysinfo_ehdr;
  20.157 ++  char *name;
  20.158 ++  int from_tty;
  20.159 ++};
  20.160 ++
  20.161 ++/* Wrapper function for symbol_file_add_from_memory, for
  20.162 ++   catch_exceptions.  */
  20.163 ++
  20.164 ++static int
  20.165 ++symbol_file_add_from_memory_wrapper (struct ui_out *uiout, void *data)
  20.166 ++{
  20.167 ++  struct symbol_file_add_from_memory_args *args = data;
  20.168 ++
  20.169 ++  symbol_file_add_from_memory (args->bfd, args->sysinfo_ehdr, args->name,
  20.170 ++			       args->from_tty);
  20.171 ++  return 0;
  20.172 ++}
  20.173 ++
  20.174 ++/* Try to add the symbols for the vsyscall page, if there is one.  This function
  20.175 ++   is called via the inferior_created observer.  */
  20.176 ++
  20.177 ++static void
  20.178 ++add_vsyscall_page (struct target_ops *target, int from_tty)
  20.179 ++{
  20.180 ++  CORE_ADDR sysinfo_ehdr;
  20.181 ++
  20.182 ++  if (target_auxv_search (target, AT_SYSINFO_EHDR, &sysinfo_ehdr) > 0
  20.183 ++      && sysinfo_ehdr != (CORE_ADDR) 0)
  20.184 ++    {
  20.185 ++      struct bfd *bfd;
  20.186 ++      struct symbol_file_add_from_memory_args args;
  20.187 ++
  20.188 ++      if (core_bfd != NULL)
  20.189 ++	bfd = core_bfd;
  20.190 ++      else if (exec_bfd != NULL)
  20.191 ++	bfd = exec_bfd;
  20.192 ++      else
  20.193 ++       /* FIXME: cagney/2004-05-06: Should not require an existing
  20.194 ++	  BFD when trying to create a run-time BFD of the VSYSCALL
  20.195 ++	  page in the inferior.  Unfortunately that's the current
  20.196 ++	  interface so for the moment bail.  Introducing a
  20.197 ++	  ``bfd_runtime'' (a BFD created using the loaded image) file
  20.198 ++	  format should fix this.  */
  20.199 ++	{
  20.200 ++	  warning ("could not load vsyscall page because no executable was specified");
  20.201 ++	  warning ("try using the \"file\" command first");
  20.202 ++	  return;
  20.203 ++	}
  20.204 ++      args.bfd = bfd;
  20.205 ++      args.sysinfo_ehdr = sysinfo_ehdr;
  20.206 ++      xasprintf (&args.name, "system-supplied DSO at 0x%s",
  20.207 ++		 paddr_nz (sysinfo_ehdr));
  20.208 ++      /* Pass zero for FROM_TTY, because the action of loading the
  20.209 ++	 vsyscall DSO was not triggered by the user, even if the user
  20.210 ++	 typed "run" at the TTY.  */
  20.211 ++      args.from_tty = 0;
  20.212 ++      catch_exceptions (uiout, symbol_file_add_from_memory_wrapper,
  20.213 ++			&args, NULL, RETURN_MASK_ALL);
  20.214 ++    }
  20.215 + }
  20.216 + 
  20.217 + 
  20.218 +@@ -143,4 +218,7 @@ Load the symbols out of memory from a dy
  20.219 + Give an expression for the address of the file's shared object file header.",
  20.220 +            &cmdlist);
  20.221 + 
  20.222 ++  /* Want to know of each new inferior so that its vsyscall info can
  20.223 ++     be extracted.  */
  20.224 ++  observer_attach_inferior_created (add_vsyscall_page);
  20.225 + }
  20.226 +Index: gdb-6.3/gdb/Makefile.in
  20.227 +===================================================================
  20.228 +--- gdb-6.3.orig/gdb/Makefile.in	2004-11-10 00:29:00.000000000 -0500
  20.229 ++++ gdb-6.3/gdb/Makefile.in	2004-11-10 00:54:47.728100986 -0500
  20.230 +@@ -2020,7 +2020,7 @@ i386-linux-nat.o: i386-linux-nat.c $(def
  20.231 + i386-linux-tdep.o: i386-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \
  20.232 + 	$(value_h) $(regcache_h) $(inferior_h) $(osabi_h) $(reggroups_h) \
  20.233 + 	$(gdb_string_h) $(i386_tdep_h) $(i386_linux_tdep_h) $(glibc_tdep_h) \
  20.234 +-	$(solib_svr4_h)
  20.235 ++	$(solib_svr4_h) $(dwarf2_frame_h)
  20.236 + i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \
  20.237 + 	$(regcache_h) $(target_h) $(osabi_h) $(i386_tdep_h)
  20.238 + i386-nat.o: i386-nat.c $(defs_h) $(breakpoint_h) $(command_h) $(gdbcmd_h)
  20.239 +@@ -2606,7 +2606,8 @@ symfile.o: symfile.c $(defs_h) $(bfdlink
  20.240 + 	$(hashtab_h) $(readline_h) $(gdb_assert_h) $(block_h) \
  20.241 + 	$(gdb_string_h) $(gdb_stat_h)
  20.242 + symfile-mem.o: symfile-mem.c $(defs_h) $(symtab_h) $(gdbcore_h) \
  20.243 +-	$(objfiles_h) $(gdbcmd_h) $(target_h) $(value_h) $(symfile_h)
  20.244 ++	$(objfiles_h) $(gdbcmd_h) $(target_h) $(value_h) $(symfile_h) \
  20.245 ++	$(observer_h) $(auxv_h) $(elf_common_h)
  20.246 + symmisc.o: symmisc.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(bfd_h) \
  20.247 + 	$(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \
  20.248 + 	$(gdb_obstack_h) $(language_h) $(bcache_h) $(block_h) $(gdb_regex_h) \
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/patches/gdb/6.3/660-debian_dwarf-cfa-restore.patch	Thu May 17 16:22:51 2007 +0000
    21.3 @@ -0,0 +1,23 @@
    21.4 +Status: Checked in to HEAD after 6.3.
    21.5 +
    21.6 +2004-11-09  Daniel Jacobowitz  <dan@debian.org>
    21.7 +
    21.8 +	* dwarf2-frame.c (dwarf2_frame_state_alloc_regs): Correct allocated
    21.9 +	size.
   21.10 +
   21.11 +Index: src/gdb/dwarf2-frame.c
   21.12 +===================================================================
   21.13 +RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v
   21.14 +retrieving revision 1.45
   21.15 +diff -u -p -r1.45 dwarf2-frame.c
   21.16 +--- src/gdb/dwarf2-frame.c	7 Nov 2004 21:16:11 -0000	1.45
   21.17 ++++ src/gdb/dwarf2-frame.c	9 Nov 2004 14:42:52 -0000
   21.18 +@@ -162,7 +162,7 @@ dwarf2_frame_state_alloc_regs (struct dw
   21.19 + static struct dwarf2_frame_state_reg *
   21.20 + dwarf2_frame_state_copy_regs (struct dwarf2_frame_state_reg_info *rs)
   21.21 + {
   21.22 +-  size_t size = rs->num_regs * sizeof (struct dwarf2_frame_state_reg_info);
   21.23 ++  size_t size = rs->num_regs * sizeof (struct dwarf2_frame_state_reg);
   21.24 +   struct dwarf2_frame_state_reg *reg;
   21.25 + 
   21.26 +   reg = (struct dwarf2_frame_state_reg *) xmalloc (size);
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/patches/gdb/6.3/680-debian_sim-destdir.patch	Thu May 17 16:22:51 2007 +0000
    22.3 @@ -0,0 +1,53 @@
    22.4 +Fix some missing uses of DESTDIR in the sim/ directories.  The Debian
    22.5 +packages use DESTDIR to build.
    22.6 +
    22.7 +%patch
    22.8 +Index: gdb-6.3/sim/Makefile.in
    22.9 +===================================================================
   22.10 +--- gdb-6.3.orig/sim/Makefile.in	2003-09-03 14:46:52.000000000 -0400
   22.11 ++++ gdb-6.3/sim/Makefile.in	2004-11-10 00:39:25.381315738 -0500
   22.12 +@@ -93,6 +93,7 @@ FLAGS_TO_PASS = \
   22.13 + 	"CC=$(CC)" \
   22.14 + 	"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
   22.15 + 	"CFLAGS=$(CFLAGS)" \
   22.16 ++	"DESTDIR=$(DESTDIR)" \
   22.17 + 	"RANLIB=$(RANLIB)" \
   22.18 + 	"MAKEINFO=$(MAKEINFO)" \
   22.19 + 	"INSTALL=$(INSTALL)" \
   22.20 +Index: gdb-6.3/sim/common/Make-common.in
   22.21 +===================================================================
   22.22 +--- gdb-6.3.orig/sim/common/Make-common.in	2003-09-08 13:24:59.000000000 -0400
   22.23 ++++ gdb-6.3/sim/common/Make-common.in	2004-11-10 00:39:25.383315347 -0500
   22.24 +@@ -581,14 +581,14 @@ install: install-common $(SIM_EXTRA_INST
   22.25 + 
   22.26 + install-common: installdirs
   22.27 + 	n=`echo run | sed '$(program_transform_name)'`; \
   22.28 +-	$(INSTALL_PROGRAM) run$(EXEEXT) $(bindir)/$$n$(EXEEXT)
   22.29 ++	$(INSTALL_PROGRAM) run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
   22.30 + 	n=`echo libsim.a | sed s/libsim.a/lib$(target_alias)-sim.a/`; \
   22.31 +-	$(INSTALL_DATA) libsim.a $(libdir)/$$n ; \
   22.32 +-	( cd $(libdir) ; $(RANLIB) $$n )
   22.33 ++	$(INSTALL_DATA) libsim.a $(DESTDIR)$(libdir)/$$n ; \
   22.34 ++	( cd $(DESTDIR)$(libdir) ; $(RANLIB) $$n )
   22.35 + 
   22.36 + installdirs:
   22.37 +-	$(SHELL) $(srcdir)/../../mkinstalldirs $(bindir)
   22.38 +-	$(SHELL) $(srcdir)/../../mkinstalldirs $(libdir)
   22.39 ++	$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir)
   22.40 ++	$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(libdir)
   22.41 + 
   22.42 + check:
   22.43 + 	cd ../testsuite && $(MAKE) check RUNTESTFLAGS="$(RUNTESTFLAGS)"
   22.44 +Index: gdb-6.3/sim/erc32/Makefile.in
   22.45 +===================================================================
   22.46 +--- gdb-6.3.orig/sim/erc32/Makefile.in	2000-03-07 10:32:49.000000000 -0500
   22.47 ++++ gdb-6.3/sim/erc32/Makefile.in	2004-11-10 00:39:25.385314957 -0500
   22.48 +@@ -53,7 +53,7 @@ end.h: end
   22.49 + # Copy the files into directories where they will be run.
   22.50 + install-sis: installdirs
   22.51 + 	n=`echo sis | sed '$(program_transform_name)'`; \
   22.52 +-	$(INSTALL_PROGRAM) sis$(EXEEXT) $(bindir)/$$n$(EXEEXT)
   22.53 ++	$(INSTALL_PROGRAM) sis$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
   22.54 + 
   22.55 + clean-sis:
   22.56 + 	rm -f sis end end.h
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/patches/gdb/6.3/690-debian_member-field-symtab.patch	Thu May 17 16:22:51 2007 +0000
    23.3 @@ -0,0 +1,35 @@
    23.4 +Status: unsubmitted
    23.5 +
    23.6 +This patch was for Debian bug #239535.  It needs to be tested, and
    23.7 +submitted.
    23.8 +
    23.9 +Index: gdb-6.3/gdb/valops.c
   23.10 +===================================================================
   23.11 +--- gdb-6.3.orig/gdb/valops.c	2004-11-09 22:51:07.000000000 -0500
   23.12 ++++ gdb-6.3/gdb/valops.c	2004-11-10 00:43:54.036837699 -0500
   23.13 +@@ -2314,8 +2314,10 @@ check_field_in (struct type *type, const
   23.14 + 	return 1;
   23.15 +     }
   23.16 + 
   23.17 ++  /* Check each baseclass.  Call check_typedef, which will follow typedefs
   23.18 ++     and do opaque/stub type resolution.  */
   23.19 +   for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
   23.20 +-    if (check_field_in (TYPE_BASECLASS (type, i), name))
   23.21 ++    if (check_field_in (check_typedef (TYPE_BASECLASS (type, i)), name))
   23.22 +       return 1;
   23.23 + 
   23.24 +   return 0;
   23.25 +Index: gdb-6.3/gdb/dwarf2read.c
   23.26 +===================================================================
   23.27 +--- gdb-6.3.orig/gdb/dwarf2read.c	2004-10-15 20:41:00.000000000 -0400
   23.28 ++++ gdb-6.3/gdb/dwarf2read.c	2004-11-10 00:46:21.970935829 -0500
   23.29 +@@ -2099,8 +2099,8 @@ guess_structure_name (struct partial_die
   23.30 + 				    strlen (actual_class_name),
   23.31 + 				    &cu->comp_unit_obstack);
   23.32 + 		  xfree (actual_class_name);
   23.33 ++		  break;
   23.34 + 		}
   23.35 +-	      break;
   23.36 + 	    }
   23.37 + 
   23.38 + 	  child_pdi = child_pdi->die_sibling;
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/patches/gdb/6.3/700-debian_cp-pass-by-reference.patch	Thu May 17 16:22:51 2007 +0000
    24.3 @@ -0,0 +1,464 @@
    24.4 +This patch needs to be submitted for the FSF.  Also, there may be testcases
    24.5 +already in the GDB testsuite (currently disabled) that it would probably fix.
    24.6 +
    24.7 +Index: gdb-6.3/gdb/infcall.c
    24.8 +===================================================================
    24.9 +--- gdb-6.3.orig/gdb/infcall.c	2004-10-08 04:15:56.000000000 -0400
   24.10 ++++ gdb-6.3/gdb/infcall.c	2004-11-10 12:30:07.000000000 -0500
   24.11 +@@ -36,6 +36,7 @@
   24.12 + #include "gdb_string.h"
   24.13 + #include "infcall.h"
   24.14 + #include "dummy-frame.h"
   24.15 ++#include "cp-abi.h"
   24.16 + 
   24.17 + /* NOTE: cagney/2003-04-16: What's the future of this code?
   24.18 + 
   24.19 +@@ -297,8 +298,8 @@ call_function_by_hand (struct value *fun
   24.20 + {
   24.21 +   CORE_ADDR sp;
   24.22 +   CORE_ADDR dummy_addr;
   24.23 +-  struct type *value_type;
   24.24 +-  unsigned char struct_return;
   24.25 ++  struct type *value_type, *target_value_type;
   24.26 ++  unsigned char struct_return = 0, cp_struct_return = 0;
   24.27 +   CORE_ADDR struct_addr = 0;
   24.28 +   struct regcache *retbuf;
   24.29 +   struct cleanup *retbuf_cleanup;
   24.30 +@@ -312,6 +313,7 @@ call_function_by_hand (struct value *fun
   24.31 +   struct regcache *caller_regcache;
   24.32 +   struct cleanup *caller_regcache_cleanup;
   24.33 +   struct frame_id dummy_id;
   24.34 ++  struct cleanup *args_cleanup;
   24.35 + 
   24.36 +   if (!target_has_execution)
   24.37 +     noprocess ();
   24.38 +@@ -410,10 +412,31 @@ call_function_by_hand (struct value *fun
   24.39 +     using_gcc = (b == NULL ? 2 : BLOCK_GCC_COMPILED (b));
   24.40 +   }
   24.41 + 
   24.42 +-  /* Are we returning a value using a structure return or a normal
   24.43 +-     value return? */
   24.44 ++  /* Are we returning a value using a structure return (passing a
   24.45 ++     hidden argument pointing to storage) or a normal value return?
   24.46 ++     There are two cases: C++ ABI mandated structure return and
   24.47 ++     target ABI structure return.  The variable STRUCT_RETURN only
   24.48 ++     describes the latter.  The C++ version is handled by passing
   24.49 ++     the return location as the first parameter to the function,
   24.50 ++     even preceding "this".  This is different from the target
   24.51 ++     ABI version, which is target-specific; for instance, on ia64
   24.52 ++     the first argument is passed in out0 but the hidden structure
   24.53 ++     return pointer would normally be passed in r8.  */
   24.54 + 
   24.55 +-  struct_return = using_struct_return (value_type, using_gcc);
   24.56 ++  if (current_language->la_language == language_cplus
   24.57 ++      && cp_pass_by_reference (value_type))
   24.58 ++    {
   24.59 ++      cp_struct_return = 1;
   24.60 ++
   24.61 ++      /* Tell the target specific argument pushing routine not to
   24.62 ++	 expect a value.  */
   24.63 ++      target_value_type = builtin_type_void;
   24.64 ++    }
   24.65 ++  else
   24.66 ++    {
   24.67 ++      struct_return = using_struct_return (value_type, using_gcc);
   24.68 ++      target_value_type = value_type;
   24.69 ++    }
   24.70 + 
   24.71 +   /* Determine the location of the breakpoint (and possibly other
   24.72 +      stuff) that the called function will return to.  The SPARC, for a
   24.73 +@@ -432,7 +455,7 @@ call_function_by_hand (struct value *fun
   24.74 +       if (INNER_THAN (1, 2))
   24.75 + 	{
   24.76 + 	  sp = push_dummy_code (current_gdbarch, sp, funaddr,
   24.77 +-				using_gcc, args, nargs, value_type,
   24.78 ++				using_gcc, args, nargs, target_value_type,
   24.79 + 				&real_pc, &bp_addr);
   24.80 + 	  dummy_addr = sp;
   24.81 + 	}
   24.82 +@@ -440,7 +463,7 @@ call_function_by_hand (struct value *fun
   24.83 + 	{
   24.84 + 	  dummy_addr = sp;
   24.85 + 	  sp = push_dummy_code (current_gdbarch, sp, funaddr,
   24.86 +-				using_gcc, args, nargs, value_type,
   24.87 ++				using_gcc, args, nargs, target_value_type,
   24.88 + 				&real_pc, &bp_addr);
   24.89 + 	}
   24.90 +       break;
   24.91 +@@ -507,9 +530,15 @@ call_function_by_hand (struct value *fun
   24.92 + 	  param_type = TYPE_FIELD_TYPE (ftype, i);
   24.93 + 	else
   24.94 + 	  param_type = NULL;
   24.95 +-	
   24.96 ++
   24.97 + 	args[i] = value_arg_coerce (args[i], param_type, prototyped);
   24.98 + 
   24.99 ++	/* FIXME: Is current_language the right language?  */
  24.100 ++	if (current_language->la_language == language_cplus
  24.101 ++	    && param_type != NULL
  24.102 ++	    && cp_pass_by_reference (param_type))
  24.103 ++	  args[i] = value_addr (args[i]);
  24.104 ++
  24.105 + 	/* elz: this code is to handle the case in which the function
  24.106 + 	   to be called has a pointer to function as parameter and the
  24.107 + 	   corresponding actual argument is the address of a function
  24.108 +@@ -607,7 +636,7 @@ You must use a pointer to function type 
  24.109 +      stack, if necessary.  Make certain that the value is correctly
  24.110 +      aligned. */
  24.111 + 
  24.112 +-  if (struct_return)
  24.113 ++  if (struct_return || cp_struct_return)
  24.114 +     {
  24.115 +       int len = TYPE_LENGTH (value_type);
  24.116 +       if (INNER_THAN (1, 2))
  24.117 +@@ -632,6 +661,22 @@ You must use a pointer to function type 
  24.118 + 	}
  24.119 +     }
  24.120 + 
  24.121 ++  if (cp_struct_return)
  24.122 ++    {
  24.123 ++      struct value **new_args;
  24.124 ++
  24.125 ++      /* Add the new argument to the front of the argument list.  */
  24.126 ++      new_args = xmalloc (sizeof (struct value *) * (nargs + 1));
  24.127 ++      new_args[0] = value_from_pointer (lookup_pointer_type (value_type),
  24.128 ++					struct_addr);
  24.129 ++      memcpy (&new_args[1], &args[0], sizeof (struct value *) * nargs);
  24.130 ++      args = new_args;
  24.131 ++      nargs++;
  24.132 ++      args_cleanup = make_cleanup (xfree, args);
  24.133 ++    }
  24.134 ++  else
  24.135 ++    args_cleanup = make_cleanup (null_cleanup, NULL);
  24.136 ++
  24.137 +   /* Create the dummy stack frame.  Pass in the call dummy address as,
  24.138 +      presumably, the ABI code knows where, in the call dummy, the
  24.139 +      return address should be pointed.  */
  24.140 +@@ -649,6 +694,8 @@ You must use a pointer to function type 
  24.141 +   else
  24.142 +     error ("This target does not support function calls");
  24.143 + 
  24.144 ++  do_cleanups (args_cleanup);
  24.145 ++
  24.146 +   /* Set up a frame ID for the dummy frame so we can pass it to
  24.147 +      set_momentary_breakpoint.  We need to give the breakpoint a frame
  24.148 +      ID so that the breakpoint code can correctly re-identify the
  24.149 +@@ -839,11 +886,7 @@ the function call).", name);
  24.150 +   /* Figure out the value returned by the function, return that.  */
  24.151 +   {
  24.152 +     struct value *retval;
  24.153 +-    if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
  24.154 +-      /* If the function returns void, don't bother fetching the
  24.155 +-	 return value.  */
  24.156 +-      retval = allocate_value (value_type);
  24.157 +-    else if (struct_return)
  24.158 ++    if (struct_return || cp_struct_return)
  24.159 +       /* NOTE: cagney/2003-09-27: This assumes that PUSH_DUMMY_CALL
  24.160 + 	 has correctly stored STRUCT_ADDR in the target.  In the past
  24.161 + 	 that hasn't been the case, the old MIPS PUSH_ARGUMENTS
  24.162 +@@ -853,6 +896,10 @@ the function call).", name);
  24.163 + 	 "struct return convention", check that PUSH_DUMMY_CALL isn't
  24.164 + 	 playing tricks.  */
  24.165 +       retval = value_at (value_type, struct_addr, NULL);
  24.166 ++    else if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
  24.167 ++      /* If the function returns void, don't bother fetching the
  24.168 ++	 return value.  */
  24.169 ++      retval = allocate_value (value_type);
  24.170 +     else
  24.171 +       {
  24.172 + 	/* This code only handles "register convention".  */
  24.173 +Index: gdb-6.3/gdb/cp-abi.h
  24.174 +===================================================================
  24.175 +--- gdb-6.3.orig/gdb/cp-abi.h	2003-04-12 13:41:25.000000000 -0400
  24.176 ++++ gdb-6.3/gdb/cp-abi.h	2004-11-10 12:30:07.000000000 -0500
  24.177 +@@ -1,7 +1,7 @@
  24.178 + /* Abstraction of various C++ ABI's we support, and the info we need
  24.179 +    to get from them.
  24.180 +    Contributed by Daniel Berlin <dberlin@redhat.com>
  24.181 +-   Copyright 2001 Free Software Foundation, Inc.
  24.182 ++   Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  24.183 + 
  24.184 +    This file is part of GDB.
  24.185 + 
  24.186 +@@ -145,6 +145,10 @@ extern struct type *value_rtti_type (str
  24.187 + extern int baseclass_offset (struct type *type, int index, char *valaddr,
  24.188 + 			     CORE_ADDR address);
  24.189 +                   
  24.190 ++/* Return non-zero if an argument of type TYPE should be passed by reference
  24.191 ++   instead of value.  */
  24.192 ++extern int cp_pass_by_reference (struct type *type);
  24.193 ++
  24.194 + struct cp_abi_ops
  24.195 + {
  24.196 +   const char *shortname;
  24.197 +@@ -162,6 +166,7 @@ struct cp_abi_ops
  24.198 + 			     int *using_enc);
  24.199 +   int (*baseclass_offset) (struct type *type, int index, char *valaddr,
  24.200 + 			   CORE_ADDR address);
  24.201 ++  int (*pass_by_reference) (struct type *type);
  24.202 + };
  24.203 + 
  24.204 + 
  24.205 +Index: gdb-6.3/gdb/cp-abi.c
  24.206 +===================================================================
  24.207 +--- gdb-6.3.orig/gdb/cp-abi.c	2003-11-26 17:04:00.000000000 -0500
  24.208 ++++ gdb-6.3/gdb/cp-abi.c	2004-11-10 12:30:07.000000000 -0500
  24.209 +@@ -1,5 +1,5 @@
  24.210 + /* Generic code for supporting multiple C++ ABI's
  24.211 +-   Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
  24.212 ++   Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  24.213 + 
  24.214 +    This file is part of GDB.
  24.215 + 
  24.216 +@@ -94,6 +94,14 @@ value_rtti_type (struct value *v, int *f
  24.217 +   return (*current_cp_abi.rtti_type) (v, full, top, using_enc);
  24.218 + }
  24.219 + 
  24.220 ++int
  24.221 ++cp_pass_by_reference (struct type *type)
  24.222 ++{
  24.223 ++  if ((current_cp_abi.pass_by_reference) == NULL)
  24.224 ++    return 0;
  24.225 ++  return (*current_cp_abi.pass_by_reference) (type);
  24.226 ++}
  24.227 ++
  24.228 + /* Set the current C++ ABI to SHORT_NAME.  */
  24.229 + 
  24.230 + static int
  24.231 +Index: gdb-6.3/gdb/gnu-v3-abi.c
  24.232 +===================================================================
  24.233 +--- gdb-6.3.orig/gdb/gnu-v3-abi.c	2004-03-15 15:38:08.000000000 -0500
  24.234 ++++ gdb-6.3/gdb/gnu-v3-abi.c	2004-11-10 12:30:07.000000000 -0500
  24.235 +@@ -1,7 +1,7 @@
  24.236 + /* Abstraction of GNU v3 abi.
  24.237 +    Contributed by Jim Blandy <jimb@redhat.com>
  24.238 + 
  24.239 +-   Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
  24.240 ++   Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  24.241 + 
  24.242 +    This file is part of GDB.
  24.243 + 
  24.244 +@@ -419,6 +419,84 @@ gnuv3_baseclass_offset (struct type *typ
  24.245 +   return base_offset;
  24.246 + }
  24.247 + 
  24.248 ++/* Return nonzero if a type should be passed by reference.
  24.249 ++
  24.250 ++   The rule in the v3 ABI document comes from section 3.1.1.  If the
  24.251 ++   type has a non-trivial copy constructor or destructor, then the
  24.252 ++   caller must make a copy (by calling the copy constructor if there
  24.253 ++   is one or perform the copy itself otherwise), pass the address of
  24.254 ++   the copy, and then destroy the temporary (if necessary).
  24.255 ++
  24.256 ++   For return values with non-trivial copy constructors or
  24.257 ++   destructors, space will be allocated in the caller, and a pointer
  24.258 ++   will be passed as the first argument (preceding "this").
  24.259 ++
  24.260 ++   We don't have a bulletproof mechanism for determining whether a
  24.261 ++   constructor or destructor is trivial.  For GCC and DWARF2 debug
  24.262 ++   information, we can check the artificial flag.
  24.263 ++
  24.264 ++   We don't do anything with the constructors or destructors yet,
  24.265 ++   but we have to get the argument passing right anyway.  */
  24.266 ++static int
  24.267 ++gnuv3_pass_by_reference (struct type *type)
  24.268 ++{
  24.269 ++  int fieldnum, fieldelem, basenum;
  24.270 ++
  24.271 ++  CHECK_TYPEDEF (type);
  24.272 ++
  24.273 ++  /* We're only interested in things that can have methods.  */
  24.274 ++  if (TYPE_CODE (type) != TYPE_CODE_STRUCT
  24.275 ++      && TYPE_CODE (type) != TYPE_CODE_CLASS
  24.276 ++      && TYPE_CODE (type) != TYPE_CODE_UNION)
  24.277 ++    return 0;
  24.278 ++
  24.279 ++  for (fieldnum = 0; fieldnum < TYPE_NFN_FIELDS (type); fieldnum++)
  24.280 ++    for (fieldelem = 0; fieldelem < TYPE_FN_FIELDLIST_LENGTH (type, fieldnum);
  24.281 ++	 fieldelem++)
  24.282 ++      {
  24.283 ++	struct fn_field *fn = TYPE_FN_FIELDLIST1 (type, fieldnum);
  24.284 ++	char *name = TYPE_FN_FIELDLIST_NAME (type, fieldnum);
  24.285 ++	struct type *fieldtype = TYPE_FN_FIELD_TYPE (fn, fieldelem);
  24.286 ++
  24.287 ++	/* If this function is marked as artificial, it is compiler-generated,
  24.288 ++	   and we assume it is trivial.  */
  24.289 ++	if (TYPE_FN_FIELD_ARTIFICIAL (fn, fieldelem))
  24.290 ++	  continue;
  24.291 ++
  24.292 ++	/* If we've found a destructor, we must pass this by reference.  */
  24.293 ++	if (name[0] == '~')
  24.294 ++	  return 1;
  24.295 ++
  24.296 ++	/* If the mangled name of this method doesn't indicate that it
  24.297 ++	   is a constructor, we're not interested.
  24.298 ++
  24.299 ++	   FIXME drow/2004-05-27: We could do this using the name of
  24.300 ++	   the method and the name of the class instead of dealing
  24.301 ++	   with the mangled name.  We don't have a convenient function
  24.302 ++	   to strip off both leading scope qualifiers and trailing
  24.303 ++	   template arguments yet.  */
  24.304 ++	if (!is_constructor_name (TYPE_FN_FIELD_PHYSNAME (fn, fieldelem)))
  24.305 ++	  continue;
  24.306 ++
  24.307 ++	/* If this method takes two arguments, and the second argument is
  24.308 ++	   a reference to this class, then it is a copy constructor.  */
  24.309 ++	if (TYPE_NFIELDS (fieldtype) == 2
  24.310 ++	    && TYPE_CODE (TYPE_FIELD_TYPE (fieldtype, 1)) == TYPE_CODE_REF
  24.311 ++	    && check_typedef (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (fieldtype, 1))) == type)
  24.312 ++	  return 1;
  24.313 ++      }
  24.314 ++
  24.315 ++  /* Even if all the constructors and destructors were artificial, one
  24.316 ++     of them may have invoked a non-artificial constructor or
  24.317 ++     destructor in a base class.  If any base class needs to be passed
  24.318 ++     by reference, so does this class.  */
  24.319 ++  for (basenum = 0; basenum < TYPE_N_BASECLASSES (type); basenum++)
  24.320 ++    if (gnuv3_pass_by_reference (TYPE_BASECLASS (type, basenum)))
  24.321 ++      return 1;
  24.322 ++
  24.323 ++  return 0;
  24.324 ++}
  24.325 ++
  24.326 + static void
  24.327 + init_gnuv3_ops (void)
  24.328 + {
  24.329 +@@ -434,6 +512,7 @@ init_gnuv3_ops (void)
  24.330 +   gnu_v3_abi_ops.rtti_type = gnuv3_rtti_type;
  24.331 +   gnu_v3_abi_ops.virtual_fn_field = gnuv3_virtual_fn_field;
  24.332 +   gnu_v3_abi_ops.baseclass_offset = gnuv3_baseclass_offset;
  24.333 ++  gnu_v3_abi_ops.pass_by_reference = gnuv3_pass_by_reference;
  24.334 + }
  24.335 + 
  24.336 + extern initialize_file_ftype _initialize_gnu_v3_abi; /* -Wmissing-prototypes */
  24.337 +Index: gdb-6.3/gdb/hpacc-abi.c
  24.338 +===================================================================
  24.339 +--- gdb-6.3.orig/gdb/hpacc-abi.c	2003-06-08 14:27:13.000000000 -0400
  24.340 ++++ gdb-6.3/gdb/hpacc-abi.c	2004-11-10 12:30:07.000000000 -0500
  24.341 +@@ -3,7 +3,7 @@
  24.342 +    Most of the real code is from HP, i've just fiddled it to fit in
  24.343 +    the C++ ABI abstraction framework.
  24.344 + 
  24.345 +-   Copyright 2001 Free Software Foundation, Inc.
  24.346 ++   Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
  24.347 + 
  24.348 +    This file is part of GDB.
  24.349 + 
  24.350 +Index: gdb-6.3/gdb/Makefile.in
  24.351 +===================================================================
  24.352 +--- gdb-6.3.orig/gdb/Makefile.in	2004-11-10 12:30:06.000000000 -0500
  24.353 ++++ gdb-6.3/gdb/Makefile.in	2004-11-10 12:30:07.000000000 -0500
  24.354 +@@ -2073,7 +2073,7 @@ ia64-tdep.o: ia64-tdep.c $(defs_h) $(inf
  24.355 + infcall.o: infcall.c $(defs_h) $(breakpoint_h) $(target_h) $(regcache_h) \
  24.356 + 	$(inferior_h) $(gdb_assert_h) $(block_h) $(gdbcore_h) $(language_h) \
  24.357 + 	$(objfiles_h) $(gdbcmd_h) $(command_h) $(gdb_string_h) $(infcall_h) \
  24.358 +-	$(dummy_frame_h)
  24.359 ++	$(dummy_frame_h) $(cp_abi_h)
  24.360 + inf-child.o: inf-child.c $(defs_h) $(regcache_h) $(memattr_h) $(symtab_h) \
  24.361 + 	$(target_h) $(inferior_h) $(gdb_string_h)
  24.362 + infcmd.o: infcmd.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
  24.363 +Index: gdb-6.3/gdb/testsuite/gdb.cp/pass-by-ref.exp
  24.364 +===================================================================
  24.365 +--- /dev/null	1970-01-01 00:00:00.000000000 +0000
  24.366 ++++ gdb-6.3/gdb/testsuite/gdb.cp/pass-by-ref.exp	2004-11-11 09:48:00.498518899 -0500
  24.367 +@@ -0,0 +1,38 @@
  24.368 ++# This testcase is part of GDB, the GNU debugger.
  24.369 ++
  24.370 ++# Copyright 2004 Free Software Foundation, Inc.
  24.371 ++
  24.372 ++# This program is free software; you can redistribute it and/or modify
  24.373 ++# it under the terms of the GNU General Public License as published by
  24.374 ++# the Free Software Foundation; either version 2 of the License, or
  24.375 ++# (at your option) any later version.
  24.376 ++#
  24.377 ++# This program is distributed in the hope that it will be useful,
  24.378 ++# but WITHOUT ANY WARRANTY; without even the implied warranty of
  24.379 ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.380 ++# GNU General Public License for more details.
  24.381 ++#
  24.382 ++# You should have received a copy of the GNU General Public License
  24.383 ++# along with this program; if not, write to the Free Software
  24.384 ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
  24.385 ++
  24.386 ++# Check that GDB can call C++ functions whose parameters have
  24.387 ++# object type, but are passed by reference.
  24.388 ++
  24.389 ++set testfile "pass-by-ref"
  24.390 ++set srcfile ${testfile}.cc
  24.391 ++set binfile ${objdir}/${subdir}/${testfile}
  24.392 ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
  24.393 ++    return -1
  24.394 ++}
  24.395 ++
  24.396 ++gdb_exit
  24.397 ++gdb_start
  24.398 ++gdb_reinitialize_dir $srcdir/$subdir
  24.399 ++gdb_load ${binfile}
  24.400 ++
  24.401 ++if ![runto_main] then {
  24.402 ++    return -1
  24.403 ++}
  24.404 ++
  24.405 ++gdb_test "print foo (global_obj)" " = 3" "call function"
  24.406 +Index: gdb-6.3/gdb/testsuite/gdb.cp/pass-by-ref.cc
  24.407 +===================================================================
  24.408 +--- /dev/null	1970-01-01 00:00:00.000000000 +0000
  24.409 ++++ gdb-6.3/gdb/testsuite/gdb.cp/pass-by-ref.cc	2004-11-11 09:44:17.815014667 -0500
  24.410 +@@ -0,0 +1,57 @@
  24.411 ++/* This testcase is part of GDB, the GNU debugger.
  24.412 ++
  24.413 ++   Copyright 2004 Free Software Foundation, Inc.
  24.414 ++
  24.415 ++   This program is free software; you can redistribute it and/or modify
  24.416 ++   it under the terms of the GNU General Public License as published by
  24.417 ++   the Free Software Foundation; either version 2 of the License, or
  24.418 ++   (at your option) any later version.
  24.419 ++
  24.420 ++   This program is distributed in the hope that it will be useful,
  24.421 ++   but WITHOUT ANY WARRANTY; without even the implied warranty of
  24.422 ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.423 ++   GNU General Public License for more details.
  24.424 ++ 
  24.425 ++   You should have received a copy of the GNU General Public License
  24.426 ++   along with this program; if not, write to the Free Software
  24.427 ++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  24.428 ++   USA.  */
  24.429 ++
  24.430 ++class Obj {
  24.431 ++public:
  24.432 ++  Obj ();
  24.433 ++  Obj (const Obj &);
  24.434 ++  ~Obj ();
  24.435 ++  int var[2];
  24.436 ++};
  24.437 ++
  24.438 ++int foo (Obj arg)
  24.439 ++{
  24.440 ++  return arg.var[0] + arg.var[1];
  24.441 ++}
  24.442 ++
  24.443 ++Obj::Obj ()
  24.444 ++{
  24.445 ++  var[0] = 1;
  24.446 ++  var[1] = 2;
  24.447 ++}
  24.448 ++
  24.449 ++Obj::Obj (const Obj &obj)
  24.450 ++{
  24.451 ++  var[0] = obj.var[0];
  24.452 ++  var[1] = obj.var[1];
  24.453 ++}
  24.454 ++
  24.455 ++Obj::~Obj ()
  24.456 ++{
  24.457 ++
  24.458 ++}
  24.459 ++
  24.460 ++Obj global_obj;
  24.461 ++
  24.462 ++int
  24.463 ++main ()
  24.464 ++{
  24.465 ++  int bar = foo (global_obj);
  24.466 ++  return bar;
  24.467 ++}
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/patches/gdb/6.3/710-debian_thread-db-multiple-libraries.patch	Thu May 17 16:22:51 2007 +0000
    25.3 @@ -0,0 +1,593 @@
    25.4 +Support loading two libthread_db DSOs.  In this case, the LinuxThreads
    25.5 +and NPTL ones.
    25.6 +
    25.7 +Index: gdb-6.3/gdb/thread-db.c
    25.8 +===================================================================
    25.9 +--- gdb-6.3.orig/gdb/thread-db.c	2004-11-10 10:46:24.000000000 -0500
   25.10 ++++ gdb-6.3/gdb/thread-db.c	2004-11-10 11:22:34.858812426 -0500
   25.11 +@@ -79,53 +79,63 @@ static td_thragent_t *thread_agent;
   25.12 + 
   25.13 + /* Pointers to the libthread_db functions.  */
   25.14 + 
   25.15 +-static td_err_e (*td_init_p) (void);
   25.16 ++struct thread_db_pointers
   25.17 ++{
   25.18 ++  const char *filename;
   25.19 ++
   25.20 ++  td_err_e (*td_init_p) (void);
   25.21 + 
   25.22 +-static td_err_e (*td_ta_new_p) (struct ps_prochandle * ps,
   25.23 +-				td_thragent_t **ta);
   25.24 +-static td_err_e (*td_ta_map_id2thr_p) (const td_thragent_t *ta, thread_t pt,
   25.25 +-				       td_thrhandle_t *__th);
   25.26 +-static td_err_e (*td_ta_map_lwp2thr_p) (const td_thragent_t *ta,
   25.27 +-					lwpid_t lwpid, td_thrhandle_t *th);
   25.28 +-static td_err_e (*td_ta_thr_iter_p) (const td_thragent_t *ta,
   25.29 +-				     td_thr_iter_f *callback, void *cbdata_p,
   25.30 +-				     td_thr_state_e state, int ti_pri,
   25.31 +-				     sigset_t *ti_sigmask_p,
   25.32 +-				     unsigned int ti_user_flags);
   25.33 +-static td_err_e (*td_ta_event_addr_p) (const td_thragent_t *ta,
   25.34 +-				       td_event_e event, td_notify_t *ptr);
   25.35 +-static td_err_e (*td_ta_set_event_p) (const td_thragent_t *ta,
   25.36 +-				      td_thr_events_t *event);
   25.37 +-static td_err_e (*td_ta_event_getmsg_p) (const td_thragent_t *ta,
   25.38 +-					 td_event_msg_t *msg);
   25.39 +-
   25.40 +-static td_err_e (*td_thr_validate_p) (const td_thrhandle_t *th);
   25.41 +-static td_err_e (*td_thr_get_info_p) (const td_thrhandle_t *th,
   25.42 +-				      td_thrinfo_t *infop);
   25.43 +-static td_err_e (*td_thr_getfpregs_p) (const td_thrhandle_t *th,
   25.44 +-				       gdb_prfpregset_t *regset);
   25.45 +-static td_err_e (*td_thr_getgregs_p) (const td_thrhandle_t *th,
   25.46 +-				      prgregset_t gregs);
   25.47 +-static td_err_e (*td_thr_setfpregs_p) (const td_thrhandle_t *th,
   25.48 +-				       const gdb_prfpregset_t *fpregs);
   25.49 +-static td_err_e (*td_thr_setgregs_p) (const td_thrhandle_t *th,
   25.50 +-				      prgregset_t gregs);
   25.51 +-static td_err_e (*td_thr_event_enable_p) (const td_thrhandle_t *th,
   25.52 +-					  int event);
   25.53 +-
   25.54 +-static td_err_e (*td_thr_tls_get_addr_p) (const td_thrhandle_t *th,
   25.55 +-					  void *map_address,
   25.56 +-					  size_t offset, void **address);
   25.57 ++  td_err_e (*td_ta_new_p) (struct ps_prochandle * ps,
   25.58 ++			   td_thragent_t **ta);
   25.59 ++  td_err_e (*td_ta_map_id2thr_p) (const td_thragent_t *ta, thread_t pt,
   25.60 ++				  td_thrhandle_t *__th);
   25.61 ++  td_err_e (*td_ta_map_lwp2thr_p) (const td_thragent_t *ta,
   25.62 ++				   lwpid_t lwpid, td_thrhandle_t *th);
   25.63 ++
   25.64 ++  td_err_e (*td_ta_thr_iter_p) (const td_thragent_t *ta,
   25.65 ++				td_thr_iter_f *callback, void *cbdata_p,
   25.66 ++				td_thr_state_e state, int ti_pri,
   25.67 ++				sigset_t *ti_sigmask_p,
   25.68 ++				unsigned int ti_user_flags);
   25.69 ++  td_err_e (*td_ta_event_addr_p) (const td_thragent_t *ta,
   25.70 ++				  td_event_e event, td_notify_t *ptr);
   25.71 ++  td_err_e (*td_ta_set_event_p) (const td_thragent_t *ta,
   25.72 ++				 td_thr_events_t *event);
   25.73 ++  td_err_e (*td_ta_event_getmsg_p) (const td_thragent_t *ta,
   25.74 ++				    td_event_msg_t *msg);
   25.75 ++
   25.76 ++  td_err_e (*td_thr_validate_p) (const td_thrhandle_t *th);
   25.77 ++  td_err_e (*td_thr_get_info_p) (const td_thrhandle_t *th,
   25.78 ++				 td_thrinfo_t *infop);
   25.79 ++  td_err_e (*td_thr_getfpregs_p) (const td_thrhandle_t *th,
   25.80 ++				  gdb_prfpregset_t *regset);
   25.81 ++  td_err_e (*td_thr_getgregs_p) (const td_thrhandle_t *th,
   25.82 ++				 prgregset_t gregs);
   25.83 ++  td_err_e (*td_thr_setfpregs_p) (const td_thrhandle_t *th,
   25.84 ++				  const gdb_prfpregset_t *fpregs);
   25.85 ++  td_err_e (*td_thr_setgregs_p) (const td_thrhandle_t *th,
   25.86 ++				 prgregset_t gregs);
   25.87 ++  td_err_e (*td_thr_event_enable_p) (const td_thrhandle_t *th,
   25.88 ++				     int event);
   25.89 ++
   25.90 ++  td_err_e (*td_thr_tls_get_addr_p) (const td_thrhandle_t *th,
   25.91 ++				     void *map_address,
   25.92 ++				     size_t offset, void **address);
   25.93 ++
   25.94 ++  struct thread_db_pointers *next;
   25.95 ++};
   25.96 + 
   25.97 + /* Location of the thread creation event breakpoint.  The code at this
   25.98 +    location in the child process will be called by the pthread library
   25.99 +    whenever a new thread is created.  By setting a special breakpoint
  25.100 +    at this location, GDB can detect when a new thread is created.  We
  25.101 +    obtain this location via the td_ta_event_addr call.  */
  25.102 +-static CORE_ADDR td_create_bp_addr;
  25.103 ++CORE_ADDR td_create_bp_addr;
  25.104 + 
  25.105 + /* Location of the thread death event breakpoint.  */
  25.106 +-static CORE_ADDR td_death_bp_addr;
  25.107 ++CORE_ADDR td_death_bp_addr;
  25.108 ++
  25.109 ++static struct thread_db_pointers *current_pointers, *all_pointers;
  25.110 + 
  25.111 + /* Prototypes for local functions.  */
  25.112 + static void thread_db_find_new_threads (void);
  25.113 +@@ -262,7 +272,7 @@ thread_get_info_callback (const td_thrha
  25.114 +   struct thread_info *thread_info;
  25.115 +   ptid_t thread_ptid;
  25.116 + 
  25.117 +-  err = td_thr_get_info_p (thp, &ti);
  25.118 ++  err = current_pointers->td_thr_get_info_p (thp, &ti);
  25.119 +   if (err != TD_OK)
  25.120 +     error ("thread_get_info_callback: cannot get thread info: %s",
  25.121 + 	   thread_db_err_str (err));
  25.122 +@@ -316,8 +326,9 @@ thread_db_map_id2thr (struct thread_info
  25.123 +   if (thread_info->private->th_valid)
  25.124 +     return;
  25.125 + 
  25.126 +-  err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (thread_info->ptid),
  25.127 +-			    &thread_info->private->th);
  25.128 ++  err = current_pointers->td_ta_map_id2thr_p (thread_agent,
  25.129 ++					      GET_THREAD (thread_info->ptid),
  25.130 ++					      &thread_info->private->th);
  25.131 +   if (err != TD_OK)
  25.132 +     {
  25.133 +       if (fatal)
  25.134 +@@ -340,8 +351,8 @@ thread_db_get_info (struct thread_info *
  25.135 +   if (!thread_info->private->th_valid)
  25.136 +     thread_db_map_id2thr (thread_info, 1);
  25.137 + 
  25.138 +-  err =
  25.139 +-    td_thr_get_info_p (&thread_info->private->th, &thread_info->private->ti);
  25.140 ++  err = current_pointers->td_thr_get_info_p (&thread_info->private->th,
  25.141 ++					     &thread_info->private->ti);
  25.142 +   if (err != TD_OK)
  25.143 +     error ("thread_db_get_info: cannot get thread info: %s",
  25.144 + 	   thread_db_err_str (err));
  25.145 +@@ -365,7 +376,8 @@ thread_from_lwp (ptid_t ptid)
  25.146 + 
  25.147 +   gdb_assert (is_lwp (ptid));
  25.148 + 
  25.149 +-  err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), &th);
  25.150 ++  err = current_pointers->td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid),
  25.151 ++					       &th);
  25.152 +   if (err != TD_OK)
  25.153 +     error ("Cannot find user-level thread for LWP %ld: %s",
  25.154 + 	   GET_LWP (ptid), thread_db_err_str (err));
  25.155 +@@ -420,85 +432,102 @@ verbose_dlsym (void *handle, const char 
  25.156 +   return sym;
  25.157 + }
  25.158 + 
  25.159 +-static int
  25.160 +-thread_db_load (void)
  25.161 ++static struct thread_db_pointers *
  25.162 ++thread_db_load (const char *name)
  25.163 + {
  25.164 ++  struct thread_db_pointers *ptrs;
  25.165 ++  Dl_info info;
  25.166 +   void *handle;
  25.167 +   td_err_e err;
  25.168 + 
  25.169 +-  handle = dlopen (LIBTHREAD_DB_SO, RTLD_NOW);
  25.170 ++  ptrs = xcalloc (1, sizeof (struct thread_db_pointers));
  25.171 ++
  25.172 ++  handle = dlopen (name, RTLD_NOW);
  25.173 +   if (handle == NULL)
  25.174 +     {
  25.175 +-      fprintf_filtered (gdb_stderr, "\n\ndlopen failed on '%s' - %s\n",
  25.176 +-			LIBTHREAD_DB_SO, dlerror ());
  25.177 +-      fprintf_filtered (gdb_stderr,
  25.178 +-			"GDB will not be able to debug pthreads.\n\n");
  25.179 ++      if (all_pointers == NULL)
  25.180 ++	{
  25.181 ++	  fprintf_filtered (gdb_stderr, "\n\ndlopen failed on '%s' - %s\n",
  25.182 ++			    name, dlerror ());
  25.183 ++	  fprintf_filtered (gdb_stderr,
  25.184 ++			    "GDB will not be able to debug pthreads.\n\n");
  25.185 ++	}
  25.186 +       return 0;
  25.187 +     }
  25.188 + 
  25.189 +   /* Initialize pointers to the dynamic library functions we will use.
  25.190 +      Essential functions first.  */
  25.191 + 
  25.192 +-  td_init_p = verbose_dlsym (handle, "td_init");
  25.193 +-  if (td_init_p == NULL)
  25.194 ++  ptrs->td_init_p = verbose_dlsym (handle, "td_init");
  25.195 ++  if (ptrs->td_init_p == NULL)
  25.196 +     return 0;
  25.197 + 
  25.198 +-  td_ta_new_p = verbose_dlsym (handle, "td_ta_new");
  25.199 +-  if (td_ta_new_p == NULL)
  25.200 ++  ptrs->td_ta_new_p = verbose_dlsym (handle, "td_ta_new");
  25.201 ++  if (ptrs->td_ta_new_p == NULL)
  25.202 +     return 0;
  25.203 + 
  25.204 +-  td_ta_map_id2thr_p = verbose_dlsym (handle, "td_ta_map_id2thr");
  25.205 +-  if (td_ta_map_id2thr_p == NULL)
  25.206 ++  ptrs->td_ta_map_id2thr_p = verbose_dlsym (handle, "td_ta_map_id2thr");
  25.207 ++  if (ptrs->td_ta_map_id2thr_p == NULL)
  25.208 +     return 0;
  25.209 + 
  25.210 +-  td_ta_map_lwp2thr_p = verbose_dlsym (handle, "td_ta_map_lwp2thr");
  25.211 +-  if (td_ta_map_lwp2thr_p == NULL)
  25.212 ++  ptrs->td_ta_map_lwp2thr_p = verbose_dlsym (handle, "td_ta_map_lwp2thr");
  25.213 ++  if (ptrs->td_ta_map_lwp2thr_p == NULL)
  25.214 +     return 0;
  25.215 + 
  25.216 +-  td_ta_thr_iter_p = verbose_dlsym (handle, "td_ta_thr_iter");
  25.217 +-  if (td_ta_thr_iter_p == NULL)
  25.218 ++  ptrs->td_ta_thr_iter_p = verbose_dlsym (handle, "td_ta_thr_iter");
  25.219 ++  if (ptrs->td_ta_thr_iter_p == NULL)
  25.220 +     return 0;
  25.221 + 
  25.222 +-  td_thr_validate_p = verbose_dlsym (handle, "td_thr_validate");
  25.223 +-  if (td_thr_validate_p == NULL)
  25.224 ++  ptrs->td_thr_validate_p = verbose_dlsym (handle, "td_thr_validate");
  25.225 ++  if (ptrs->td_thr_validate_p == NULL)
  25.226 +     return 0;
  25.227 + 
  25.228 +-  td_thr_get_info_p = verbose_dlsym (handle, "td_thr_get_info");
  25.229 +-  if (td_thr_get_info_p == NULL)
  25.230 ++  ptrs->td_thr_get_info_p = verbose_dlsym (handle, "td_thr_get_info");
  25.231 ++  if (ptrs->td_thr_get_info_p == NULL)
  25.232 +     return 0;
  25.233 + 
  25.234 +-  td_thr_getfpregs_p = verbose_dlsym (handle, "td_thr_getfpregs");
  25.235 +-  if (td_thr_getfpregs_p == NULL)
  25.236 ++  ptrs->td_thr_getfpregs_p = verbose_dlsym (handle, "td_thr_getfpregs");
  25.237 ++  if (ptrs->td_thr_getfpregs_p == NULL)
  25.238 +     return 0;
  25.239 + 
  25.240 +-  td_thr_getgregs_p = verbose_dlsym (handle, "td_thr_getgregs");
  25.241 +-  if (td_thr_getgregs_p == NULL)
  25.242 ++  ptrs->td_thr_getgregs_p = verbose_dlsym (handle, "td_thr_getgregs");
  25.243 ++  if (ptrs->td_thr_getgregs_p == NULL)
  25.244 +     return 0;
  25.245 + 
  25.246 +-  td_thr_setfpregs_p = verbose_dlsym (handle, "td_thr_setfpregs");
  25.247 +-  if (td_thr_setfpregs_p == NULL)
  25.248 ++  ptrs->td_thr_setfpregs_p = verbose_dlsym (handle, "td_thr_setfpregs");
  25.249 ++  if (ptrs->td_thr_setfpregs_p == NULL)
  25.250 +     return 0;
  25.251 + 
  25.252 +-  td_thr_setgregs_p = verbose_dlsym (handle, "td_thr_setgregs");
  25.253 +-  if (td_thr_setgregs_p == NULL)
  25.254 ++  ptrs->td_thr_setgregs_p = verbose_dlsym (handle, "td_thr_setgregs");
  25.255 ++  if (ptrs->td_thr_setgregs_p == NULL)
  25.256 +     return 0;
  25.257 + 
  25.258 +   /* Initialize the library.  */
  25.259 +-  err = td_init_p ();
  25.260 ++  err = ptrs->td_init_p ();
  25.261 +   if (err != TD_OK)
  25.262 +     {
  25.263 +       warning ("Cannot initialize libthread_db: %s", thread_db_err_str (err));
  25.264 ++      xfree (ptrs);
  25.265 +       return 0;
  25.266 +     }
  25.267 + 
  25.268 +   /* These are not essential.  */
  25.269 +-  td_ta_event_addr_p = dlsym (handle, "td_ta_event_addr");
  25.270 +-  td_ta_set_event_p = dlsym (handle, "td_ta_set_event");
  25.271 +-  td_ta_event_getmsg_p = dlsym (handle, "td_ta_event_getmsg");
  25.272 +-  td_thr_event_enable_p = dlsym (handle, "td_thr_event_enable");
  25.273 +-  td_thr_tls_get_addr_p = dlsym (handle, "td_thr_tls_get_addr");
  25.274 ++  ptrs->td_ta_event_addr_p = dlsym (handle, "td_ta_event_addr");
  25.275 ++  ptrs->td_ta_set_event_p = dlsym (handle, "td_ta_set_event");
  25.276 ++  ptrs->td_ta_event_getmsg_p = dlsym (handle, "td_ta_event_getmsg");
  25.277 ++  ptrs->td_thr_event_enable_p = dlsym (handle, "td_thr_event_enable");
  25.278 ++  ptrs->td_thr_tls_get_addr_p = dlsym (handle, "td_thr_tls_get_addr");
  25.279 ++
  25.280 ++  if (dladdr (ptrs->td_ta_new_p, &info) != 0)
  25.281 ++    ptrs->filename = info.dli_fname;
  25.282 ++
  25.283 ++  /* Try dlinfo?  */
  25.284 ++
  25.285 ++  if (ptrs->filename == NULL)
  25.286 ++    /* Paranoid - don't let a NULL path slip through.  */
  25.287 ++    ptrs->filename = name;
  25.288 + 
  25.289 +-  return 1;
  25.290 ++  return ptrs;
  25.291 + }
  25.292 + 
  25.293 + static td_err_e
  25.294 +@@ -508,7 +537,7 @@ enable_thread_event (td_thragent_t *thre
  25.295 +   td_err_e err;
  25.296 + 
  25.297 +   /* Get the breakpoint address for thread EVENT.  */
  25.298 +-  err = td_ta_event_addr_p (thread_agent, event, &notify);
  25.299 ++  err = current_pointers->td_ta_event_addr_p (thread_agent, event, &notify);
  25.300 +   if (err != TD_OK)
  25.301 +     return err;
  25.302 + 
  25.303 +@@ -534,8 +563,10 @@ enable_thread_event_reporting (void)
  25.304 + 
  25.305 +   /* We cannot use the thread event reporting facility if these
  25.306 +      functions aren't available.  */
  25.307 +-  if (td_ta_event_addr_p == NULL || td_ta_set_event_p == NULL
  25.308 +-      || td_ta_event_getmsg_p == NULL || td_thr_event_enable_p == NULL)
  25.309 ++  if (current_pointers->td_ta_event_addr_p == NULL
  25.310 ++      || current_pointers->td_ta_set_event_p == NULL
  25.311 ++      || current_pointers->td_ta_event_getmsg_p == NULL
  25.312 ++      || current_pointers->td_thr_event_enable_p == NULL)
  25.313 +     return;
  25.314 + 
  25.315 +   /* Set the process wide mask saying which events we're interested in.  */
  25.316 +@@ -552,7 +583,7 @@ enable_thread_event_reporting (void)
  25.317 + #endif
  25.318 +     td_event_addset (&events, TD_DEATH);
  25.319 + 
  25.320 +-  err = td_ta_set_event_p (thread_agent, &events);
  25.321 ++  err = current_pointers->td_ta_set_event_p (thread_agent, &events);
  25.322 +   if (err != TD_OK)
  25.323 +     {
  25.324 +       warning ("Unable to set global thread event mask: %s",
  25.325 +@@ -592,7 +623,7 @@ disable_thread_event_reporting (void)
  25.326 +   /* Set the process wide mask saying we aren't interested in any
  25.327 +      events anymore.  */
  25.328 +   td_event_emptyset (&events);
  25.329 +-  td_ta_set_event_p (thread_agent, &events);
  25.330 ++  current_pointers->td_ta_set_event_p (thread_agent, &events);
  25.331 + 
  25.332 +   /* Delete thread event breakpoints, if any.  */
  25.333 +   remove_thread_event_breakpoints ();
  25.334 +@@ -635,7 +666,6 @@ check_thread_signals (void)
  25.335 + static void
  25.336 + check_for_thread_db (void)
  25.337 + {
  25.338 +-  td_err_e err;
  25.339 +   static int already_loaded;
  25.340 + 
  25.341 +   /* First time through, report that libthread_db was successfuly
  25.342 +@@ -644,19 +674,8 @@ check_for_thread_db (void)
  25.343 + 
  25.344 +   if (!already_loaded)
  25.345 +     {
  25.346 +-      Dl_info info;
  25.347 +-      const char *library = NULL;
  25.348 +-      if (dladdr ((*td_ta_new_p), &info) != 0)
  25.349 +-	library = info.dli_fname;
  25.350 +-
  25.351 +-      /* Try dlinfo?  */
  25.352 +-
  25.353 +-      if (library == NULL)
  25.354 +-	/* Paranoid - don't let a NULL path slip through.  */
  25.355 +-	library = LIBTHREAD_DB_SO;
  25.356 +-
  25.357 +       printf_unfiltered ("Using host libthread_db library \"%s\".\n",
  25.358 +-			 library);
  25.359 ++			 all_pointers->filename);
  25.360 +       already_loaded = 1;
  25.361 +     }
  25.362 + 
  25.363 +@@ -674,28 +693,34 @@ check_for_thread_db (void)
  25.364 +   proc_handle.pid = GET_PID (inferior_ptid);
  25.365 + 
  25.366 +   /* Now attempt to open a connection to the thread library.  */
  25.367 +-  err = td_ta_new_p (&proc_handle, &thread_agent);
  25.368 +-  switch (err)
  25.369 ++  for (current_pointers = all_pointers;
  25.370 ++       current_pointers != NULL;
  25.371 ++       current_pointers = current_pointers->next)
  25.372 +     {
  25.373 +-    case TD_NOLIBTHREAD:
  25.374 +-      /* No thread library was detected.  */
  25.375 +-      break;
  25.376 +-
  25.377 +-    case TD_OK:
  25.378 +-      printf_unfiltered ("[Thread debugging using libthread_db enabled]\n");
  25.379 ++      td_err_e err;
  25.380 ++      err = current_pointers->td_ta_new_p (&proc_handle, &thread_agent);
  25.381 ++      switch (err)
  25.382 ++	{
  25.383 ++	case TD_NOLIBTHREAD:
  25.384 ++	  /* No thread library was detected.  */
  25.385 ++	  break;
  25.386 + 
  25.387 +-      /* The thread library was detected.  Activate the thread_db target.  */
  25.388 +-      push_target (&thread_db_ops);
  25.389 +-      using_thread_db = 1;
  25.390 ++	case TD_OK:
  25.391 ++	  printf_unfiltered ("[Thread debugging using libthread_db enabled]\n");
  25.392 + 
  25.393 +-      enable_thread_event_reporting ();
  25.394 +-      thread_db_find_new_threads ();
  25.395 +-      break;
  25.396 ++	  /* The thread library was detected.  Activate the thread_db target.  */
  25.397 ++	  push_target (&thread_db_ops);
  25.398 ++	  using_thread_db = 1;
  25.399 ++
  25.400 ++	  enable_thread_event_reporting ();
  25.401 ++	  thread_db_find_new_threads ();
  25.402 ++	  return;
  25.403 + 
  25.404 +-    default:
  25.405 +-      warning ("Cannot initialize thread debugging library: %s",
  25.406 +-	       thread_db_err_str (err));
  25.407 +-      break;
  25.408 ++	default:
  25.409 ++	  warning ("Cannot initialize thread debugging library: %s",
  25.410 ++		   thread_db_err_str (err));
  25.411 ++	  break;
  25.412 ++	}
  25.413 +     }
  25.414 + }
  25.415 + 
  25.416 +@@ -766,7 +791,7 @@ attach_thread (ptid_t ptid, const td_thr
  25.417 + #endif
  25.418 + 
  25.419 +   /* Enable thread event reporting for this thread.  */
  25.420 +-  err = td_thr_event_enable_p (th_p, 1);
  25.421 ++  err = current_pointers->td_thr_event_enable_p (th_p, 1);
  25.422 +   if (err != TD_OK)
  25.423 +     error ("Cannot enable thread event reporting for %s: %s",
  25.424 + 	   target_pid_to_str (ptid), thread_db_err_str (err));
  25.425 +@@ -892,7 +917,7 @@ check_event (ptid_t ptid)
  25.426 + 
  25.427 +   do
  25.428 +     {
  25.429 +-      err = td_ta_event_getmsg_p (thread_agent, &msg);
  25.430 ++      err = current_pointers->td_ta_event_getmsg_p (thread_agent, &msg);
  25.431 +       if (err != TD_OK)
  25.432 + 	{
  25.433 + 	  if (err == TD_NOMSG)
  25.434 +@@ -902,7 +927,7 @@ check_event (ptid_t ptid)
  25.435 + 		 thread_db_err_str (err));
  25.436 + 	}
  25.437 + 
  25.438 +-      err = td_thr_get_info_p (msg.th_p, &ti);
  25.439 ++      err = current_pointers->td_thr_get_info_p (msg.th_p, &ti);
  25.440 +       if (err != TD_OK)
  25.441 + 	error ("Cannot get thread info: %s", thread_db_err_str (err));
  25.442 + 
  25.443 +@@ -1015,12 +1040,14 @@ thread_db_fetch_registers (int regno)
  25.444 +   thread_info = find_thread_pid (inferior_ptid);
  25.445 +   thread_db_map_id2thr (thread_info, 1);
  25.446 + 
  25.447 +-  err = td_thr_getgregs_p (&thread_info->private->th, gregset);
  25.448 ++  err = current_pointers->td_thr_getgregs_p (&thread_info->private->th,
  25.449 ++					     gregset);
  25.450 +   if (err != TD_OK)
  25.451 +     error ("Cannot fetch general-purpose registers for thread %ld: %s",
  25.452 + 	   (long) GET_THREAD (inferior_ptid), thread_db_err_str (err));
  25.453 + 
  25.454 +-  err = td_thr_getfpregs_p (&thread_info->private->th, &fpregset);
  25.455 ++  err = current_pointers->td_thr_getfpregs_p (&thread_info->private->th,
  25.456 ++					      &fpregset);
  25.457 +   if (err != TD_OK)
  25.458 +     error ("Cannot get floating-point registers for thread %ld: %s",
  25.459 + 	   (long) GET_THREAD (inferior_ptid), thread_db_err_str (err));
  25.460 +@@ -1062,11 +1089,13 @@ thread_db_store_registers (int regno)
  25.461 +   fill_gregset ((gdb_gregset_t *) gregset, -1);
  25.462 +   fill_fpregset (&fpregset, -1);
  25.463 + 
  25.464 +-  err = td_thr_setgregs_p (&thread_info->private->th, gregset);
  25.465 ++  err = current_pointers->td_thr_setgregs_p (&thread_info->private->th,
  25.466 ++					     gregset);
  25.467 +   if (err != TD_OK)
  25.468 +     error ("Cannot store general-purpose registers for thread %ld: %s",
  25.469 + 	   (long) GET_THREAD (inferior_ptid), thread_db_err_str (err));
  25.470 +-  err = td_thr_setfpregs_p (&thread_info->private->th, &fpregset);
  25.471 ++  err = current_pointers->td_thr_setfpregs_p (&thread_info->private->th,
  25.472 ++					      &fpregset);
  25.473 +   if (err != TD_OK)
  25.474 +     error ("Cannot store floating-point registers  for thread %ld: %s",
  25.475 + 	   (long) GET_THREAD (inferior_ptid), thread_db_err_str (err));
  25.476 +@@ -1136,15 +1165,14 @@ thread_db_thread_alive (ptid_t ptid)
  25.477 +       if (!thread_info->private->th_valid)
  25.478 + 	return 0;
  25.479 + 
  25.480 +-      err = td_thr_validate_p (&thread_info->private->th);
  25.481 ++      err = current_pointers->td_thr_validate_p (&thread_info->private->th);
  25.482 +       if (err != TD_OK)
  25.483 + 	return 0;
  25.484 + 
  25.485 +       if (!thread_info->private->ti_valid)
  25.486 + 	{
  25.487 +-	  err =
  25.488 +-	    td_thr_get_info_p (&thread_info->private->th,
  25.489 +-			       &thread_info->private->ti);
  25.490 ++	  err = current_pointers->td_thr_get_info_p
  25.491 ++	    (&thread_info->private->th, &thread_info->private->ti);
  25.492 + 	  if (err != TD_OK)
  25.493 + 	    return 0;
  25.494 + 	  thread_info->private->ti_valid = 1;
  25.495 +@@ -1170,7 +1198,7 @@ find_new_threads_callback (const td_thrh
  25.496 +   td_err_e err;
  25.497 +   ptid_t ptid;
  25.498 + 
  25.499 +-  err = td_thr_get_info_p (th_p, &ti);
  25.500 ++  err = current_pointers->td_thr_get_info_p (th_p, &ti);
  25.501 +   if (err != TD_OK)
  25.502 +     error ("find_new_threads_callback: cannot get thread info: %s",
  25.503 + 	   thread_db_err_str (err));
  25.504 +@@ -1192,9 +1220,10 @@ thread_db_find_new_threads (void)
  25.505 +   td_err_e err;
  25.506 + 
  25.507 +   /* Iterate over all user-space threads to discover new threads.  */
  25.508 +-  err = td_ta_thr_iter_p (thread_agent, find_new_threads_callback, NULL,
  25.509 +-			  TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
  25.510 +-			  TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
  25.511 ++  err = current_pointers->td_ta_thr_iter_p
  25.512 ++    (thread_agent, find_new_threads_callback, NULL,
  25.513 ++     TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
  25.514 ++     TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
  25.515 +   if (err != TD_OK)
  25.516 +     error ("Cannot find new threads: %s", thread_db_err_str (err));
  25.517 + }
  25.518 +@@ -1257,7 +1286,7 @@ thread_db_get_thread_local_address (ptid
  25.519 +       struct thread_info *thread_info;
  25.520 + 
  25.521 +       /* glibc doesn't provide the needed interface.  */
  25.522 +-      if (!td_thr_tls_get_addr_p)
  25.523 ++      if (!current_pointers->td_thr_tls_get_addr_p)
  25.524 + 	error ("Cannot find thread-local variables in this thread library.");
  25.525 + 
  25.526 +       /* Get the address of the link map for this objfile.  */
  25.527 +@@ -1279,8 +1308,8 @@ thread_db_get_thread_local_address (ptid
  25.528 +       thread_db_map_id2thr (thread_info, 1);
  25.529 + 
  25.530 +       /* Finally, get the address of the variable.  */
  25.531 +-      err = td_thr_tls_get_addr_p (&thread_info->private->th, (void *) lm,
  25.532 +-				   offset, &address);
  25.533 ++      err = current_pointers->td_thr_tls_get_addr_p
  25.534 ++	(&thread_info->private->th, (void *) lm, offset, &address);
  25.535 + 
  25.536 + #ifdef THREAD_DB_HAS_TD_NOTALLOC
  25.537 +       /* The memory hasn't been allocated, yet.  */
  25.538 +@@ -1360,17 +1389,49 @@ init_thread_db_ops (void)
  25.539 + void
  25.540 + _initialize_thread_db (void)
  25.541 + {
  25.542 ++  struct thread_db_pointers *ptrs;
  25.543 ++  const char *p;
  25.544 ++
  25.545 +   /* Only initialize the module if we can load libthread_db.  */
  25.546 +-  if (thread_db_load ())
  25.547 +-    {
  25.548 +-      init_thread_db_ops ();
  25.549 +-      add_target (&thread_db_ops);
  25.550 ++  ptrs = thread_db_load (LIBTHREAD_DB_SO);
  25.551 ++  if (ptrs == NULL)
  25.552 ++    return;
  25.553 ++
  25.554 ++  all_pointers = ptrs;
  25.555 + 
  25.556 +-      /* Add ourselves to objfile event chain.  */
  25.557 +-      target_new_objfile_chain = deprecated_target_new_objfile_hook;
  25.558 +-      deprecated_target_new_objfile_hook = thread_db_new_objfile;
  25.559 ++  /* Some GNU/Linux systems have more than one binary-compatible copy
  25.560 ++     of libthread_db.  If we can find a second one, load that too.
  25.561 ++     The inferior may force the use of a different threading package
  25.562 ++     than we expect.  Our guess for the location is somewhat hokey:
  25.563 ++     strip out anything between /lib (or /lib64) and LIBTHREAD_DB_SO.
  25.564 ++     If we loaded the NPTL libthread_db by default, this may find us
  25.565 ++     the LinuxThreads copy.  */
  25.566 ++  p = strrchr (ptrs->filename, '/');
  25.567 ++  while (p != NULL && p > ptrs->filename)
  25.568 ++    {
  25.569 ++      const char *component;
  25.570 + 
  25.571 +-      /* Register ourselves for the new inferior observer.  */
  25.572 +-      observer_attach_inferior_created (check_for_thread_db_observer);
  25.573 ++      component = memrchr (ptrs->filename, '/', p - ptrs->filename);
  25.574 ++      if (component != NULL && strncmp (component, "/lib", 4) == 0)
  25.575 ++	{
  25.576 ++	  char *new_name = xmalloc (p - ptrs->filename + 2
  25.577 ++				    + strlen (LIBTHREAD_DB_SO));
  25.578 ++	  memcpy (new_name, ptrs->filename, p - ptrs->filename + 1);
  25.579 ++	  strcpy (new_name + (p - ptrs->filename) + 1, LIBTHREAD_DB_SO);
  25.580 ++	  ptrs->next = thread_db_load (new_name);
  25.581 ++	  xfree (new_name);
  25.582 ++	  break;
  25.583 ++	}
  25.584 ++      p = component;
  25.585 +     }
  25.586 ++
  25.587 ++  init_thread_db_ops ();
  25.588 ++  add_target (&thread_db_ops);
  25.589 ++
  25.590 ++  /* Add ourselves to objfile event chain.  */
  25.591 ++  target_new_objfile_chain = deprecated_target_new_objfile_hook;
  25.592 ++  deprecated_target_new_objfile_hook = thread_db_new_objfile;
  25.593 ++
  25.594 ++  /* Register ourselves for the new inferior observer.  */
  25.595 ++  observer_attach_inferior_created (check_for_thread_db_observer);
  25.596 + }
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/patches/gdb/6.3/720-debian_static-threads-test.patch	Thu May 17 16:22:51 2007 +0000
    26.3 @@ -0,0 +1,36 @@
    26.4 +Update staticthreads.exp to handle debugging info in libpthread.a.
    26.5 +
    26.6 +Index: gdb-6.3/gdb/testsuite/gdb.threads/staticthreads.exp
    26.7 +===================================================================
    26.8 +--- gdb-6.3.orig/gdb/testsuite/gdb.threads/staticthreads.exp	2004-11-10 10:35:15.000000000 -0500
    26.9 ++++ gdb-6.3/gdb/testsuite/gdb.threads/staticthreads.exp	2004-11-10 11:22:48.671121466 -0500
   26.10 +@@ -53,6 +53,10 @@ gdb_test_multiple "continue" "$test" {
   26.11 +     -re " sem_post .*$gdb_prompt " {
   26.12 + 	pass "$test"
   26.13 +     }
   26.14 ++    -re " (.*_)sem_post .*$gdb_prompt " {
   26.15 ++	# Glibc uses aliases for internal symbols; match __new_sem_post.
   26.16 ++	pass "$test"
   26.17 ++    }
   26.18 +     -re "Program received signal .*$gdb_prompt " {
   26.19 + 	kfail gdb/1328 "$test"
   26.20 +     }
   26.21 +@@ -64,8 +68,16 @@ gdb_test_multiple "continue" "$test" {
   26.22 + 
   26.23 + rerun_to_main
   26.24 + gdb_test "handle SIG32 nostop noprint pass"
   26.25 +-set test "Handle SIG32 helps"
   26.26 +-gdb_test "continue" " sem_post .*" "handle SIG32 helps"
   26.27 ++set test "handle SIG32 helps"
   26.28 ++gdb_test_multiple "continue" "$test" {
   26.29 ++    -re " sem_post .*$gdb_prompt $" {
   26.30 ++	pass "$test"
   26.31 ++    }
   26.32 ++    -re " (.*_)sem_post .*$gdb_prompt $" {
   26.33 ++	# Glibc uses aliases for internal symbols; match __new_sem_post.
   26.34 ++	pass "$test"
   26.35 ++    }
   26.36 ++}
   26.37 + 
   26.38 + 
   26.39 + # See if info threads produces anything approaching a thread list.
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/patches/gdb/6.3/730-debian_gdb-fix-tracefork-check.patch	Thu May 17 16:22:51 2007 +0000
    27.3 @@ -0,0 +1,225 @@
    27.4 +Status: submitted for comments
    27.5 +
    27.6 +2004-11-12  Daniel Jacobowitz  <dan@debian.org>
    27.7 +
    27.8 +	* linux-nat.c (my_waitpid): New function.
    27.9 +	(linux_test_for_tracefork): Make more robust and verbose.  Take
   27.10 +	an ORIGINAL_PID argument and test for PTRACE_SETOPTIONS first.
   27.11 +	(linux_supports_tracefork, linux_supports_tracevforkdone): Take a PID
   27.12 +	argument.  Update calls to linux_test_for_tracefork.
   27.13 +	(linux_enable_event_reporting, child_follow_fork)
   27.14 +	(child_insert_fork_catchpoint, child_insert_vfork_catchpoint)
   27.15 +	(child_insert_exec_catchpoint): Update calls to
   27.16 +	linux_supports_tracefork and linux_supports_tracevforkdone.
   27.17 +
   27.18 +Index: gdb-6.3/gdb/linux-nat.c
   27.19 +===================================================================
   27.20 +--- gdb-6.3.orig/gdb/linux-nat.c	2004-10-08 16:29:47.000000000 -0400
   27.21 ++++ gdb-6.3/gdb/linux-nat.c	2004-11-13 16:41:51.368720845 -0500
   27.22 +@@ -150,18 +150,47 @@ linux_tracefork_child (void)
   27.23 +   exit (0);
   27.24 + }
   27.25 + 
   27.26 +-/* Determine if PTRACE_O_TRACEFORK can be used to follow fork events.  We
   27.27 ++/* Wrapper function for waitpid which handles EINTR.  */
   27.28 ++
   27.29 ++static int
   27.30 ++my_waitpid (int pid, int *status, int flags)
   27.31 ++{
   27.32 ++  int ret;
   27.33 ++  do
   27.34 ++    {
   27.35 ++      ret = waitpid (pid, status, flags);
   27.36 ++    }
   27.37 ++  while (ret == -1 && errno == EINTR);
   27.38 ++
   27.39 ++  return ret;
   27.40 ++}
   27.41 ++
   27.42 ++/* Determine if PTRACE_O_TRACEFORK can be used to follow fork events.
   27.43 ++
   27.44 ++   First, we try to enable fork tracing on ORIGINAL_PID.  If this fails,
   27.45 ++   we know that the feature is not available.  This may change the tracing
   27.46 ++   options for ORIGINAL_PID, but we'll be setting them shortly anyway.
   27.47 ++
   27.48 ++   However, if it succeeds, we don't know for sure that the feature is
   27.49 ++   available; old versions of PTRACE_SETOPTIONS ignored unknown options.  We
   27.50 +    create a child process, attach to it, use PTRACE_SETOPTIONS to enable
   27.51 +-   fork tracing, and let it fork.  If the process exits, we assume that
   27.52 +-   we can't use TRACEFORK; if we get the fork notification, and we can
   27.53 +-   extract the new child's PID, then we assume that we can.  */
   27.54 ++   fork tracing, and let it fork.  If the process exits, we assume that we
   27.55 ++   can't use TRACEFORK; if we get the fork notification, and we can extract
   27.56 ++   the new child's PID, then we assume that we can.  */
   27.57 + 
   27.58 + static void
   27.59 +-linux_test_for_tracefork (void)
   27.60 ++linux_test_for_tracefork (int original_pid)
   27.61 + {
   27.62 +   int child_pid, ret, status;
   27.63 +   long second_pid;
   27.64 + 
   27.65 ++  linux_supports_tracefork_flag = 0;
   27.66 ++  linux_supports_tracevforkdone_flag = 0;
   27.67 ++
   27.68 ++  ret = ptrace (PTRACE_SETOPTIONS, original_pid, 0, PTRACE_O_TRACEFORK);
   27.69 ++  if (ret != 0)
   27.70 ++    return;
   27.71 ++
   27.72 +   child_pid = fork ();
   27.73 +   if (child_pid == -1)
   27.74 +     perror_with_name ("linux_test_for_tracefork: fork");
   27.75 +@@ -169,7 +198,7 @@ linux_test_for_tracefork (void)
   27.76 +   if (child_pid == 0)
   27.77 +     linux_tracefork_child ();
   27.78 + 
   27.79 +-  ret = waitpid (child_pid, &status, 0);
   27.80 ++  ret = my_waitpid (child_pid, &status, 0);
   27.81 +   if (ret == -1)
   27.82 +     perror_with_name ("linux_test_for_tracefork: waitpid");
   27.83 +   else if (ret != child_pid)
   27.84 +@@ -177,13 +206,23 @@ linux_test_for_tracefork (void)
   27.85 +   if (! WIFSTOPPED (status))
   27.86 +     error ("linux_test_for_tracefork: waitpid: unexpected status %d.", status);
   27.87 + 
   27.88 +-  linux_supports_tracefork_flag = 0;
   27.89 +-
   27.90 +   ret = ptrace (PTRACE_SETOPTIONS, child_pid, 0, PTRACE_O_TRACEFORK);
   27.91 +   if (ret != 0)
   27.92 +     {
   27.93 +-      ptrace (PTRACE_KILL, child_pid, 0, 0);
   27.94 +-      waitpid (child_pid, &status, 0);
   27.95 ++      ret = ptrace (PTRACE_KILL, child_pid, 0, 0);
   27.96 ++      if (ret != 0)
   27.97 ++	{
   27.98 ++	  warning ("linux_test_for_tracefork: failed to kill child");
   27.99 ++	  return;
  27.100 ++	}
  27.101 ++
  27.102 ++      ret = my_waitpid (child_pid, &status, 0);
  27.103 ++      if (ret != child_pid)
  27.104 ++	warning ("linux_test_for_tracefork: failed to wait for killed child");
  27.105 ++      else if (!WIFSIGNALED (status))
  27.106 ++	warning ("linux_test_for_tracefork: unexpected wait status 0x%x from "
  27.107 ++		 "killed child", status);
  27.108 ++
  27.109 +       return;
  27.110 +     }
  27.111 + 
  27.112 +@@ -192,8 +231,12 @@ linux_test_for_tracefork (void)
  27.113 + 		PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORKDONE);
  27.114 +   linux_supports_tracevforkdone_flag = (ret == 0);
  27.115 + 
  27.116 +-  ptrace (PTRACE_CONT, child_pid, 0, 0);
  27.117 +-  ret = waitpid (child_pid, &status, 0);
  27.118 ++  ret = ptrace (PTRACE_CONT, child_pid, 0, 0);
  27.119 ++  if (ret != 0)
  27.120 ++    warning ("linux_test_for_tracefork: failed to resume child");
  27.121 ++
  27.122 ++  ret = my_waitpid (child_pid, &status, 0);
  27.123 ++
  27.124 +   if (ret == child_pid && WIFSTOPPED (status)
  27.125 +       && status >> 16 == PTRACE_EVENT_FORK)
  27.126 +     {
  27.127 +@@ -204,34 +247,38 @@ linux_test_for_tracefork (void)
  27.128 + 	  int second_status;
  27.129 + 
  27.130 + 	  linux_supports_tracefork_flag = 1;
  27.131 +-	  waitpid (second_pid, &second_status, 0);
  27.132 +-	  ptrace (PTRACE_DETACH, second_pid, 0, 0);
  27.133 ++	  my_waitpid (second_pid, &second_status, 0);
  27.134 ++	  ret = ptrace (PTRACE_KILL, second_pid, 0, 0);
  27.135 ++	  if (ret != 0)
  27.136 ++	    warning ("linux_test_for_tracefork: failed to kill second child");
  27.137 + 	}
  27.138 +     }
  27.139 ++  else
  27.140 ++    warning ("linux_test_for_tracefork: unexpected result from waitpid "
  27.141 ++	     "(%d, status 0x%x)", ret, status);
  27.142 + 
  27.143 +-  if (WIFSTOPPED (status))
  27.144 +-    {
  27.145 +-      ptrace (PTRACE_DETACH, child_pid, 0, 0);
  27.146 +-      waitpid (child_pid, &status, 0);
  27.147 +-    }
  27.148 ++  ret = ptrace (PTRACE_KILL, child_pid, 0, 0);
  27.149 ++  if (ret != 0)
  27.150 ++    warning ("linux_test_for_tracefork: failed to kill child");
  27.151 ++  my_waitpid (child_pid, &status, 0);
  27.152 + }
  27.153 + 
  27.154 + /* Return non-zero iff we have tracefork functionality available.
  27.155 +    This function also sets linux_supports_tracefork_flag.  */
  27.156 + 
  27.157 + static int
  27.158 +-linux_supports_tracefork (void)
  27.159 ++linux_supports_tracefork (int pid)
  27.160 + {
  27.161 +   if (linux_supports_tracefork_flag == -1)
  27.162 +-    linux_test_for_tracefork ();
  27.163 ++    linux_test_for_tracefork (pid);
  27.164 +   return linux_supports_tracefork_flag;
  27.165 + }
  27.166 + 
  27.167 + static int
  27.168 +-linux_supports_tracevforkdone (void)
  27.169 ++linux_supports_tracevforkdone (int pid)
  27.170 + {
  27.171 +   if (linux_supports_tracefork_flag == -1)
  27.172 +-    linux_test_for_tracefork ();
  27.173 ++    linux_test_for_tracefork (pid);
  27.174 +   return linux_supports_tracevforkdone_flag;
  27.175 + }
  27.176 + 
  27.177 +@@ -242,12 +289,12 @@ linux_enable_event_reporting (ptid_t pti
  27.178 +   int pid = ptid_get_pid (ptid);
  27.179 +   int options;
  27.180 + 
  27.181 +-  if (! linux_supports_tracefork ())
  27.182 ++  if (! linux_supports_tracefork (pid))
  27.183 +     return;
  27.184 + 
  27.185 +   options = PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK | PTRACE_O_TRACEEXEC
  27.186 +     | PTRACE_O_TRACECLONE;
  27.187 +-  if (linux_supports_tracevforkdone ())
  27.188 ++  if (linux_supports_tracevforkdone (pid))
  27.189 +     options |= PTRACE_O_TRACEVFORKDONE;
  27.190 + 
  27.191 +   /* Do not enable PTRACE_O_TRACEEXIT until GDB is more prepared to support
  27.192 +@@ -308,7 +355,8 @@ child_follow_fork (int follow_child)
  27.193 + 
  27.194 +       if (has_vforked)
  27.195 + 	{
  27.196 +-	  if (linux_supports_tracevforkdone ())
  27.197 ++	  gdb_assert (linux_supports_tracefork_flag >= 0);
  27.198 ++	  if (linux_supports_tracevforkdone (0))
  27.199 + 	    {
  27.200 + 	      int status;
  27.201 + 
  27.202 +@@ -476,7 +524,7 @@ linux_handle_extended_wait (int pid, int
  27.203 + int
  27.204 + child_insert_fork_catchpoint (int pid)
  27.205 + {
  27.206 +-  if (! linux_supports_tracefork ())
  27.207 ++  if (! linux_supports_tracefork (pid))
  27.208 +     error ("Your system does not support fork catchpoints.");
  27.209 + 
  27.210 +   return 0;
  27.211 +@@ -485,7 +533,7 @@ child_insert_fork_catchpoint (int pid)
  27.212 + int
  27.213 + child_insert_vfork_catchpoint (int pid)
  27.214 + {
  27.215 +-  if (!linux_supports_tracefork ())
  27.216 ++  if (!linux_supports_tracefork (pid))
  27.217 +     error ("Your system does not support vfork catchpoints.");
  27.218 + 
  27.219 +   return 0;
  27.220 +@@ -494,7 +542,7 @@ child_insert_vfork_catchpoint (int pid)
  27.221 + int
  27.222 + child_insert_exec_catchpoint (int pid)
  27.223 + {
  27.224 +-  if (!linux_supports_tracefork ())
  27.225 ++  if (!linux_supports_tracefork (pid))
  27.226 +     error ("Your system does not support exec catchpoints.");
  27.227 + 
  27.228 +   return 0;
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/patches/gdb/6.3/740-debian_make-cv-type-crash.patch	Thu May 17 16:22:51 2007 +0000
    28.3 @@ -0,0 +1,132 @@
    28.4 +2004-11-04  Jim Blandy  <jimb@redhat.com>
    28.5 +
    28.6 +	* gdbtypes.c (make_qualified_type): Doc fix.  Add assertion to
    28.7 +	prevent cross-objfile references.
    28.8 +	(make_cv_type): Doc fix.  Don't create cross-objfile references,
    28.9 +	even for stub types.
   28.10 +	(replace_type): Add assertion to prevent cross-objfile references.
   28.11 +	(check_typedef): Never resolve a stub type by copying over a type
   28.12 +	from another file.
   28.13 +
   28.14 +Index: src/gdb/gdbtypes.c
   28.15 +===================================================================
   28.16 +RCS file: /big/fsf/rsync/src-cvs/src/gdb/gdbtypes.c,v
   28.17 +retrieving revision 1.92
   28.18 +retrieving revision 1.93
   28.19 +diff -u -p -r1.92 -r1.93
   28.20 +--- src/gdb/gdbtypes.c	8 Aug 2004 17:18:16 -0000	1.92
   28.21 ++++ src/gdb/gdbtypes.c	4 Nov 2004 17:50:16 -0000	1.93
   28.22 +@@ -433,7 +433,9 @@ address_space_int_to_name (int space_fla
   28.23 + }
   28.24 + 
   28.25 + /* Create a new type with instance flags NEW_FLAGS, based on TYPE.
   28.26 +-   If STORAGE is non-NULL, create the new type instance there.  */
   28.27 ++
   28.28 ++   If STORAGE is non-NULL, create the new type instance there.
   28.29 ++   STORAGE must be in the same obstack as TYPE.  */
   28.30 + 
   28.31 + static struct type *
   28.32 + make_qualified_type (struct type *type, int new_flags,
   28.33 +@@ -453,6 +455,12 @@ make_qualified_type (struct type *type, 
   28.34 +     ntype = alloc_type_instance (type);
   28.35 +   else
   28.36 +     {
   28.37 ++      /* If STORAGE was provided, it had better be in the same objfile as
   28.38 ++	 TYPE.  Otherwise, we can't link it into TYPE's cv chain: if one
   28.39 ++	 objfile is freed and the other kept, we'd have dangling
   28.40 ++	 pointers.  */
   28.41 ++      gdb_assert (TYPE_OBJFILE (type) == TYPE_OBJFILE (storage));
   28.42 ++
   28.43 +       ntype = storage;
   28.44 +       TYPE_MAIN_TYPE (ntype) = TYPE_MAIN_TYPE (type);
   28.45 +       TYPE_CHAIN (ntype) = ntype;
   28.46 +@@ -501,11 +509,12 @@ make_type_with_address_space (struct typ
   28.47 +    CNST is a flag for setting the const attribute
   28.48 +    VOLTL is a flag for setting the volatile attribute
   28.49 +    TYPE is the base type whose variant we are creating.
   28.50 +-   TYPEPTR, if nonzero, points
   28.51 +-   to a pointer to memory where the reference type should be stored.
   28.52 +-   If *TYPEPTR is zero, update it to point to the reference type we return.
   28.53 +-   We allocate new memory if needed.  */
   28.54 + 
   28.55 ++   If TYPEPTR and *TYPEPTR are non-zero, then *TYPEPTR points to
   28.56 ++   storage to hold the new qualified type; *TYPEPTR and TYPE must be
   28.57 ++   in the same objfile.  Otherwise, allocate fresh memory for the new
   28.58 ++   type whereever TYPE lives.  If TYPEPTR is non-zero, set it to the
   28.59 ++   new type we construct.  */
   28.60 + struct type *
   28.61 + make_cv_type (int cnst, int voltl, struct type *type, struct type **typeptr)
   28.62 + {
   28.63 +@@ -524,20 +533,19 @@ make_cv_type (int cnst, int voltl, struc
   28.64 + 
   28.65 +   if (typeptr && *typeptr != NULL)
   28.66 +     {
   28.67 +-      /* Objfile is per-core-type.  This const-qualified type had best
   28.68 +-	 belong to the same objfile as the type it is qualifying, unless
   28.69 +-	 we are overwriting a stub type, in which case the safest thing
   28.70 +-	 to do is to copy the core type into the new objfile.  */
   28.71 +-
   28.72 +-      gdb_assert (TYPE_OBJFILE (*typeptr) == TYPE_OBJFILE (type)
   28.73 +-		  || TYPE_STUB (*typeptr));
   28.74 +-      if (TYPE_OBJFILE (*typeptr) != TYPE_OBJFILE (type))
   28.75 +-	{
   28.76 +-	  TYPE_MAIN_TYPE (*typeptr)
   28.77 +-	    = TYPE_ALLOC (*typeptr, sizeof (struct main_type));
   28.78 +-	  *TYPE_MAIN_TYPE (*typeptr)
   28.79 +-	    = *TYPE_MAIN_TYPE (type);
   28.80 +-	}
   28.81 ++      /* TYPE and *TYPEPTR must be in the same objfile.  We can't have
   28.82 ++	 a C-V variant chain that threads across objfiles: if one
   28.83 ++	 objfile gets freed, then the other has a broken C-V chain.
   28.84 ++
   28.85 ++	 This code used to try to copy over the main type from TYPE to
   28.86 ++	 *TYPEPTR if they were in different objfiles, but that's
   28.87 ++	 wrong, too: TYPE may have a field list or member function
   28.88 ++	 lists, which refer to types of their own, etc. etc.  The
   28.89 ++	 whole shebang would need to be copied over recursively; you
   28.90 ++	 can't have inter-objfile pointers.  The only thing to do is
   28.91 ++	 to leave stub types as stub types, and look them up afresh by
   28.92 ++	 name each time you encounter them.  */
   28.93 ++      gdb_assert (TYPE_OBJFILE (*typeptr) == TYPE_OBJFILE (type));
   28.94 +     }
   28.95 +   
   28.96 +   ntype = make_qualified_type (type, new_flags, typeptr ? *typeptr : NULL);
   28.97 +@@ -562,6 +570,12 @@ replace_type (struct type *ntype, struct
   28.98 + {
   28.99 +   struct type *chain;
  28.100 + 
  28.101 ++  /* These two types had better be in the same objfile.  Otherwise,
  28.102 ++     the assignment of one type's main type structure to the other
  28.103 ++     will produce a type with references to objects (names; field
  28.104 ++     lists; etc.) allocated on an objfile other than its own.  */
  28.105 ++  gdb_assert (TYPE_OBJFILE (ntype) == TYPE_OBJFILE (ntype));
  28.106 ++
  28.107 +   *TYPE_MAIN_TYPE (ntype) = *TYPE_MAIN_TYPE (type);
  28.108 + 
  28.109 +   /* The type length is not a part of the main type.  Update it for each
  28.110 +@@ -1416,8 +1430,24 @@ check_typedef (struct type *type)
  28.111 + 	  return type;
  28.112 + 	}
  28.113 +       newtype = lookup_transparent_type (name);
  28.114 ++
  28.115 +       if (newtype)
  28.116 +-	make_cv_type (is_const, is_volatile, newtype, &type);
  28.117 ++	{
  28.118 ++	  /* If the resolved type and the stub are in the same objfile,
  28.119 ++	     then replace the stub type with the real deal.  But if
  28.120 ++	     they're in separate objfiles, leave the stub alone; we'll
  28.121 ++	     just look up the transparent type every time we call
  28.122 ++	     check_typedef.  We can't create pointers between types
  28.123 ++	     allocated to different objfiles, since they may have
  28.124 ++	     different lifetimes.  Trying to copy NEWTYPE over to TYPE's
  28.125 ++	     objfile is pointless, too, since you'll have to move over any
  28.126 ++	     other types NEWTYPE refers to, which could be an unbounded
  28.127 ++	     amount of stuff.  */
  28.128 ++	  if (TYPE_OBJFILE (newtype) == TYPE_OBJFILE (type))
  28.129 ++	    make_cv_type (is_const, is_volatile, newtype, &type);
  28.130 ++	  else
  28.131 ++	    type = newtype;
  28.132 ++	}
  28.133 +     }
  28.134 +   /* Otherwise, rely on the stub flag being set for opaque/stubbed types */
  28.135 +   else if (TYPE_STUB (type) && !currently_reading_symtab)
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/patches/gdb/6.3/750-debian_sparc-singlestep.patch	Thu May 17 16:22:51 2007 +0000
    29.3 @@ -0,0 +1,37 @@
    29.4 +Status: submitted for comments
    29.5 +
    29.6 +2004-11-13  Daniel Jacobowitz  <dan@debian.org>
    29.7 +
    29.8 +	* sparc-tdep.c (sparc_software_single_step): Handle stepping to NULL.
    29.9 +
   29.10 +Index: gdb-6.3/gdb/sparc-tdep.c
   29.11 +===================================================================
   29.12 +--- gdb-6.3.orig/gdb/sparc-tdep.c	2004-06-06 22:02:55.000000000 -0400
   29.13 ++++ gdb-6.3/gdb/sparc-tdep.c	2004-11-13 17:06:05.000000000 -0500
   29.14 +@@ -1026,10 +1026,10 @@
   29.15 + 
   29.16 +   if (insert_breakpoints_p)
   29.17 +     {
   29.18 +-      CORE_ADDR pc;
   29.19 ++      CORE_ADDR pc, orig_npc;
   29.20 + 
   29.21 +       pc = sparc_address_from_register (tdep->pc_regnum);
   29.22 +-      npc = sparc_address_from_register (tdep->npc_regnum);
   29.23 ++      orig_npc = npc = sparc_address_from_register (tdep->npc_regnum);
   29.24 + 
   29.25 +       /* Analyze the instruction at PC.  */
   29.26 +       nnpc = sparc_analyze_control_transfer (pc, &npc);
   29.27 +@@ -1039,9 +1039,10 @@
   29.28 + 	target_insert_breakpoint (nnpc, nnpc_save);
   29.29 + 
   29.30 +       /* Assert that we have set at least one breakpoint, and that
   29.31 +-         they're not set at the same spot.  */
   29.32 +-      gdb_assert (npc != 0 || nnpc != 0);
   29.33 +-      gdb_assert (nnpc != npc);
   29.34 ++         they're not set at the same spot - unless we're going
   29.35 ++	 from here straight to NULL, i.e. a call or jump to 0.  */
   29.36 ++      gdb_assert (npc != 0 || nnpc != 0 || orig_npc == 0);
   29.37 ++      gdb_assert (nnpc != npc || orig_npc == 0);
   29.38 +     }
   29.39 +   else
   29.40 +     {
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/patches/gdb/6.3/760-debian_vsyscall-bfd-close-result.patch	Thu May 17 16:22:51 2007 +0000
    30.3 @@ -0,0 +1,20 @@
    30.4 +2004-10-24  Daniel Jacobowitz  <dan@debian.org>
    30.5 +
    30.6 +	* opncls.c (bfd_close): Return TRUE for BFD_IN_MEMORY.
    30.7 +
    30.8 +Index: src/bfd/opncls.c
    30.9 +===================================================================
   30.10 +RCS file: /big/fsf/rsync/src-cvs/src/bfd/opncls.c,v
   30.11 +retrieving revision 1.25
   30.12 +diff -u -p -r1.25 opncls.c
   30.13 +--- src/bfd/opncls.c	10 Oct 2004 13:58:05 -0000	1.25
   30.14 ++++ src/bfd/opncls.c	24 Oct 2004 17:52:53 -0000
   30.15 +@@ -598,7 +598,7 @@ bfd_close (bfd *abfd)
   30.16 +   if (!(abfd->flags & BFD_IN_MEMORY))
   30.17 +     ret = abfd->iovec->bclose (abfd);
   30.18 +   else
   30.19 +-    ret = 0;
   30.20 ++    ret = TRUE;
   30.21 + 
   30.22 +   /* If the file was open for writing and is now executable,
   30.23 +      make it so.  */
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/patches/gdb/6.3/770-debian_vfork-done-spelling.patch	Thu May 17 16:22:51 2007 +0000
    31.3 @@ -0,0 +1,31 @@
    31.4 +Index: gdb-6.3/gdb/linux-nat.c
    31.5 +===================================================================
    31.6 +--- gdb-6.3.orig/gdb/linux-nat.c	2004-11-14 00:36:41.000000000 -0500
    31.7 ++++ gdb-6.3/gdb/linux-nat.c	2004-11-15 11:51:43.954161476 -0500
    31.8 +@@ -69,7 +69,7 @@
    31.9 + #define PTRACE_EVENT_VFORK	2
   31.10 + #define PTRACE_EVENT_CLONE	3
   31.11 + #define PTRACE_EVENT_EXEC	4
   31.12 +-#define PTRACE_EVENT_VFORKDONE	5
   31.13 ++#define PTRACE_EVENT_VFORK_DONE	5
   31.14 + #define PTRACE_EVENT_EXIT	6
   31.15 + 
   31.16 + #endif /* PTRACE_EVENT_FORK */
   31.17 +@@ -362,7 +362,7 @@ child_follow_fork (int follow_child)
   31.18 + 
   31.19 + 	      ptrace (PTRACE_CONT, parent_pid, 0, 0);
   31.20 + 	      waitpid (parent_pid, &status, __WALL);
   31.21 +-	      if ((status >> 16) != PTRACE_EVENT_VFORKDONE)
   31.22 ++	      if ((status >> 16) != PTRACE_EVENT_VFORK_DONE)
   31.23 + 		warning ("Unexpected waitpid result %06x when waiting for "
   31.24 + 			 "vfork-done", status);
   31.25 + 	    }
   31.26 +@@ -434,7 +434,7 @@ child_follow_fork (int follow_child)
   31.27 + 	 generally not encounter vfork (vfork is defined to fork
   31.28 + 	 in libpthread.so).
   31.29 + 
   31.30 +-	 The holding part is very easy if we have VFORKDONE events;
   31.31 ++	 The holding part is very easy if we have VFORK_DONE events;
   31.32 + 	 but keeping track of both processes is beyond GDB at the
   31.33 + 	 moment.  So we don't expose the parent to the rest of GDB.
   31.34 + 	 Instead we quietly hold onto it until such time as we can
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/patches/gdb/6.3/780-debian_gdbserver-rdynamic.patch	Thu May 17 16:22:51 2007 +0000
    32.3 @@ -0,0 +1,675 @@
    32.4 +Status: Commited to GDB after 6.3.
    32.5 +
    32.6 +Index: gdb-6.3/gdb/gdbserver/acinclude.m4
    32.7 +===================================================================
    32.8 +--- gdb-6.3.orig/gdb/gdbserver/acinclude.m4	2002-06-11 13:32:39.000000000 -0400
    32.9 ++++ gdb-6.3/gdb/gdbserver/acinclude.m4	2004-12-07 17:19:31.115089905 -0500
   32.10 +@@ -13,6 +13,7 @@ AC_DEFUN([SRV_CHECK_THREAD_DB],
   32.11 +    void ps_lsetregs() {}
   32.12 +    void ps_lgetfpregs() {}
   32.13 +    void ps_lsetfpregs() {}
   32.14 ++   void ps_get_thread_area() {}
   32.15 +    void ps_getpid() {}],
   32.16 +   [td_ta_new();],
   32.17 +   [srv_cv_thread_db="-lthread_db"],
   32.18 +@@ -32,10 +33,11 @@ AC_DEFUN([SRV_CHECK_THREAD_DB],
   32.19 +    void ps_lsetregs() {}
   32.20 +    void ps_lgetfpregs() {}
   32.21 +    void ps_lsetfpregs() {}
   32.22 ++   void ps_get_thread_area() {}
   32.23 +    void ps_getpid() {}],
   32.24 +   [td_ta_new();],
   32.25 +   [srv_cv_thread_db="$thread_db"],
   32.26 +   [srv_cv_thread_db=no])
   32.27 ++  ]])
   32.28 +  LIBS="$old_LIBS"
   32.29 +- ]])
   32.30 + )])
   32.31 +Index: gdb-6.3/gdb/gdbserver/configure
   32.32 +===================================================================
   32.33 +--- gdb-6.3.orig/gdb/gdbserver/configure	2004-10-16 12:18:54.000000000 -0400
   32.34 ++++ gdb-6.3/gdb/gdbserver/configure	2004-12-07 17:22:17.343129771 -0500
   32.35 +@@ -28,6 +28,7 @@ program_suffix=NONE
   32.36 + program_transform_name=s,x,x,
   32.37 + silent=
   32.38 + site=
   32.39 ++sitefile=
   32.40 + srcdir=
   32.41 + target=NONE
   32.42 + verbose=
   32.43 +@@ -142,6 +143,7 @@ Configuration:
   32.44 +   --help                  print this message
   32.45 +   --no-create             do not create output files
   32.46 +   --quiet, --silent       do not print \`checking...' messages
   32.47 ++  --site-file=FILE        use FILE as the site file
   32.48 +   --version               print the version of autoconf that created configure
   32.49 + Directory and file names:
   32.50 +   --prefix=PREFIX         install architecture-independent files in PREFIX
   32.51 +@@ -312,6 +314,11 @@ EOF
   32.52 +   -site=* | --site=* | --sit=*)
   32.53 +     site="$ac_optarg" ;;
   32.54 + 
   32.55 ++  -site-file | --site-file | --site-fil | --site-fi | --site-f)
   32.56 ++    ac_prev=sitefile ;;
   32.57 ++  -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
   32.58 ++    sitefile="$ac_optarg" ;;
   32.59 ++
   32.60 +   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
   32.61 +     ac_prev=srcdir ;;
   32.62 +   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
   32.63 +@@ -477,12 +484,16 @@ fi
   32.64 + srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
   32.65 + 
   32.66 + # Prefer explicitly selected file to automatically selected ones.
   32.67 +-if test -z "$CONFIG_SITE"; then
   32.68 +-  if test "x$prefix" != xNONE; then
   32.69 +-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
   32.70 +-  else
   32.71 +-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
   32.72 ++if test -z "$sitefile"; then
   32.73 ++  if test -z "$CONFIG_SITE"; then
   32.74 ++    if test "x$prefix" != xNONE; then
   32.75 ++      CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
   32.76 ++    else
   32.77 ++      CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
   32.78 ++    fi
   32.79 +   fi
   32.80 ++else
   32.81 ++  CONFIG_SITE="$sitefile"
   32.82 + fi
   32.83 + for ac_site_file in $CONFIG_SITE; do
   32.84 +   if test -r "$ac_site_file"; then
   32.85 +@@ -526,7 +537,7 @@ fi
   32.86 + # Extract the first word of "gcc", so it can be a program name with args.
   32.87 + set dummy gcc; ac_word=$2
   32.88 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
   32.89 +-echo "configure:530: checking for $ac_word" >&5
   32.90 ++echo "configure:541: checking for $ac_word" >&5
   32.91 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   32.92 +   echo $ac_n "(cached) $ac_c" 1>&6
   32.93 + else
   32.94 +@@ -556,7 +567,7 @@ if test -z "$CC"; then
   32.95 +   # Extract the first word of "cc", so it can be a program name with args.
   32.96 + set dummy cc; ac_word=$2
   32.97 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
   32.98 +-echo "configure:560: checking for $ac_word" >&5
   32.99 ++echo "configure:571: checking for $ac_word" >&5
  32.100 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  32.101 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.102 + else
  32.103 +@@ -607,7 +618,7 @@ fi
  32.104 +       # Extract the first word of "cl", so it can be a program name with args.
  32.105 + set dummy cl; ac_word=$2
  32.106 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  32.107 +-echo "configure:611: checking for $ac_word" >&5
  32.108 ++echo "configure:622: checking for $ac_word" >&5
  32.109 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  32.110 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.111 + else
  32.112 +@@ -639,7 +650,7 @@ fi
  32.113 + fi
  32.114 + 
  32.115 + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
  32.116 +-echo "configure:643: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
  32.117 ++echo "configure:654: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
  32.118 + 
  32.119 + ac_ext=c
  32.120 + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  32.121 +@@ -650,12 +661,12 @@ cross_compiling=$ac_cv_prog_cc_cross
  32.122 + 
  32.123 + cat > conftest.$ac_ext << EOF
  32.124 + 
  32.125 +-#line 654 "configure"
  32.126 ++#line 665 "configure"
  32.127 + #include "confdefs.h"
  32.128 + 
  32.129 + main(){return(0);}
  32.130 + EOF
  32.131 +-if { (eval echo configure:659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  32.132 ++if { (eval echo configure:670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  32.133 +   ac_cv_prog_cc_works=yes
  32.134 +   # If we can't run a trivial program, we are probably using a cross compiler.
  32.135 +   if (./conftest; exit) 2>/dev/null; then
  32.136 +@@ -681,12 +692,12 @@ if test $ac_cv_prog_cc_works = no; then
  32.137 +   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
  32.138 + fi
  32.139 + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
  32.140 +-echo "configure:685: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
  32.141 ++echo "configure:696: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
  32.142 + echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
  32.143 + cross_compiling=$ac_cv_prog_cc_cross
  32.144 + 
  32.145 + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
  32.146 +-echo "configure:690: checking whether we are using GNU C" >&5
  32.147 ++echo "configure:701: checking whether we are using GNU C" >&5
  32.148 + if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
  32.149 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.150 + else
  32.151 +@@ -695,7 +706,7 @@ else
  32.152 +   yes;
  32.153 + #endif
  32.154 + EOF
  32.155 +-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:699: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  32.156 ++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:710: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  32.157 +   ac_cv_prog_gcc=yes
  32.158 + else
  32.159 +   ac_cv_prog_gcc=no
  32.160 +@@ -714,7 +725,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
  32.161 + ac_save_CFLAGS="$CFLAGS"
  32.162 + CFLAGS=
  32.163 + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
  32.164 +-echo "configure:718: checking whether ${CC-cc} accepts -g" >&5
  32.165 ++echo "configure:729: checking whether ${CC-cc} accepts -g" >&5
  32.166 + if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
  32.167 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.168 + else
  32.169 +@@ -793,7 +804,7 @@ else { echo "configure: error: can not r
  32.170 + fi
  32.171 + 
  32.172 + echo $ac_n "checking host system type""... $ac_c" 1>&6
  32.173 +-echo "configure:797: checking host system type" >&5
  32.174 ++echo "configure:808: checking host system type" >&5
  32.175 + 
  32.176 + host_alias=$host
  32.177 + case "$host_alias" in
  32.178 +@@ -814,7 +825,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
  32.179 + echo "$ac_t""$host" 1>&6
  32.180 + 
  32.181 + echo $ac_n "checking target system type""... $ac_c" 1>&6
  32.182 +-echo "configure:818: checking target system type" >&5
  32.183 ++echo "configure:829: checking target system type" >&5
  32.184 + 
  32.185 + target_alias=$target
  32.186 + case "$target_alias" in
  32.187 +@@ -832,7 +843,7 @@ target_os=`echo $target | sed 's/^\([^-]
  32.188 + echo "$ac_t""$target" 1>&6
  32.189 + 
  32.190 + echo $ac_n "checking build system type""... $ac_c" 1>&6
  32.191 +-echo "configure:836: checking build system type" >&5
  32.192 ++echo "configure:847: checking build system type" >&5
  32.193 + 
  32.194 + build_alias=$build
  32.195 + case "$build_alias" in
  32.196 +@@ -867,7 +878,7 @@ test "$host_alias" != "$target_alias" &&
  32.197 + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  32.198 + # ./install, which can be erroneously created by make from ./install.sh.
  32.199 + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
  32.200 +-echo "configure:871: checking for a BSD compatible install" >&5
  32.201 ++echo "configure:882: checking for a BSD compatible install" >&5
  32.202 + if test -z "$INSTALL"; then
  32.203 + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
  32.204 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.205 +@@ -921,7 +932,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA=
  32.206 + 
  32.207 + 
  32.208 + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
  32.209 +-echo "configure:925: checking how to run the C preprocessor" >&5
  32.210 ++echo "configure:936: checking how to run the C preprocessor" >&5
  32.211 + # On Suns, sometimes $CPP names a directory.
  32.212 + if test -n "$CPP" && test -d "$CPP"; then
  32.213 +   CPP=
  32.214 +@@ -936,13 +947,13 @@ else
  32.215 +   # On the NeXT, cc -E runs the code through the compiler's parser,
  32.216 +   # not just through cpp.
  32.217 +   cat > conftest.$ac_ext <<EOF
  32.218 +-#line 940 "configure"
  32.219 ++#line 951 "configure"
  32.220 + #include "confdefs.h"
  32.221 + #include <assert.h>
  32.222 + Syntax Error
  32.223 + EOF
  32.224 + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  32.225 +-{ (eval echo configure:946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  32.226 ++{ (eval echo configure:957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  32.227 + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  32.228 + if test -z "$ac_err"; then
  32.229 +   :
  32.230 +@@ -953,13 +964,13 @@ else
  32.231 +   rm -rf conftest*
  32.232 +   CPP="${CC-cc} -E -traditional-cpp"
  32.233 +   cat > conftest.$ac_ext <<EOF
  32.234 +-#line 957 "configure"
  32.235 ++#line 968 "configure"
  32.236 + #include "confdefs.h"
  32.237 + #include <assert.h>
  32.238 + Syntax Error
  32.239 + EOF
  32.240 + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  32.241 +-{ (eval echo configure:963: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  32.242 ++{ (eval echo configure:974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  32.243 + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  32.244 + if test -z "$ac_err"; then
  32.245 +   :
  32.246 +@@ -970,13 +981,13 @@ else
  32.247 +   rm -rf conftest*
  32.248 +   CPP="${CC-cc} -nologo -E"
  32.249 +   cat > conftest.$ac_ext <<EOF
  32.250 +-#line 974 "configure"
  32.251 ++#line 985 "configure"
  32.252 + #include "confdefs.h"
  32.253 + #include <assert.h>
  32.254 + Syntax Error
  32.255 + EOF
  32.256 + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  32.257 +-{ (eval echo configure:980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  32.258 ++{ (eval echo configure:991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  32.259 + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  32.260 + if test -z "$ac_err"; then
  32.261 +   :
  32.262 +@@ -1001,12 +1012,12 @@ fi
  32.263 + echo "$ac_t""$CPP" 1>&6
  32.264 + 
  32.265 + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
  32.266 +-echo "configure:1005: checking for ANSI C header files" >&5
  32.267 ++echo "configure:1016: checking for ANSI C header files" >&5
  32.268 + if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
  32.269 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.270 + else
  32.271 +   cat > conftest.$ac_ext <<EOF
  32.272 +-#line 1010 "configure"
  32.273 ++#line 1021 "configure"
  32.274 + #include "confdefs.h"
  32.275 + #include <stdlib.h>
  32.276 + #include <stdarg.h>
  32.277 +@@ -1014,7 +1025,7 @@ else
  32.278 + #include <float.h>
  32.279 + EOF
  32.280 + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  32.281 +-{ (eval echo configure:1018: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  32.282 ++{ (eval echo configure:1029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  32.283 + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  32.284 + if test -z "$ac_err"; then
  32.285 +   rm -rf conftest*
  32.286 +@@ -1031,7 +1042,7 @@ rm -f conftest*
  32.287 + if test $ac_cv_header_stdc = yes; then
  32.288 +   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  32.289 + cat > conftest.$ac_ext <<EOF
  32.290 +-#line 1035 "configure"
  32.291 ++#line 1046 "configure"
  32.292 + #include "confdefs.h"
  32.293 + #include <string.h>
  32.294 + EOF
  32.295 +@@ -1049,7 +1060,7 @@ fi
  32.296 + if test $ac_cv_header_stdc = yes; then
  32.297 +   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  32.298 + cat > conftest.$ac_ext <<EOF
  32.299 +-#line 1053 "configure"
  32.300 ++#line 1064 "configure"
  32.301 + #include "confdefs.h"
  32.302 + #include <stdlib.h>
  32.303 + EOF
  32.304 +@@ -1070,7 +1081,7 @@ if test "$cross_compiling" = yes; then
  32.305 +   :
  32.306 + else
  32.307 +   cat > conftest.$ac_ext <<EOF
  32.308 +-#line 1074 "configure"
  32.309 ++#line 1085 "configure"
  32.310 + #include "confdefs.h"
  32.311 + #include <ctype.h>
  32.312 + #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  32.313 +@@ -1081,7 +1092,7 @@ if (XOR (islower (i), ISLOWER (i)) || to
  32.314 + exit (0); }
  32.315 + 
  32.316 + EOF
  32.317 +-if { (eval echo configure:1085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  32.318 ++if { (eval echo configure:1096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  32.319 + then
  32.320 +   :
  32.321 + else
  32.322 +@@ -1109,17 +1120,17 @@ for ac_hdr in sgtty.h termio.h termios.h
  32.323 + do
  32.324 + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  32.325 + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  32.326 +-echo "configure:1113: checking for $ac_hdr" >&5
  32.327 ++echo "configure:1124: checking for $ac_hdr" >&5
  32.328 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  32.329 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.330 + else
  32.331 +   cat > conftest.$ac_ext <<EOF
  32.332 +-#line 1118 "configure"
  32.333 ++#line 1129 "configure"
  32.334 + #include "confdefs.h"
  32.335 + #include <$ac_hdr>
  32.336 + EOF
  32.337 + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  32.338 +-{ (eval echo configure:1123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  32.339 ++{ (eval echo configure:1134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  32.340 + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  32.341 + if test -z "$ac_err"; then
  32.342 +   rm -rf conftest*
  32.343 +@@ -1147,12 +1158,12 @@ done
  32.344 + 
  32.345 + 
  32.346 + echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6
  32.347 +-echo "configure:1151: checking whether strerror must be declared" >&5
  32.348 ++echo "configure:1162: checking whether strerror must be declared" >&5
  32.349 + if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then
  32.350 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.351 + else
  32.352 +   cat > conftest.$ac_ext <<EOF
  32.353 +-#line 1156 "configure"
  32.354 ++#line 1167 "configure"
  32.355 + #include "confdefs.h"
  32.356 + 
  32.357 + #include <stdio.h>
  32.358 +@@ -1173,7 +1184,7 @@ int main() {
  32.359 + char *(*pfn) = (char *(*)) strerror
  32.360 + ; return 0; }
  32.361 + EOF
  32.362 +-if { (eval echo configure:1177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.363 ++if { (eval echo configure:1188: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.364 +   rm -rf conftest*
  32.365 +   bfd_cv_decl_needed_strerror=no
  32.366 + else
  32.367 +@@ -1205,19 +1216,19 @@ fi
  32.368 + 
  32.369 + if test "${srv_linux_regsets}" = "yes"; then
  32.370 +   echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6
  32.371 +-echo "configure:1209: checking for PTRACE_GETREGS" >&5
  32.372 ++echo "configure:1220: checking for PTRACE_GETREGS" >&5
  32.373 +   if eval "test \"`echo '$''{'gdbsrv_cv_have_ptrace_getregs'+set}'`\" = set"; then
  32.374 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.375 + else
  32.376 +   cat > conftest.$ac_ext <<EOF
  32.377 +-#line 1214 "configure"
  32.378 ++#line 1225 "configure"
  32.379 + #include "confdefs.h"
  32.380 + #include <sys/ptrace.h>
  32.381 + int main() {
  32.382 + PTRACE_GETREGS;
  32.383 + ; return 0; }
  32.384 + EOF
  32.385 +-if { (eval echo configure:1221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.386 ++if { (eval echo configure:1232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.387 +   rm -rf conftest*
  32.388 +   gdbsrv_cv_have_ptrace_getregs=yes
  32.389 + else
  32.390 +@@ -1238,19 +1249,19 @@ EOF
  32.391 +   fi
  32.392 + 
  32.393 +   echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6
  32.394 +-echo "configure:1242: checking for PTRACE_GETFPXREGS" >&5
  32.395 ++echo "configure:1253: checking for PTRACE_GETFPXREGS" >&5
  32.396 +   if eval "test \"`echo '$''{'gdbsrv_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then
  32.397 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.398 + else
  32.399 +   cat > conftest.$ac_ext <<EOF
  32.400 +-#line 1247 "configure"
  32.401 ++#line 1258 "configure"
  32.402 + #include "confdefs.h"
  32.403 + #include <sys/ptrace.h>
  32.404 + int main() {
  32.405 + PTRACE_GETFPXREGS;
  32.406 + ; return 0; }
  32.407 + EOF
  32.408 +-if { (eval echo configure:1254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.409 ++if { (eval echo configure:1265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.410 +   rm -rf conftest*
  32.411 +   gdbsrv_cv_have_ptrace_getfpxregs=yes
  32.412 + else
  32.413 +@@ -1273,12 +1284,12 @@ fi
  32.414 + 
  32.415 + if test "$ac_cv_header_sys_procfs_h" = yes; then
  32.416 +   echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6
  32.417 +-echo "configure:1277: checking for lwpid_t in sys/procfs.h" >&5
  32.418 ++echo "configure:1288: checking for lwpid_t in sys/procfs.h" >&5
  32.419 +  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then
  32.420 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.421 + else
  32.422 +   cat > conftest.$ac_ext <<EOF
  32.423 +-#line 1282 "configure"
  32.424 ++#line 1293 "configure"
  32.425 + #include "confdefs.h"
  32.426 + 
  32.427 + #define _SYSCALL32
  32.428 +@@ -1287,7 +1298,7 @@ int main() {
  32.429 + lwpid_t avar
  32.430 + ; return 0; }
  32.431 + EOF
  32.432 +-if { (eval echo configure:1291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.433 ++if { (eval echo configure:1302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.434 +   rm -rf conftest*
  32.435 +   bfd_cv_have_sys_procfs_type_lwpid_t=yes
  32.436 + else
  32.437 +@@ -1309,12 +1320,12 @@ EOF
  32.438 +  echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6
  32.439 + 
  32.440 +   echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6
  32.441 +-echo "configure:1313: checking for psaddr_t in sys/procfs.h" >&5
  32.442 ++echo "configure:1324: checking for psaddr_t in sys/procfs.h" >&5
  32.443 +  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then
  32.444 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.445 + else
  32.446 +   cat > conftest.$ac_ext <<EOF
  32.447 +-#line 1318 "configure"
  32.448 ++#line 1329 "configure"
  32.449 + #include "confdefs.h"
  32.450 + 
  32.451 + #define _SYSCALL32
  32.452 +@@ -1323,7 +1334,7 @@ int main() {
  32.453 + psaddr_t avar
  32.454 + ; return 0; }
  32.455 + EOF
  32.456 +-if { (eval echo configure:1327: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.457 ++if { (eval echo configure:1338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.458 +   rm -rf conftest*
  32.459 +   bfd_cv_have_sys_procfs_type_psaddr_t=yes
  32.460 + else
  32.461 +@@ -1345,12 +1356,12 @@ EOF
  32.462 +  echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6
  32.463 + 
  32.464 +   echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6
  32.465 +-echo "configure:1349: checking for prgregset_t in sys/procfs.h" >&5
  32.466 ++echo "configure:1360: checking for prgregset_t in sys/procfs.h" >&5
  32.467 +  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then
  32.468 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.469 + else
  32.470 +   cat > conftest.$ac_ext <<EOF
  32.471 +-#line 1354 "configure"
  32.472 ++#line 1365 "configure"
  32.473 + #include "confdefs.h"
  32.474 + 
  32.475 + #define _SYSCALL32
  32.476 +@@ -1359,7 +1370,7 @@ int main() {
  32.477 + prgregset_t avar
  32.478 + ; return 0; }
  32.479 + EOF
  32.480 +-if { (eval echo configure:1363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.481 ++if { (eval echo configure:1374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.482 +   rm -rf conftest*
  32.483 +   bfd_cv_have_sys_procfs_type_prgregset_t=yes
  32.484 + else
  32.485 +@@ -1381,12 +1392,12 @@ EOF
  32.486 +  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6
  32.487 + 
  32.488 +   echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6
  32.489 +-echo "configure:1385: checking for prfpregset_t in sys/procfs.h" >&5
  32.490 ++echo "configure:1396: checking for prfpregset_t in sys/procfs.h" >&5
  32.491 +  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then
  32.492 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.493 + else
  32.494 +   cat > conftest.$ac_ext <<EOF
  32.495 +-#line 1390 "configure"
  32.496 ++#line 1401 "configure"
  32.497 + #include "confdefs.h"
  32.498 + 
  32.499 + #define _SYSCALL32
  32.500 +@@ -1395,7 +1406,7 @@ int main() {
  32.501 + prfpregset_t avar
  32.502 + ; return 0; }
  32.503 + EOF
  32.504 +-if { (eval echo configure:1399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.505 ++if { (eval echo configure:1410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.506 +   rm -rf conftest*
  32.507 +   bfd_cv_have_sys_procfs_type_prfpregset_t=yes
  32.508 + else
  32.509 +@@ -1421,7 +1432,7 @@ EOF
  32.510 +         
  32.511 +   if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
  32.512 +     echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6
  32.513 +-echo "configure:1425: checking whether prfpregset_t type is broken" >&5
  32.514 ++echo "configure:1436: checking whether prfpregset_t type is broken" >&5
  32.515 +     if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then
  32.516 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.517 + else
  32.518 +@@ -1429,7 +1440,7 @@ else
  32.519 +   gdb_cv_prfpregset_t_broken=yes
  32.520 + else
  32.521 +   cat > conftest.$ac_ext <<EOF
  32.522 +-#line 1433 "configure"
  32.523 ++#line 1444 "configure"
  32.524 + #include "confdefs.h"
  32.525 + #include <sys/procfs.h>
  32.526 +        int main ()
  32.527 +@@ -1439,7 +1450,7 @@ else
  32.528 +          return 0;
  32.529 +        }
  32.530 + EOF
  32.531 +-if { (eval echo configure:1443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  32.532 ++if { (eval echo configure:1454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  32.533 + then
  32.534 +   gdb_cv_prfpregset_t_broken=no
  32.535 + else
  32.536 +@@ -1463,12 +1474,12 @@ EOF
  32.537 +   fi
  32.538 + 
  32.539 +   echo $ac_n "checking for elf_fpregset_t in sys/procfs.h""... $ac_c" 1>&6
  32.540 +-echo "configure:1467: checking for elf_fpregset_t in sys/procfs.h" >&5
  32.541 ++echo "configure:1478: checking for elf_fpregset_t in sys/procfs.h" >&5
  32.542 +  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_elf_fpregset_t'+set}'`\" = set"; then
  32.543 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.544 + else
  32.545 +   cat > conftest.$ac_ext <<EOF
  32.546 +-#line 1472 "configure"
  32.547 ++#line 1483 "configure"
  32.548 + #include "confdefs.h"
  32.549 + 
  32.550 + #define _SYSCALL32
  32.551 +@@ -1477,7 +1488,7 @@ int main() {
  32.552 + elf_fpregset_t avar
  32.553 + ; return 0; }
  32.554 + EOF
  32.555 +-if { (eval echo configure:1481: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.556 ++if { (eval echo configure:1492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  32.557 +   rm -rf conftest*
  32.558 +   bfd_cv_have_sys_procfs_type_elf_fpregset_t=yes
  32.559 + else
  32.560 +@@ -1506,14 +1517,14 @@ USE_THREAD_DB=
  32.561 + 
  32.562 + if test "$srv_linux_thread_db" = "yes"; then
  32.563 +   echo $ac_n "checking for libthread_db""... $ac_c" 1>&6
  32.564 +-echo "configure:1510: checking for libthread_db" >&5
  32.565 ++echo "configure:1521: checking for libthread_db" >&5
  32.566 + if eval "test \"`echo '$''{'srv_cv_thread_db'+set}'`\" = set"; then
  32.567 +   echo $ac_n "(cached) $ac_c" 1>&6
  32.568 + else
  32.569 +   old_LIBS="$LIBS"
  32.570 +   LIBS="$LIBS -lthread_db"
  32.571 +   cat > conftest.$ac_ext <<EOF
  32.572 +-#line 1517 "configure"
  32.573 ++#line 1528 "configure"
  32.574 + #include "confdefs.h"
  32.575 + void ps_pglobal_lookup() {}
  32.576 +    void ps_pdread() {}
  32.577 +@@ -1522,12 +1533,13 @@ void ps_pglobal_lookup() {}
  32.578 +    void ps_lsetregs() {}
  32.579 +    void ps_lgetfpregs() {}
  32.580 +    void ps_lsetfpregs() {}
  32.581 ++   void ps_get_thread_area() {}
  32.582 +    void ps_getpid() {}
  32.583 + int main() {
  32.584 + td_ta_new();
  32.585 + ; return 0; }
  32.586 + EOF
  32.587 +-if { (eval echo configure:1531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  32.588 ++if { (eval echo configure:1543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  32.589 +   rm -rf conftest*
  32.590 +   srv_cv_thread_db="-lthread_db"
  32.591 + else
  32.592 +@@ -1543,7 +1555,7 @@ else
  32.593 +  fi
  32.594 +  LIBS="$old_LIBS `eval echo "$thread_db"`"
  32.595 +  cat > conftest.$ac_ext <<EOF
  32.596 +-#line 1547 "configure"
  32.597 ++#line 1559 "configure"
  32.598 + #include "confdefs.h"
  32.599 + void ps_pglobal_lookup() {}
  32.600 +    void ps_pdread() {}
  32.601 +@@ -1552,12 +1564,13 @@ void ps_pglobal_lookup() {}
  32.602 +    void ps_lsetregs() {}
  32.603 +    void ps_lgetfpregs() {}
  32.604 +    void ps_lsetfpregs() {}
  32.605 ++   void ps_get_thread_area() {}
  32.606 +    void ps_getpid() {}
  32.607 + int main() {
  32.608 + td_ta_new();
  32.609 + ; return 0; }
  32.610 + EOF
  32.611 +-if { (eval echo configure:1561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  32.612 ++if { (eval echo configure:1574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  32.613 +   rm -rf conftest*
  32.614 +   srv_cv_thread_db="$thread_db"
  32.615 + else
  32.616 +@@ -1567,11 +1580,11 @@ else
  32.617 +   srv_cv_thread_db=no
  32.618 + fi
  32.619 + rm -f conftest*
  32.620 +- LIBS="$old_LIBS"
  32.621 +- 
  32.622 ++  
  32.623 + fi
  32.624 + 
  32.625 + echo "$ac_t""$srv_cv_thread_db" 1>&6
  32.626 ++ LIBS="$old_LIBS"
  32.627 + 
  32.628 + fi
  32.629 + rm -f conftest*
  32.630 +@@ -1585,14 +1598,14 @@ rm -f conftest*
  32.631 +   old_LDFLAGS="$LDFLAGS"
  32.632 +   LDFLAGS="$LDFLAGS -rdynamic"
  32.633 +   cat > conftest.$ac_ext <<EOF
  32.634 +-#line 1589 "configure"
  32.635 ++#line 1602 "configure"
  32.636 + #include "confdefs.h"
  32.637 + 
  32.638 + int main() {
  32.639 + 
  32.640 + ; return 0; }
  32.641 + EOF
  32.642 +-if { (eval echo configure:1596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  32.643 ++if { (eval echo configure:1609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  32.644 +   rm -rf conftest*
  32.645 +   RDYNAMIC=-rdynamic
  32.646 + else
  32.647 +Index: gdb-6.3/gdb/gdbserver/aclocal.m4
  32.648 +===================================================================
  32.649 +--- gdb-6.3.orig/gdb/gdbserver/aclocal.m4	2002-06-11 13:32:39.000000000 -0400
  32.650 ++++ gdb-6.3/gdb/gdbserver/aclocal.m4	2004-12-07 17:22:00.382495519 -0500
  32.651 +@@ -1,4 +1,4 @@
  32.652 +-dnl aclocal.m4 generated automatically by aclocal 1.4-p4
  32.653 ++dnl aclocal.m4 generated automatically by aclocal 1.4
  32.654 + 
  32.655 + dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
  32.656 + dnl This file is free software; the Free Software Foundation
  32.657 +@@ -25,6 +25,7 @@ AC_DEFUN([SRV_CHECK_THREAD_DB],
  32.658 +    void ps_lsetregs() {}
  32.659 +    void ps_lgetfpregs() {}
  32.660 +    void ps_lsetfpregs() {}
  32.661 ++   void ps_get_thread_area() {}
  32.662 +    void ps_getpid() {}],
  32.663 +   [td_ta_new();],
  32.664 +   [srv_cv_thread_db="-lthread_db"],
  32.665 +@@ -44,11 +45,12 @@ AC_DEFUN([SRV_CHECK_THREAD_DB],
  32.666 +    void ps_lsetregs() {}
  32.667 +    void ps_lgetfpregs() {}
  32.668 +    void ps_lsetfpregs() {}
  32.669 ++   void ps_get_thread_area() {}
  32.670 +    void ps_getpid() {}],
  32.671 +   [td_ta_new();],
  32.672 +   [srv_cv_thread_db="$thread_db"],
  32.673 +   [srv_cv_thread_db=no])
  32.674 ++  ]])
  32.675 +  LIBS="$old_LIBS"
  32.676 +- ]])
  32.677 + )])
  32.678 + 
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/patches/gdb/6.3/790-debian_dwarf2-cfi-warning.patch	Thu May 17 16:22:51 2007 +0000
    33.3 @@ -0,0 +1,39 @@
    33.4 +Status: Unsuitable for upstream (at least, without a lot of arguing).
    33.5 +
    33.6 +GCC does not specify the state of every last register in the CIE.  Since
    33.7 +GCC's focus is on correctness of runtime unwinding, any registers which
    33.8 +have to be unwound will be specified; but unmodified registers will not
    33.9 +be explicitly marked.  (How about modified, call-clobbered registers?
   33.10 +I'm not sure if they are marked as unavailable.)
   33.11 +
   33.12 +GDB issues a noisy warning about this.  The warning is generally not useful,
   33.13 +and we can get it extremely frequently (any time we load a new CIE).
   33.14 +
   33.15 +This patch disables the warning.  Alternately we could set the complaints
   33.16 +threshold to zero, or implement a default frame init-register method for
   33.17 +every architecture.  But someday the compiler will support using different
   33.18 +calling conventions for internal functions, so that's not much of a stopgap. 
   33.19 +ARM has a complex algorithm for handling this, involving scanning all CIEs -
   33.20 +benefit not completely clear outside of the ARM context of flexible register
   33.21 +sets.
   33.22 +
   33.23 +Index: gdb-6.3/gdb/dwarf2-frame.c
   33.24 +===================================================================
   33.25 +--- gdb-6.3.orig/gdb/dwarf2-frame.c	2004-11-15 11:54:57.000000000 -0500
   33.26 ++++ gdb-6.3/gdb/dwarf2-frame.c	2004-12-08 18:02:23.896409471 -0500
   33.27 +@@ -705,9 +705,12 @@ dwarf2_frame_cache (struct frame_info *n
   33.28 + 	   table.  We need a way of iterating through all the valid
   33.29 + 	   DWARF2 register numbers.  */
   33.30 + 	if (fs->regs.reg[column].how == DWARF2_FRAME_REG_UNSPECIFIED)
   33.31 +-	  complaint (&symfile_complaints,
   33.32 +-		     "Incomplete CFI data; unspecified registers at 0x%s",
   33.33 +-		     paddr (fs->pc));
   33.34 ++	  {
   33.35 ++	    if (0)
   33.36 ++	      complaint (&symfile_complaints,
   33.37 ++			 "Incomplete CFI data; unspecified registers at 0x%s",
   33.38 ++			 paddr (fs->pc));
   33.39 ++	  }
   33.40 + 	else
   33.41 + 	  cache->reg[regnum] = fs->regs.reg[column];
   33.42 +       }
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/patches/gdb/6.3/800-debian_linux-use-underscore-exit.patch	Thu May 17 16:22:51 2007 +0000
    34.3 @@ -0,0 +1,22 @@
    34.4 +Status: committed upstream after 6.3.  Fixes some terminal mangling in
    34.5 +gdbtui.
    34.6 +
    34.7 +2004-12-04  Daniel Jacobowitz  <dan@debian.org>
    34.8 +
    34.9 +	PR tui/1703
   34.10 +	* linux-nat.c (linux_tracefork_child): Use _exit instead of exit.
   34.11 +	Suggested by Joshua Neuheisel.
   34.12 +
   34.13 +Index: gdb-6.3/gdb/linux-nat.c
   34.14 +===================================================================
   34.15 +--- gdb-6.3.orig/gdb/linux-nat.c	2004-12-08 18:22:04.996973094 -0500
   34.16 ++++ gdb-6.3/gdb/linux-nat.c	2004-12-08 18:22:20.386956067 -0500
   34.17 +@@ -147,7 +147,7 @@ linux_tracefork_child (void)
   34.18 +   ptrace (PTRACE_TRACEME, 0, 0, 0);
   34.19 +   kill (getpid (), SIGSTOP);
   34.20 +   fork ();
   34.21 +-  exit (0);
   34.22 ++  _exit (0);
   34.23 + }
   34.24 + 
   34.25 + /* Wrapper function for waitpid which handles EINTR.  */
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/patches/gdb/6.3/810-debian_bfd-no-kylix-crash.patch	Thu May 17 16:22:51 2007 +0000
    35.3 @@ -0,0 +1,47 @@
    35.4 +Status: committed upstream after 6.3.
    35.5 +
    35.6 +Fix a crash triggered by Kylix libraries.
    35.7 +
    35.8 +2004-12-06  Daniel Jacobowitz  <dan@debian.org>
    35.9 +
   35.10 +	Suggested by Fergal Daly <fergal@esatclear.ie>:
   35.11 +	* simple.c (simple_dummy_multiple_definition): New function.
   35.12 +	(bfd_simple_get_relocated_section_contents): Use it.
   35.13 +
   35.14 +Index: src/bfd/simple.c
   35.15 +===================================================================
   35.16 +RCS file: /cvs/src/src/bfd/simple.c,v
   35.17 +retrieving revision 1.19
   35.18 +retrieving revision 1.20
   35.19 +Index: gdb-6.3/bfd/simple.c
   35.20 +===================================================================
   35.21 +--- gdb-6.3.orig/bfd/simple.c	2004-09-24 03:07:19.000000000 -0400
   35.22 ++++ gdb-6.3/bfd/simple.c	2004-12-08 18:25:58.415216808 -0500
   35.23 +@@ -78,6 +78,19 @@ simple_dummy_unattached_reloc (struct bf
   35.24 +   return TRUE;
   35.25 + }
   35.26 + 
   35.27 ++static bfd_boolean
   35.28 ++simple_dummy_multiple_definition (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
   35.29 ++				  const char *name ATTRIBUTE_UNUSED,
   35.30 ++				  bfd *obfd ATTRIBUTE_UNUSED,
   35.31 ++				  asection *osec ATTRIBUTE_UNUSED,
   35.32 ++				  bfd_vma oval ATTRIBUTE_UNUSED,
   35.33 ++				  bfd *nbfd ATTRIBUTE_UNUSED,
   35.34 ++				  asection *nsec ATTRIBUTE_UNUSED,
   35.35 ++				  bfd_vma nval ATTRIBUTE_UNUSED)
   35.36 ++{
   35.37 ++  return TRUE;
   35.38 ++}
   35.39 ++
   35.40 + struct saved_output_info
   35.41 + {
   35.42 +   bfd_vma offset;
   35.43 +@@ -172,6 +185,7 @@ bfd_simple_get_relocated_section_content
   35.44 +   callbacks.reloc_overflow = simple_dummy_reloc_overflow;
   35.45 +   callbacks.reloc_dangerous = simple_dummy_reloc_dangerous;
   35.46 +   callbacks.unattached_reloc = simple_dummy_unattached_reloc;
   35.47 ++  callbacks.multiple_definition = simple_dummy_multiple_definition;
   35.48 + 
   35.49 +   memset (&link_order, 0, sizeof (link_order));
   35.50 +   link_order.next = NULL;
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/patches/gdb/6.3/820-debian_disable-linux-fork-messages.patch	Thu May 17 16:22:51 2007 +0000
    36.3 @@ -0,0 +1,46 @@
    36.4 +Status: Proposed upstream after 6.3, not yet committed.
    36.5 +
    36.6 +2004-12-06  Daniel Jacobowitz  <dan@debian.org>
    36.7 +
    36.8 +	* linux-nat.c (child_follow_fork): Call target_terminal_ours before
    36.9 +	printing output.  Use fprintf_unfiltered.  Only print output when
   36.10 +	debugging.
   36.11 +
   36.12 +Index: gdb-6.3/gdb/linux-nat.c
   36.13 +===================================================================
   36.14 +--- gdb-6.3.orig/gdb/linux-nat.c	2004-12-08 18:22:20.386956067 -0500
   36.15 ++++ gdb-6.3/gdb/linux-nat.c	2004-12-08 18:28:49.995585970 -0500
   36.16 +@@ -347,9 +347,13 @@ child_follow_fork (int follow_child)
   36.17 + 	 also, but they'll be reinserted below.  */
   36.18 +       detach_breakpoints (child_pid);
   36.19 + 
   36.20 +-      fprintf_filtered (gdb_stdout,
   36.21 +-			"Detaching after fork from child process %d.\n",
   36.22 +-			child_pid);
   36.23 ++      if (debug_linux_nat)
   36.24 ++	{
   36.25 ++	  target_terminal_ours ();
   36.26 ++	  fprintf_unfiltered (gdb_stdlog,
   36.27 ++			      "Detaching after fork from child process %d.\n",
   36.28 ++			      child_pid);
   36.29 ++	}
   36.30 + 
   36.31 +       ptrace (PTRACE_DETACH, child_pid, 0, 0);
   36.32 + 
   36.33 +@@ -418,9 +422,13 @@ child_follow_fork (int follow_child)
   36.34 +       /* Before detaching from the parent, remove all breakpoints from it. */
   36.35 +       remove_breakpoints ();
   36.36 + 
   36.37 +-      fprintf_filtered (gdb_stdout,
   36.38 +-			"Attaching after fork to child process %d.\n",
   36.39 +-			child_pid);
   36.40 ++      if (debug_linux_nat)
   36.41 ++	{
   36.42 ++	  target_terminal_ours ();
   36.43 ++	  fprintf_unfiltered (gdb_stdlog,
   36.44 ++			      "Attaching after fork to child process %d.\n",
   36.45 ++			      child_pid);
   36.46 ++	}
   36.47 + 
   36.48 +       /* If we're vforking, we may want to hold on to the parent until
   36.49 + 	 the child exits or execs.  At exec time we can remove the old
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/patches/gdb/6.4/100-uclibc-conf.patch	Thu May 17 16:22:51 2007 +0000
    37.3 @@ -0,0 +1,78 @@
    37.4 +--- gdb-6.3/bfd/configure.orig	Fri Oct  8 16:53:56 2004
    37.5 ++++ gdb-6.3/bfd/configure	Sun Feb 27 18:32:58 2005
    37.6 +@@ -3583,6 +3583,11 @@
    37.7 +   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
    37.8 +   ;;
    37.9 + 
   37.10 ++linux-uclibc*)
   37.11 ++  lt_cv_deplibs_check_method=pass_all
   37.12 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   37.13 ++  ;;
   37.14 ++
   37.15 + netbsd* | knetbsd*-gnu)
   37.16 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   37.17 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   37.18 +--- gdb-6.3/libtool.m4.orig	Wed Jul 21 21:21:41 2004
   37.19 ++++ gdb-6.3/libtool.m4	Mon Feb 28 00:08:11 2005
   37.20 +@@ -653,6 +653,11 @@
   37.21 +   fi
   37.22 +   ;;
   37.23 + 
   37.24 ++linux-uclibc*)
   37.25 ++  lt_cv_deplibs_check_method=pass_all
   37.26 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   37.27 ++  ;;
   37.28 ++
   37.29 + newsos6)
   37.30 +   [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
   37.31 +   lt_cv_file_magic_cmd=/usr/bin/file
   37.32 +--- gdb-6.3/ltconfig.orig	Tue Oct  5 15:34:42 2004
   37.33 ++++ gdb-6.3/ltconfig	Sun Feb 27 18:14:41 2005
   37.34 +@@ -602,7 +602,7 @@
   37.35 + 
   37.36 + # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
   37.37 + case $host_os in
   37.38 +-linux-gnu*) ;;
   37.39 ++linux-gnu*|linux-uclibc*) ;;
   37.40 + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
   37.41 + esac
   37.42 + 
   37.43 +@@ -1270,6 +1270,24 @@
   37.44 +   dynamic_linker='GNU/Linux ld.so'
   37.45 +   ;;
   37.46 + 
   37.47 ++linux-uclibc*)
   37.48 ++  version_type=linux
   37.49 ++  need_lib_prefix=no
   37.50 ++  need_version=no
   37.51 ++  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
   37.52 ++  soname_spec='${libname}${release}.so$major'
   37.53 ++  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   37.54 ++  shlibpath_var=LD_LIBRARY_PATH
   37.55 ++  shlibpath_overrides_runpath=no
   37.56 ++  # This implies no fast_install, which is unacceptable.
   37.57 ++  # Some rework will be needed to allow for fast_install
   37.58 ++  # before this can be enabled.
   37.59 ++  # Note: copied from linux-gnu, and may not be appropriate.
   37.60 ++  hardcode_into_libs=yes
   37.61 ++  # Assume using the uClibc dynamic linker.
   37.62 ++  dynamic_linker="uClibc ld.so"
   37.63 ++  ;;
   37.64 ++
   37.65 + netbsd*)
   37.66 +   need_lib_prefix=no
   37.67 +   need_version=no
   37.68 +--- gdb-6.3/opcodes/configure.orig	Fri Sep 17 08:13:38 2004
   37.69 ++++ gdb-6.3/opcodes/configure	Mon Feb 28 00:09:42 2005
   37.70 +@@ -3595,6 +3595,11 @@
   37.71 +   fi
   37.72 +   ;;
   37.73 + 
   37.74 ++linux-uclibc*)
   37.75 ++  lt_cv_deplibs_check_method=pass_all
   37.76 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   37.77 ++  ;;
   37.78 ++
   37.79 + newsos6)
   37.80 +   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
   37.81 +   lt_cv_file_magic_cmd=/usr/bin/file
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/patches/gdb/6.4/200-uclibc-readline-conf.patch	Thu May 17 16:22:51 2007 +0000
    38.3 @@ -0,0 +1,15 @@
    38.4 +--- gdb-6.1.1-dist/readline/configure	2003-05-27 18:29:47.000000000 -0500
    38.5 ++++ gdb-6.1.1/readline/configure	2004-08-09 14:20:23.000000000 -0500
    38.6 +@@ -6249,7 +6249,12 @@
    38.7 + 
    38.8 + 
    38.9 + echo "$as_me:$LINENO: checking for mbstate_t" >&5
   38.10 ++echo $ECHO_N "bash_cv_have_mbstate_t=$bash_cv_have_mbstate_t" >&6
   38.11 + echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
   38.12 ++if test "${bash_cv_have_mbstate_t+set}" != set; then
   38.13 ++  bash_cv_have_mbstate_t=yes
   38.14 ++  echo $ECHO_N "WARNING!! forcing to yes!!! $ECHO_C" >&6
   38.15 ++fi
   38.16 + if test "${bash_cv_have_mbstate_t+set}" = set; then
   38.17 +   echo $ECHO_N "(cached) $ECHO_C" >&6
   38.18 + else
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/patches/gdb/6.4/400-mips-coredump.patch-2.4.23-29	Thu May 17 16:22:51 2007 +0000
    39.3 @@ -0,0 +1,28 @@
    39.4 +Sometime around 2.4.22-23, the mips pt_regs.h fields were reordered, breaking
    39.5 +coredump handling by gdb for current kernels.  Update the hardcoded constants
    39.6 +to reflect the change.
    39.7 +--- gdb-6.2.1/gdb/mips-linux-tdep.c-orig	2004-10-29 14:23:55.000000000 -0500
    39.8 ++++ gdb-6.2.1/gdb/mips-linux-tdep.c	2004-10-29 14:26:44.000000000 -0500
    39.9 +@@ -53,12 +53,22 @@
   39.10 + 
   39.11 + #define EF_REG0			6
   39.12 + #define EF_REG31		37
   39.13 ++
   39.14 ++#if 0
   39.15 + #define EF_LO			38
   39.16 + #define EF_HI			39
   39.17 + #define EF_CP0_EPC		40
   39.18 + #define EF_CP0_BADVADDR		41
   39.19 + #define EF_CP0_STATUS		42
   39.20 + #define EF_CP0_CAUSE		43
   39.21 ++#else
   39.22 ++#define EF_CP0_STATUS		38
   39.23 ++#define EF_LO			39
   39.24 ++#define EF_HI			40
   39.25 ++#define EF_CP0_BADVADDR		41
   39.26 ++#define EF_CP0_CAUSE		42
   39.27 ++#define EF_CP0_EPC		43
   39.28 ++#endif
   39.29 + 
   39.30 + #define EF_SIZE			180
   39.31 + 
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/patches/gdb/6.4/500-thread-timeout.patch	Thu May 17 16:22:51 2007 +0000
    40.3 @@ -0,0 +1,34 @@
    40.4 +--- gdb-6.3.org/gdb/gdbserver/thread-db.c	2004-10-17 02:42:00.000000000 +0900
    40.5 ++++ gdb-6.3/gdb/gdbserver/thread-db.c	2005-01-27 12:19:29.000000000 +0900
    40.6 +@@ -21,6 +21,7 @@
    40.7 +    Foundation, Inc., 59 Temple Place - Suite 330,
    40.8 +    Boston, MA 02111-1307, USA.  */
    40.9 + 
   40.10 ++#include <unistd.h>
   40.11 + #include "server.h"
   40.12 + 
   40.13 + #include "linux-low.h"
   40.14 +@@ -142,6 +143,7 @@
   40.15 +   td_event_msg_t msg;
   40.16 +   td_err_e err;
   40.17 +   struct inferior_linux_data *tdata;
   40.18 ++  int timeout;
   40.19 + 
   40.20 +   if (debug_threads)
   40.21 +     fprintf (stderr, "Thread creation event.\n");
   40.22 +@@ -152,7 +154,13 @@
   40.23 +      In the LinuxThreads implementation, this is safe,
   40.24 +      because all events come from the manager thread
   40.25 +      (except for its own creation, of course).  */
   40.26 +-  err = td_ta_event_getmsg (thread_agent, &msg);
   40.27 ++  for (timeout = 0; timeout < 50000; timeout++)
   40.28 ++    {
   40.29 ++      err = td_ta_event_getmsg (thread_agent, &msg);
   40.30 ++      if (err != TD_NOMSG)
   40.31 ++	break;
   40.32 ++      usleep(1000);
   40.33 ++    }
   40.34 +   if (err != TD_OK)
   40.35 +     fprintf (stderr, "thread getmsg err: %s\n",
   40.36 + 	     thread_db_err_str (err));
   40.37 +
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/patches/gdb/6.4/600-fix-compile-flag-mismatch.patch	Thu May 17 16:22:51 2007 +0000
    41.3 @@ -0,0 +1,87 @@
    41.4 +diff -ur gdb-6.4/gdb/configure gdb-6.4-patched/gdb/configure
    41.5 +--- gdb-6.4/gdb/configure	2005-07-25 10:08:40.000000000 -0500
    41.6 ++++ gdb-6.4-patched/gdb/configure	2007-02-05 13:22:36.000000000 -0600
    41.7 +@@ -309,7 +309,7 @@
    41.8 + # include <unistd.h>
    41.9 + #endif"
   41.10 + 
   41.11 +-ac_subdirs_all="$ac_subdirs_all doc testsuite"
   41.12 ++ac_subdirs_all="$ac_subdirs_all doc"
   41.13 + ac_subdirs_all="$ac_subdirs_all gdbtk"
   41.14 + ac_subdirs_all="$ac_subdirs_all multi-ice"
   41.15 + ac_subdirs_all="$ac_subdirs_all gdbserver"
   41.16 +@@ -5940,7 +5940,7 @@
   41.17 + 
   41.18 + 
   41.19 + 
   41.20 +-subdirs="$subdirs doc testsuite"
   41.21 ++subdirs="$subdirs doc"
   41.22 + 
   41.23 + 
   41.24 + . $srcdir/configure.host
   41.25 +diff -ur gdb-6.4/gdb/gdbserver/configure gdb-6.4-patched/gdb/gdbserver/configure
   41.26 +--- gdb-6.4/gdb/gdbserver/configure	2005-09-17 18:14:37.000000000 -0500
   41.27 ++++ gdb-6.4-patched/gdb/gdbserver/configure	2007-02-05 13:22:58.000000000 -0600
   41.28 +@@ -1239,7 +1239,7 @@
   41.29 +       ac_cache_corrupted=: ;;
   41.30 +     ,);;
   41.31 +     *)
   41.32 +-      if test "x$ac_old_val" != "x$ac_new_val"; then
   41.33 ++      if test "`echo $ac_old_val`" != "`echo $ac_new_val`"; then
   41.34 + 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
   41.35 + echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
   41.36 + 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
   41.37 +diff -ur gdb-6.4/gdb/testsuite/configure gdb-6.4-patched/gdb/testsuite/configure
   41.38 +--- gdb-6.4/gdb/testsuite/configure	2005-04-11 09:13:12.000000000 -0500
   41.39 ++++ gdb-6.4-patched/gdb/testsuite/configure	2007-02-05 13:22:36.000000000 -0600
   41.40 +@@ -1248,7 +1248,7 @@
   41.41 +       ac_cache_corrupted=: ;;
   41.42 +     ,);;
   41.43 +     *)
   41.44 +-      if test "x$ac_old_val" != "x$ac_new_val"; then
   41.45 ++      if test "`echo $ac_old_val" != "`echo $ac_new_val"; then
   41.46 + 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
   41.47 + echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
   41.48 + 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
   41.49 +diff -ur gdb-6.4/Makefile.in gdb-6.4-patched/Makefile.in
   41.50 +--- gdb-6.4/Makefile.in	2005-12-01 23:29:54.000000000 -0600
   41.51 ++++ gdb-6.4-patched/Makefile.in	2007-02-05 13:22:36.000000000 -0600
   41.52 +@@ -383,7 +383,7 @@
   41.53 + # CFLAGS will be just -g.  We want to ensure that TARGET libraries
   41.54 + # (which we know are built with gcc) are built with optimizations so
   41.55 + # prepend -O2 when setting CFLAGS_FOR_TARGET.
   41.56 +-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
   41.57 ++CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
   41.58 + SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
   41.59 + 
   41.60 + # If GCC_FOR_TARGET is not overriden on the command line, then this
   41.61 +@@ -423,7 +423,7 @@
   41.62 +     fi; \
   41.63 +   fi`
   41.64 + 
   41.65 +-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
   41.66 ++CXXFLAGS_FOR_TARGET = $(strip $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
   41.67 + LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
   41.68 + 
   41.69 + GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET)
   41.70 +diff -ur gdb-6.4/Makefile.tpl gdb-6.4-patched/Makefile.tpl
   41.71 +--- gdb-6.4/Makefile.tpl	2005-10-22 05:37:55.000000000 -0500
   41.72 ++++ gdb-6.4-patched/Makefile.tpl	2007-02-05 13:22:36.000000000 -0600
   41.73 +@@ -386,7 +386,7 @@
   41.74 + # CFLAGS will be just -g.  We want to ensure that TARGET libraries
   41.75 + # (which we know are built with gcc) are built with optimizations so
   41.76 + # prepend -O2 when setting CFLAGS_FOR_TARGET.
   41.77 +-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
   41.78 ++CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
   41.79 + SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
   41.80 + 
   41.81 + # If GCC_FOR_TARGET is not overriden on the command line, then this
   41.82 +@@ -426,7 +426,7 @@
   41.83 +     fi; \
   41.84 +   fi`
   41.85 + 
   41.86 +-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
   41.87 ++CXXFLAGS_FOR_TARGET = $(strip $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
   41.88 + LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
   41.89 + 
   41.90 + GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET)
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/patches/gdb/6.5/100-uclibc-conf.patch	Thu May 17 16:22:51 2007 +0000
    42.3 @@ -0,0 +1,78 @@
    42.4 +--- gdb-6.3/bfd/configure.orig	Fri Oct  8 16:53:56 2004
    42.5 ++++ gdb-6.3/bfd/configure	Sun Feb 27 18:32:58 2005
    42.6 +@@ -3583,6 +3583,11 @@
    42.7 +   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
    42.8 +   ;;
    42.9 + 
   42.10 ++linux-uclibc*)
   42.11 ++  lt_cv_deplibs_check_method=pass_all
   42.12 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   42.13 ++  ;;
   42.14 ++
   42.15 + netbsd* | knetbsd*-gnu)
   42.16 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   42.17 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   42.18 +--- gdb-6.3/libtool.m4.orig	Wed Jul 21 21:21:41 2004
   42.19 ++++ gdb-6.3/libtool.m4	Mon Feb 28 00:08:11 2005
   42.20 +@@ -653,6 +653,11 @@
   42.21 +   fi
   42.22 +   ;;
   42.23 + 
   42.24 ++linux-uclibc*)
   42.25 ++  lt_cv_deplibs_check_method=pass_all
   42.26 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   42.27 ++  ;;
   42.28 ++
   42.29 + newsos6)
   42.30 +   [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
   42.31 +   lt_cv_file_magic_cmd=/usr/bin/file
   42.32 +--- gdb-6.3/ltconfig.orig	Tue Oct  5 15:34:42 2004
   42.33 ++++ gdb-6.3/ltconfig	Sun Feb 27 18:14:41 2005
   42.34 +@@ -602,7 +602,7 @@
   42.35 + 
   42.36 + # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
   42.37 + case $host_os in
   42.38 +-linux-gnu*) ;;
   42.39 ++linux-gnu*|linux-uclibc*) ;;
   42.40 + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
   42.41 + esac
   42.42 + 
   42.43 +@@ -1270,6 +1270,24 @@
   42.44 +   dynamic_linker='GNU/Linux ld.so'
   42.45 +   ;;
   42.46 + 
   42.47 ++linux-uclibc*)
   42.48 ++  version_type=linux
   42.49 ++  need_lib_prefix=no
   42.50 ++  need_version=no
   42.51 ++  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
   42.52 ++  soname_spec='${libname}${release}.so$major'
   42.53 ++  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   42.54 ++  shlibpath_var=LD_LIBRARY_PATH
   42.55 ++  shlibpath_overrides_runpath=no
   42.56 ++  # This implies no fast_install, which is unacceptable.
   42.57 ++  # Some rework will be needed to allow for fast_install
   42.58 ++  # before this can be enabled.
   42.59 ++  # Note: copied from linux-gnu, and may not be appropriate.
   42.60 ++  hardcode_into_libs=yes
   42.61 ++  # Assume using the uClibc dynamic linker.
   42.62 ++  dynamic_linker="uClibc ld.so"
   42.63 ++  ;;
   42.64 ++
   42.65 + netbsd*)
   42.66 +   need_lib_prefix=no
   42.67 +   need_version=no
   42.68 +--- gdb-6.3/opcodes/configure.orig	Fri Sep 17 08:13:38 2004
   42.69 ++++ gdb-6.3/opcodes/configure	Mon Feb 28 00:09:42 2005
   42.70 +@@ -3595,6 +3595,11 @@
   42.71 +   fi
   42.72 +   ;;
   42.73 + 
   42.74 ++linux-uclibc*)
   42.75 ++  lt_cv_deplibs_check_method=pass_all
   42.76 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   42.77 ++  ;;
   42.78 ++
   42.79 + newsos6)
   42.80 +   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
   42.81 +   lt_cv_file_magic_cmd=/usr/bin/file
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/patches/gdb/6.5/200-uclibc-readline-conf.patch	Thu May 17 16:22:51 2007 +0000
    43.3 @@ -0,0 +1,15 @@
    43.4 +--- gdb-6.1.1-dist/readline/configure	2003-05-27 18:29:47.000000000 -0500
    43.5 ++++ gdb-6.1.1/readline/configure	2004-08-09 14:20:23.000000000 -0500
    43.6 +@@ -6249,7 +6249,12 @@
    43.7 + 
    43.8 + 
    43.9 + echo "$as_me:$LINENO: checking for mbstate_t" >&5
   43.10 ++echo $ECHO_N "bash_cv_have_mbstate_t=$bash_cv_have_mbstate_t" >&6
   43.11 + echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
   43.12 ++if test "${bash_cv_have_mbstate_t+set}" != set; then
   43.13 ++  bash_cv_have_mbstate_t=yes
   43.14 ++  echo $ECHO_N "WARNING!! forcing to yes!!! $ECHO_C" >&6
   43.15 ++fi
   43.16 + if test "${bash_cv_have_mbstate_t+set}" = set; then
   43.17 +   echo $ECHO_N "(cached) $ECHO_C" >&6
   43.18 + else
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/patches/gdb/6.5/400-mips-coredump.patch-2.4.23-29	Thu May 17 16:22:51 2007 +0000
    44.3 @@ -0,0 +1,28 @@
    44.4 +Sometime around 2.4.22-23, the mips pt_regs.h fields were reordered, breaking
    44.5 +coredump handling by gdb for current kernels.  Update the hardcoded constants
    44.6 +to reflect the change.
    44.7 +--- gdb-6.2.1/gdb/mips-linux-tdep.c-orig	2004-10-29 14:23:55.000000000 -0500
    44.8 ++++ gdb-6.2.1/gdb/mips-linux-tdep.c	2004-10-29 14:26:44.000000000 -0500
    44.9 +@@ -53,12 +53,22 @@
   44.10 + 
   44.11 + #define EF_REG0			6
   44.12 + #define EF_REG31		37
   44.13 ++
   44.14 ++#if 0
   44.15 + #define EF_LO			38
   44.16 + #define EF_HI			39
   44.17 + #define EF_CP0_EPC		40
   44.18 + #define EF_CP0_BADVADDR		41
   44.19 + #define EF_CP0_STATUS		42
   44.20 + #define EF_CP0_CAUSE		43
   44.21 ++#else
   44.22 ++#define EF_CP0_STATUS		38
   44.23 ++#define EF_LO			39
   44.24 ++#define EF_HI			40
   44.25 ++#define EF_CP0_BADVADDR		41
   44.26 ++#define EF_CP0_CAUSE		42
   44.27 ++#define EF_CP0_EPC		43
   44.28 ++#endif
   44.29 + 
   44.30 + #define EF_SIZE			180
   44.31 + 
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/patches/gdb/6.5/500-thread-timeout.patch	Thu May 17 16:22:51 2007 +0000
    45.3 @@ -0,0 +1,34 @@
    45.4 +--- gdb-6.3.org/gdb/gdbserver/thread-db.c	2004-10-17 02:42:00.000000000 +0900
    45.5 ++++ gdb-6.3/gdb/gdbserver/thread-db.c	2005-01-27 12:19:29.000000000 +0900
    45.6 +@@ -21,6 +21,7 @@
    45.7 +    Foundation, Inc., 59 Temple Place - Suite 330,
    45.8 +    Boston, MA 02111-1307, USA.  */
    45.9 + 
   45.10 ++#include <unistd.h>
   45.11 + #include "server.h"
   45.12 + 
   45.13 + #include "linux-low.h"
   45.14 +@@ -142,6 +143,7 @@
   45.15 +   td_event_msg_t msg;
   45.16 +   td_err_e err;
   45.17 +   struct inferior_linux_data *tdata;
   45.18 ++  int timeout;
   45.19 + 
   45.20 +   if (debug_threads)
   45.21 +     fprintf (stderr, "Thread creation event.\n");
   45.22 +@@ -152,7 +154,13 @@
   45.23 +      In the LinuxThreads implementation, this is safe,
   45.24 +      because all events come from the manager thread
   45.25 +      (except for its own creation, of course).  */
   45.26 +-  err = td_ta_event_getmsg (thread_agent, &msg);
   45.27 ++  for (timeout = 0; timeout < 50000; timeout++)
   45.28 ++    {
   45.29 ++      err = td_ta_event_getmsg (thread_agent, &msg);
   45.30 ++      if (err != TD_NOMSG)
   45.31 ++	break;
   45.32 ++      usleep(1000);
   45.33 ++    }
   45.34 +   if (err != TD_OK)
   45.35 +     fprintf (stderr, "thread getmsg err: %s\n",
   45.36 + 	     thread_db_err_str (err));
   45.37 +
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/patches/gdb/6.5/600-fix-compile-flag-mismatch.patch	Thu May 17 16:22:51 2007 +0000
    46.3 @@ -0,0 +1,69 @@
    46.4 +diff -ur gdb-6.4/gdb/configure gdb-6.4-patched/gdb/configure
    46.5 +--- gdb-6.4/gdb/configure	2005-07-25 10:08:40.000000000 -0500
    46.6 ++++ gdb-6.4-patched/gdb/configure	2007-02-05 13:22:36.000000000 -0600
    46.7 +@@ -309,7 +309,7 @@
    46.8 + # include <unistd.h>
    46.9 + #endif"
   46.10 + 
   46.11 +-ac_subdirs_all="$ac_subdirs_all doc testsuite"
   46.12 ++ac_subdirs_all="$ac_subdirs_all doc"
   46.13 + ac_subdirs_all="$ac_subdirs_all gdbtk"
   46.14 + ac_subdirs_all="$ac_subdirs_all multi-ice"
   46.15 + ac_subdirs_all="$ac_subdirs_all gdbserver"
   46.16 +@@ -5940,7 +5940,7 @@
   46.17 + 
   46.18 + 
   46.19 + 
   46.20 +-subdirs="$subdirs doc testsuite"
   46.21 ++subdirs="$subdirs doc"
   46.22 + 
   46.23 + 
   46.24 + . $srcdir/configure.host
   46.25 +diff -ur gdb-6.4/gdb/gdbserver/configure gdb-6.4-patched/gdb/gdbserver/configure
   46.26 +--- gdb-6.4/gdb/gdbserver/configure	2005-09-17 18:14:37.000000000 -0500
   46.27 ++++ gdb-6.4-patched/gdb/gdbserver/configure	2007-02-05 13:22:58.000000000 -0600
   46.28 +@@ -1239,7 +1239,7 @@
   46.29 +       ac_cache_corrupted=: ;;
   46.30 +     ,);;
   46.31 +     *)
   46.32 +-      if test "x$ac_old_val" != "x$ac_new_val"; then
   46.33 ++      if test "`echo $ac_old_val`" != "`echo $ac_new_val`"; then
   46.34 + 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
   46.35 + echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
   46.36 + 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
   46.37 +diff -ur gdb-6.4/gdb/testsuite/configure gdb-6.4-patched/gdb/testsuite/configure
   46.38 +--- gdb-6.4/gdb/testsuite/configure	2005-04-11 09:13:12.000000000 -0500
   46.39 ++++ gdb-6.4-patched/gdb/testsuite/configure	2007-02-05 13:22:36.000000000 -0600
   46.40 +@@ -1248,7 +1248,7 @@
   46.41 +       ac_cache_corrupted=: ;;
   46.42 +     ,);;
   46.43 +     *)
   46.44 +-      if test "x$ac_old_val" != "x$ac_new_val"; then
   46.45 ++      if test "`echo $ac_old_val" != "`echo $ac_new_val"; then
   46.46 + 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
   46.47 + echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
   46.48 + 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
   46.49 +diff -ur gdb-6.4/Makefile.in gdb-6.4-patched/Makefile.in
   46.50 +--- gdb-6.4/Makefile.in	2005-12-01 23:29:54.000000000 -0600
   46.51 ++++ gdb-6.4-patched/Makefile.in	2007-02-05 13:22:36.000000000 -0600
   46.52 +@@ -383,7 +383,7 @@
   46.53 + # CFLAGS will be just -g.  We want to ensure that TARGET libraries
   46.54 + # (which we know are built with gcc) are built with optimizations so
   46.55 + # prepend -O2 when setting CFLAGS_FOR_TARGET.
   46.56 +-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
   46.57 ++CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
   46.58 + SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
   46.59 + 
   46.60 + # If GCC_FOR_TARGET is not overriden on the command line, then this
   46.61 +diff -ur gdb-6.4/Makefile.tpl gdb-6.4-patched/Makefile.tpl
   46.62 +--- gdb-6.4/Makefile.tpl	2005-10-22 05:37:55.000000000 -0500
   46.63 ++++ gdb-6.4-patched/Makefile.tpl	2007-02-05 13:22:36.000000000 -0600
   46.64 +@@ -386,7 +386,7 @@
   46.65 + # CFLAGS will be just -g.  We want to ensure that TARGET libraries
   46.66 + # (which we know are built with gcc) are built with optimizations so
   46.67 + # prepend -O2 when setting CFLAGS_FOR_TARGET.
   46.68 +-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
   46.69 ++CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
   46.70 + SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
   46.71 + 
   46.72 + # If GCC_FOR_TARGET is not overriden on the command line, then this
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/patches/gdb/6.6/100-uclibc-conf.patch	Thu May 17 16:22:51 2007 +0000
    47.3 @@ -0,0 +1,82 @@
    47.4 +diff -rNdup gdb-6.6.orig/bfd/configure gdb-6.6/bfd/configure
    47.5 +--- gdb-6.6.orig/bfd/configure	2006-10-25 08:49:20.000000000 +0200
    47.6 ++++ gdb-6.6/bfd/configure	2007-05-14 10:35:50.000000000 +0200
    47.7 +@@ -3579,6 +3579,11 @@ linux-gnu*)
    47.8 +   lt_cv_deplibs_check_method=pass_all
    47.9 +   ;;
   47.10 + 
   47.11 ++linux-uclibc*)
   47.12 ++  lt_cv_deplibs_check_method=pass_all
   47.13 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   47.14 ++  ;;
   47.15 ++
   47.16 + netbsd* | knetbsd*-gnu)
   47.17 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   47.18 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   47.19 +diff -rNdup gdb-6.6.orig/libtool.m4 gdb-6.6/libtool.m4
   47.20 +--- gdb-6.6.orig/libtool.m4	2005-12-27 17:37:57.000000000 +0100
   47.21 ++++ gdb-6.6/libtool.m4	2007-05-14 10:35:50.000000000 +0200
   47.22 +@@ -751,6 +751,11 @@ netbsd* | knetbsd*-gnu)
   47.23 +   fi
   47.24 +   ;;
   47.25 + 
   47.26 ++linux-uclibc*)
   47.27 ++  lt_cv_deplibs_check_method=pass_all
   47.28 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   47.29 ++  ;;
   47.30 ++
   47.31 + newsos6)
   47.32 +   [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
   47.33 +   lt_cv_file_magic_cmd=/usr/bin/file
   47.34 +diff -rNdup gdb-6.6.orig/ltconfig gdb-6.6/ltconfig
   47.35 +--- gdb-6.6.orig/ltconfig	2006-07-04 22:31:03.000000000 +0200
   47.36 ++++ gdb-6.6/ltconfig	2007-05-14 10:35:50.000000000 +0200
   47.37 +@@ -602,7 +602,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
   47.38 + 
   47.39 + # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
   47.40 + case $host_os in
   47.41 +-linux-gnu*) ;;
   47.42 ++linux-gnu*|linux-uclibc*) ;;
   47.43 + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
   47.44 + esac
   47.45 + 
   47.46 +@@ -1270,6 +1270,24 @@ linux-gnu*)
   47.47 +   dynamic_linker='GNU/Linux ld.so'
   47.48 +   ;;
   47.49 + 
   47.50 ++linux-uclibc*)
   47.51 ++  version_type=linux
   47.52 ++  need_lib_prefix=no
   47.53 ++  need_version=no
   47.54 ++  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
   47.55 ++  soname_spec='${libname}${release}.so$major'
   47.56 ++  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   47.57 ++  shlibpath_var=LD_LIBRARY_PATH
   47.58 ++  shlibpath_overrides_runpath=no
   47.59 ++  # This implies no fast_install, which is unacceptable.
   47.60 ++  # Some rework will be needed to allow for fast_install
   47.61 ++  # before this can be enabled.
   47.62 ++  # Note: copied from linux-gnu, and may not be appropriate.
   47.63 ++  hardcode_into_libs=yes
   47.64 ++  # Assume using the uClibc dynamic linker.
   47.65 ++  dynamic_linker="uClibc ld.so"
   47.66 ++  ;;
   47.67 ++
   47.68 + netbsd*)
   47.69 +   need_lib_prefix=no
   47.70 +   need_version=no
   47.71 +diff -rNdup gdb-6.6.orig/opcodes/configure gdb-6.6/opcodes/configure
   47.72 +--- gdb-6.6.orig/opcodes/configure	2006-10-25 08:49:20.000000000 +0200
   47.73 ++++ gdb-6.6/opcodes/configure	2007-05-14 10:35:50.000000000 +0200
   47.74 +@@ -3590,6 +3590,11 @@ netbsd* | knetbsd*-gnu)
   47.75 +   fi
   47.76 +   ;;
   47.77 + 
   47.78 ++linux-uclibc*)
   47.79 ++  lt_cv_deplibs_check_method=pass_all
   47.80 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   47.81 ++  ;;
   47.82 ++
   47.83 + newsos6)
   47.84 +   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
   47.85 +   lt_cv_file_magic_cmd=/usr/bin/file
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/patches/gdb/6.6/600-fix-compile-flag-mismatch.patch	Thu May 17 16:22:51 2007 +0000
    48.3 @@ -0,0 +1,69 @@
    48.4 +diff -rduNp gdb-6.6-100/Makefile.in gdb-6.6/Makefile.in
    48.5 +--- gdb-6.6-100/Makefile.in	2006-12-18 08:21:19.000000000 +0100
    48.6 ++++ gdb-6.6/Makefile.in	2007-05-14 10:54:29.000000000 +0200
    48.7 +@@ -331,7 +331,7 @@ COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_
    48.8 + # CFLAGS will be just -g.  We want to ensure that TARGET libraries
    48.9 + # (which we know are built with gcc) are built with optimizations so
   48.10 + # prepend -O2 when setting CFLAGS_FOR_TARGET.
   48.11 +-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
   48.12 ++CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
   48.13 + SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
   48.14 + CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
   48.15 + LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
   48.16 +diff -rduNp gdb-6.6-100/Makefile.tpl gdb-6.6/Makefile.tpl
   48.17 +--- gdb-6.6-100/Makefile.tpl	2006-11-15 00:26:39.000000000 +0100
   48.18 ++++ gdb-6.6/Makefile.tpl	2007-05-14 10:54:29.000000000 +0200
   48.19 +@@ -334,7 +334,7 @@ COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_
   48.20 + # CFLAGS will be just -g.  We want to ensure that TARGET libraries
   48.21 + # (which we know are built with gcc) are built with optimizations so
   48.22 + # prepend -O2 when setting CFLAGS_FOR_TARGET.
   48.23 +-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
   48.24 ++CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
   48.25 + SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
   48.26 + CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
   48.27 + LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
   48.28 +diff -rduNp gdb-6.6-100/gdb/configure gdb-6.6/gdb/configure
   48.29 +--- gdb-6.6-100/gdb/configure	2006-12-17 16:38:59.000000000 +0100
   48.30 ++++ gdb-6.6/gdb/configure	2007-05-14 10:55:41.000000000 +0200
   48.31 +@@ -272,7 +272,7 @@ PACKAGE_STRING=
   48.32 + PACKAGE_BUGREPORT=
   48.33 + 
   48.34 + ac_unique_file="main.c"
   48.35 +-ac_subdirs_all="$ac_subdirs_all doc testsuite"
   48.36 ++ac_subdirs_all="$ac_subdirs_all doc"
   48.37 + # Factoring default headers for most tests.
   48.38 + ac_includes_default="\
   48.39 + #include <stdio.h>
   48.40 +@@ -3055,7 +3055,7 @@ _ACEOF
   48.41 + 
   48.42 + 
   48.43 + 
   48.44 +-subdirs="$subdirs doc testsuite"
   48.45 ++subdirs="$subdirs doc"
   48.46 + 
   48.47 + 
   48.48 + # Provide defaults for some variables set by the per-host and per-target
   48.49 +diff -rduNp gdb-6.6-100/gdb/gdbserver/configure gdb-6.6/gdb/gdbserver/configure
   48.50 +--- gdb-6.6-100/gdb/gdbserver/configure	2006-11-22 01:10:19.000000000 +0100
   48.51 ++++ gdb-6.6/gdb/gdbserver/configure	2007-05-14 10:54:29.000000000 +0200
   48.52 +@@ -1239,7 +1239,7 @@ echo "$as_me: error: \`$ac_var' was not 
   48.53 +       ac_cache_corrupted=: ;;
   48.54 +     ,);;
   48.55 +     *)
   48.56 +-      if test "x$ac_old_val" != "x$ac_new_val"; then
   48.57 ++      if test "`echo $ac_old_val`" != "`echo $ac_new_val`"; then
   48.58 + 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
   48.59 + echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
   48.60 + 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
   48.61 +diff -rduNp gdb-6.6-100/gdb/testsuite/configure gdb-6.6/gdb/testsuite/configure
   48.62 +--- gdb-6.6-100/gdb/testsuite/configure	2006-06-21 15:57:21.000000000 +0200
   48.63 ++++ gdb-6.6/gdb/testsuite/configure	2007-05-14 10:54:29.000000000 +0200
   48.64 +@@ -1248,7 +1248,7 @@ echo "$as_me: error: \`$ac_var' was not 
   48.65 +       ac_cache_corrupted=: ;;
   48.66 +     ,);;
   48.67 +     *)
   48.68 +-      if test "x$ac_old_val" != "x$ac_new_val"; then
   48.69 ++      if test "`echo $ac_old_val" != "`echo $ac_new_val"; then
   48.70 + 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
   48.71 + echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
   48.72 + 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/scripts/build/debug.sh	Thu May 17 16:22:51 2007 +0000
    49.3 @@ -0,0 +1,34 @@
    49.4 +# Wrapper to build the debug facilities
    49.5 +
    49.6 +# List all debug facilities, and parse their scripts
    49.7 +CT_DEBUG_FACILITY_LIST=
    49.8 +for f in "${CT_TOP_DIR}/scripts/build/debug/"*.sh; do
    49.9 +    is_enabled=
   49.10 +    . "${f}"
   49.11 +    f=`basename "${f}" .sh`
   49.12 +    if [ "${is_enabled}" = "y" ]; then
   49.13 +        CT_DEBUG_FACILITY_LIST="${CT_DEBUG_FACILITY_LIST} ${f}"
   49.14 +    fi
   49.15 +done
   49.16 +
   49.17 +# Download the debug facilities
   49.18 +do_debug_get() {
   49.19 +    for f in ${CT_DEBUG_FACILITY_LIST}; do
   49.20 +        do_debug_${f}_get
   49.21 +    done
   49.22 +}
   49.23 +
   49.24 +# Extract and patch the debug facilities
   49.25 +do_debug_extract() {
   49.26 +    for f in ${CT_DEBUG_FACILITY_LIST}; do
   49.27 +        do_debug_${f}_extract
   49.28 +    done
   49.29 +}
   49.30 +
   49.31 +# Build the debug facilities
   49.32 +do_debug() {
   49.33 +    for f in ${CT_DEBUG_FACILITY_LIST}; do
   49.34 +        do_debug_${f}_build
   49.35 +    done
   49.36 +}
   49.37 +
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/scripts/build/debug/gdb.sh	Thu May 17 16:22:51 2007 +0000
    50.3 @@ -0,0 +1,124 @@
    50.4 +# Build script for the gdb debug facility
    50.5 +
    50.6 +is_enabled="${CT_GDB}"
    50.7 +
    50.8 +do_debug_gdb_suffix() {
    50.9 +    case "${CT_GDB_VERSION}" in
   50.10 +        snapshot)   ;;
   50.11 +        *)          echo "-${CT_GDB_VERSION}";;
   50.12 +    esac
   50.13 +}
   50.14 +
   50.15 +do_debug_gdb_get() {
   50.16 +    CT_GetFile "gdb`do_debug_gdb_suffix`"                           \
   50.17 +               ftp://ftp.gnu.org/pub/gnu/gdb                        \
   50.18 +               ftp://sources.redhat.com/pub/gdb/releases            \
   50.19 +               ftp://sources.redhat.com/pub/gdb/old-releases        \
   50.20 +               ftp://sources.redhat.com/pub/gdb/snapshots/current 
   50.21 +}
   50.22 +
   50.23 +do_debug_gdb_extract() {
   50.24 +    CT_ExtractAndPatch "gdb`do_debug_gdb_suffix`"
   50.25 +}
   50.26 +
   50.27 +do_debug_gdb_build() {
   50.28 +    gdb_src_dir="${CT_SRC_DIR}/gdb`do_debug_gdb_suffix`"
   50.29 +
   50.30 +    extra_config=
   50.31 +    # Version 6.3 and below behave badly with gdbmi
   50.32 +    case "${CT_GDB_VERSION}" in
   50.33 +        6.2*|6.3)   extra_config="${extra_config} --disable-gdbmi";;
   50.34 +    esac
   50.35 +
   50.36 +    if [ "${CT_GDB_CROSS}" = "y" ]; then
   50.37 +        CT_DoStep EXTRA "Installing cross-gdb"
   50.38 +        CT_DoLog EXTRA "Configuring cross-gdb"
   50.39 +
   50.40 +        mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
   50.41 +        cd "${CT_BUILD_DIR}/build-gdb-cross"
   50.42 +
   50.43 +        "${gdb_src_dir}/configure"                      \
   50.44 +            --build=${CT_BUILD}                         \
   50.45 +            --host=${CT_HOST}                           \
   50.46 +            --target=${CT_TARGET}                       \
   50.47 +            --prefix="${CT_INSTALL_DIR}"                \
   50.48 +            --with-build-sysroot="${CT_SYSROOT_DIR}"    \
   50.49 +            --enable-threads                            \
   50.50 +            ${extra_config}                             2>&1 |CT_DoLog ALL
   50.51 +
   50.52 +        CT_DoLog EXTRA "Building cross-gdb"
   50.53 +        make ${PARALLELMFLAGS}                          2>&1 |CT_DoLog ALL
   50.54 +
   50.55 +        CT_DoLog EXTRA "Installing cross-gdb"
   50.56 +        make install                                    2>&1 |CT_DoLog ALL
   50.57 +
   50.58 +        CT_EndStep
   50.59 +
   50.60 +        CT_DoStep EXTRA "Installing gdbserver"
   50.61 +        CT_DoLog EXTRA "Configuring gdbserver"
   50.62 +
   50.63 +        mkdir -p "${CT_BUILD_DIR}/build-gdb-gdbserver"
   50.64 +        cd "${CT_BUILD_DIR}/build-gdb-gdbserver"
   50.65 +
   50.66 +        # Workaround for bad versions, where the configure
   50.67 +        # script for gdbserver is not executable...
   50.68 +        # Bah, GNU folks strike again... :-(
   50.69 +        chmod +x "${gdb_src_dir}/gdb/gdbserver/configure"
   50.70 +
   50.71 +        "${gdb_src_dir}/gdb/gdbserver/configure"        \
   50.72 +            --build=${CT_BUILD}                         \
   50.73 +            --host=${CT_TARGET}                         \
   50.74 +            --target=${CT_TARGET}                       \
   50.75 +            --prefix=/usr                               \
   50.76 +            --sysconfdir=/etc                           \
   50.77 +            --localstatedir=/var                        \
   50.78 +            --includedir="${CT_HEADERS_DIR}"            \
   50.79 +            --with-build-sysroot="${CT_SYSROOT_DIR}"    \
   50.80 +            --program-prefix=                           \
   50.81 +            --without-uiout                             \
   50.82 +            --disable-tui                               \
   50.83 +            --disable-gdbtk                             \
   50.84 +            --without-x                                 \
   50.85 +            --without-included-gettext                  \
   50.86 +            ${extra_config}                             2>&1 |CT_DoLog ALL
   50.87 +
   50.88 +        CT_DoLog EXTRA "Building gdbserver"
   50.89 +        make ${PARALLELMFLAGS} CC=${CT_TARGET}-gcc      2>&1 |CT_DoLog ALL
   50.90 +
   50.91 +        CT_DoLog EXTRA "Installing gdbserver"
   50.92 +        make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install  2>&1 |CT_DoLog ALL
   50.93 +
   50.94 +        CT_EndStep
   50.95 +    fi
   50.96 +
   50.97 +    if [ "${CT_GDB_NATIVE}" = "y" ]; then
   50.98 +        CT_DoStep EXTRA "Installing native gdb"
   50.99 +        CT_DoLog EXTRA "Configuring native gdb"
  50.100 +
  50.101 +        mkdir -p "${CT_BUILD_DIR}/build-gdb-cross"
  50.102 +        cd "${CT_BUILD_DIR}/build-gdb-cross"
  50.103 +
  50.104 +        "${gdb_src_dir}/configure"                      \
  50.105 +            --build=${CT_BUILD}                         \
  50.106 +            --host=${CT_TARGET}                         \
  50.107 +            --target=${CT_TARGET}                       \
  50.108 +            --prefix=/usr                               \
  50.109 +            --with-build-sysroot="${CT_SYSROOT_DIR}"    \
  50.110 +            --without-uiout                             \
  50.111 +            --disable-tui                               \
  50.112 +            --disable-gdbtk                             \
  50.113 +            --without-x                                 \
  50.114 +            --disable-sim                               \
  50.115 +            --enable-gdbserver                          \
  50.116 +            --without-included-gettext                  \
  50.117 +            ${extra_config}                             2>&1 |CT_DoLog ALL
  50.118 +
  50.119 +        CT_DoLog EXTRA "Building native gdb"
  50.120 +        make ${PARALLELMFLAGS} CC=${CT_TARGET}-gcc      2>&1 |CT_DoLog ALL
  50.121 +
  50.122 +        CT_DoLog EXTRA "Installing native gdb"
  50.123 +        make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install  2>&1 |CT_DoLog ALL
  50.124 +
  50.125 +        CT_EndStep
  50.126 +    fi
  50.127 +}
    51.1 --- a/scripts/build/kernel_linux.sh	Mon May 14 19:59:41 2007 +0000
    51.2 +++ b/scripts/build/kernel_linux.sh	Thu May 17 16:22:51 2007 +0000
    51.3 @@ -117,6 +117,8 @@
    51.4           INSTALL_HDR_PATH="${CT_SYSROOT_DIR}/usr"   \
    51.5           ${V_OPT}                                   \
    51.6           headers_check                              2>&1 |CT_DoLog ALL
    51.7 +
    51.8 +    find "${CT_SYSROOT_DIR}" -type f -name '.check*' -exec rm {} \;
    51.9  }
   51.10  
   51.11  # Install kernel headers from oldish Mazur's sanitised headers.
    52.1 --- a/scripts/crosstool.sh	Mon May 14 19:59:41 2007 +0000
    52.2 +++ b/scripts/crosstool.sh	Thu May 17 16:22:51 2007 +0000
    52.3 @@ -10,14 +10,14 @@
    52.4  
    52.5  # What this file does is prepare the environment, based upon the user-choosen
    52.6  # options. It also checks the existing environment for un-friendly variables,
    52.7 -# and checks for needed tools. It eventually calls the main build script.
    52.8 +# and builds the tools.
    52.9  
   52.10 -# User must set CT_TOP_DIR in is environment!
   52.11 -# Once we can build out-of-tree, then this will have to go.
   52.12 +# CT_TOP_DIR is set by the makefile. If we don't have it, something's gone horribly wrong...
   52.13  if [ -z "${CT_TOP_DIR}" -o ! -d "${CT_TOP_DIR}" ]; then
   52.14      # We don't have the functions right now, because we don't have CT_TOP_DIR.
   52.15      # Do the print stuff by hand:
   52.16 -    echo "CT_TOP_DIR not set. You must set CT_TOP_DIR to the top directory where crosstool is installed."
   52.17 +    echo "CT_TOP_DIR not set, or not a directory. Something's gone horribly wrong."
   52.18 +    echo "Please send a bug report (see README)"
   52.19      exit 1
   52.20  fi
   52.21  
   52.22 @@ -30,34 +30,22 @@
   52.23  # Log to a temporary file until we have built our environment
   52.24  CT_ACTUAL_LOG_FILE="${CT_TOP_DIR}/$$.log"
   52.25  
   52.26 +# Are we configured? We'll need that later...
   52.27 +CT_TestOrAbort "Configuration file not found. Please create one." -f "${CT_TOP_DIR}/.config"
   52.28 +
   52.29  # Parse the configuration file
   52.30 -CT_TestOrAbort "Configuration file not found. Please create one." -f "${CT_TOP_DIR}/.config"
   52.31 +# It has some info about the logging facility, so include it early
   52.32  . "${CT_TOP_DIR}/.config"
   52.33  
   52.34 -# Override the color scheme if needed
   52.35 -if [ "${CT_LOG_USE_COLORS}" = "y" ]; then
   52.36 -    CT_ERROR_COLOR="${_A_NOR}${_A_BRI}${_F_RED}"
   52.37 -    CT_WARN_COLOR="${_A_NOR}${_A_BRI}${_F_YEL}"
   52.38 -    CT_INFO_COLOR="${_A_NOR}${_A_BRI}${_F_GRN}"
   52.39 -    CT_EXTRA_COLOR="${_A_NOR}${_A_DIM}${_F_GRN}"
   52.40 -    CT_DEBUG_COLOR="${_A_NOR}${_A_BRI}${_F_BLU}"
   52.41 -    CT_ALL_COLOR="${_A_NOR}${_A_DIM}${_F_WHI}"
   52.42 -    CT_NORMAL_COLOR="${_A_NOR}"
   52.43 -else
   52.44 -    CT_ERROR_COLOR=
   52.45 -    CT_WARN_COLOR=
   52.46 -    CT_INFO_COLOR=
   52.47 -    CT_EXTRA_COLOR=
   52.48 -    CT_DEBUG_COLOR=
   52.49 -    CT_ALL_COLOR=
   52.50 -    CT_NORMAL_COLOR=
   52.51 -fi
   52.52 +# renice oursleves
   52.53 +renice ${CT_NICE} $$ |CT_DoLog DEBUG
   52.54  
   52.55  # Yes! We can do full logging from now on!
   52.56  CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
   52.57  
   52.58 -# renice oursleves
   52.59 -renice ${CT_NICE} $$ |CT_DoLog DEBUG
   52.60 +CT_DoStep DEBUG "Dumping crosstool-NG configuration"
   52.61 +cat ${CT_TOP_DIR}/.config |egrep '^(# |)CT_' |CT_DoLog DEBUG
   52.62 +CT_EndStep
   52.63  
   52.64  # Some sanity checks in the environment and needed tools
   52.65  CT_DoLog INFO "Checking environment sanity"
   52.66 @@ -89,15 +77,15 @@
   52.67  CT_HasOrAbort bison
   52.68  CT_HasOrAbort flex
   52.69  
   52.70 -CT_DoStep DEBUG "Dumping crosstool-NG configuration"
   52.71 -cat ${CT_TOP_DIR}/.config |egrep '^(# |)CT_' |CT_DoLog DEBUG
   52.72 -CT_EndStep
   52.73 -
   52.74  CT_DoLog INFO "Building environment variables"
   52.75  
   52.76  # Target triplet: CT_TARGET needs a little love:
   52.77  CT_DoBuildTargetTriplet
   52.78  
   52.79 +# Kludge: If any of the configured options needs CT_TARGET,
   52.80 +# then rescan the options file now:
   52.81 +. "${CT_TOP_DIR}/.config"
   52.82 +
   52.83  # Now, build up the variables from the user-configured options.
   52.84  CT_KERNEL_FILE="${CT_KERNEL}-${CT_KERNEL_VERSION}"
   52.85  CT_BINUTILS_FILE="binutils-${CT_BINUTILS_VERSION}"
   52.86 @@ -111,14 +99,11 @@
   52.87  CT_LIBC_FILE="${CT_LIBC}-${CT_LIBC_VERSION}"
   52.88  [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] && CT_LIBFLOAT_FILE="libfloat-990616"
   52.89  
   52.90 -# Kludge: If any of the configured options needs CT_TARGET,
   52.91 -# then rescan the options file now:
   52.92 -. "${CT_TOP_DIR}/.config"
   52.93 -
   52.94  # Where will we work?
   52.95  CT_TARBALLS_DIR="${CT_TOP_DIR}/targets/tarballs"
   52.96  CT_SRC_DIR="${CT_TOP_DIR}/targets/${CT_TARGET}/src"
   52.97  CT_BUILD_DIR="${CT_TOP_DIR}/targets/${CT_TARGET}/build"
   52.98 +CT_DEBUG_INSTALL_DIR="${CT_INSTALL_DIR}/${CT_TARGET}/debug-root"
   52.99  
  52.100  # Make all path absolute, it so much easier!
  52.101  CT_LOCAL_TARBALLS_DIR="`CT_MakeAbsolutePath \"${CT_LOCAL_TARBALLS_DIR}\"`"
  52.102 @@ -133,25 +118,52 @@
  52.103      CT_TestAndAbort "Destination directory \"${CT_INSTALL_DIR}\" is not removable" ! -w `dirname "${CT_INSTALL_DIR}"`
  52.104  fi
  52.105  
  52.106 +# Good, now grab a bit of informations on the system we're being run on,
  52.107 +# just in case something goes awok, and it's not our fault:
  52.108 +CT_SYS_USER="`id -un`"
  52.109 +CT_SYS_HOSTNAME=`hostname -f 2>/dev/null || true`
  52.110 +# Hmmm. Some non-DHCP-enabled machines do not have an FQDN... Fall back to node name.
  52.111 +CT_SYS_HOSTNAME="${CT_SYS_HOSTNAME:-`uname -n`}"
  52.112 +CT_SYS_KERNEL=`uname -s`
  52.113 +CT_SYS_REVISION=`uname -r`
  52.114 +# MacOS X lacks '-o' :
  52.115 +CT_SYS_OS=`uname -o || echo "Unknown (maybe MacOS-X)"`
  52.116 +CT_SYS_MACHINE=`uname -m`
  52.117 +CT_SYS_PROCESSOR=`uname -p`
  52.118 +CT_SYS_GCC=`gcc -dumpversion`
  52.119 +CT_SYS_TARGET=`${CT_TOP_DIR}/tools/config.guess`
  52.120 +CT_TOOLCHAIN_ID="crosstool-${CT_VERSION} build ${CT_STAR_DATE_HUMAN} by ${CT_SYS_USER}@${CT_SYS_HOSTNAME}"
  52.121 +
  52.122 +CT_DoLog EXTRA "Preparing working directories"
  52.123 +
  52.124  # Get rid of pre-existing installed toolchain and previous build directories.
  52.125  # We need to do that _before_ we can safely log, because the log file will
  52.126  # most probably be in the toolchain directory.
  52.127  if [ "${CT_FORCE_DOWNLOAD}" = "y" -a -d "${CT_TARBALLS_DIR}" ]; then
  52.128      mv "${CT_TARBALLS_DIR}" "${CT_TARBALLS_DIR}.$$"
  52.129 +    chmod -R u+w "${CT_TARBALLS_DIR}.$$"
  52.130      nohup rm -rf "${CT_TARBALLS_DIR}.$$" >/dev/null 2>&1 &
  52.131  fi
  52.132  if [ "${CT_FORCE_EXTRACT}" = "y" -a -d "${CT_SRC_DIR}" ]; then
  52.133      mv "${CT_SRC_DIR}" "${CT_SRC_DIR}.$$"
  52.134 +    chmod -R u+w "${CT_SRC_DIR}.$$"
  52.135      nohup rm -rf "${CT_SRC_DIR}.$$" >/dev/null 2>&1 &
  52.136  fi
  52.137  if [ -d "${CT_BUILD_DIR}" ]; then
  52.138      mv "${CT_BUILD_DIR}" "${CT_BUILD_DIR}.$$"
  52.139 +    chmod -R u+w "${CT_BUILD_DIR}.$$"
  52.140      nohup rm -rf "${CT_BUILD_DIR}.$$" >/dev/null 2>&1 &
  52.141  fi
  52.142  if [ -d "${CT_INSTALL_DIR}" ]; then
  52.143      mv "${CT_INSTALL_DIR}" "${CT_INSTALL_DIR}.$$"
  52.144 +    chmod -R u+w "${CT_INSTALL_DIR}.$$"
  52.145      nohup rm -rf "${CT_INSTALL_DIR}.$$" >/dev/null 2>&1 &
  52.146  fi
  52.147 +if [ -d "${CT_DEBUG_INSTALL_DIR}" ]; then
  52.148 +    mv "${CT_DEBUG_INSTALL_DIR}" "${CT_DEBUG_INSTALL_DIR}.$$"
  52.149 +    chmod -R u+w "${CT_DEBUG_INSTALL_DIR}.$$"
  52.150 +    nohup rm -rf "${CT_DEBUG_INSTALL_DIR}.$$" >/dev/null 2>&1 &
  52.151 +fi
  52.152  
  52.153  # Note: we'll always install the core compiler in its own directory, so as to
  52.154  # not mix the two builds: core and final. Anyway, its generic, wether we use
  52.155 @@ -163,24 +175,9 @@
  52.156  mkdir -p "${CT_SRC_DIR}"
  52.157  mkdir -p "${CT_BUILD_DIR}"
  52.158  mkdir -p "${CT_INSTALL_DIR}"
  52.159 +mkdir -p "${CT_DEBUG_INSTALL_DIR}"
  52.160  mkdir -p "${CT_CC_CORE_PREFIX_DIR}"
  52.161  
  52.162 -# Good, now grab a bit of informations on the system we're being run,
  52.163 -# just in case something goes awok, and it's not our fault:
  52.164 -CT_SYS_HOSTNAME=`hostname -f 2>/dev/null || true`
  52.165 -# Hmmm. Some non-DHCP-enabled machines do not have an FQDN... Fall back to node name.
  52.166 -CT_SYS_HOSTNAME="${CT_SYS_HOSTNAME:-`uname -n`}"
  52.167 -CT_SYS_KERNEL=`uname -s`
  52.168 -CT_SYS_REVISION=`uname -r`
  52.169 -# MacOS X lacks '-o' :
  52.170 -CT_SYS_OS=`uname -o || echo "Unknown (maybe MacOS-X)"`
  52.171 -CT_SYS_MACHINE=`uname -m`
  52.172 -CT_SYS_PROCESSOR=`uname -p`
  52.173 -CT_SYS_USER="`id -un`"
  52.174 -CT_SYS_DATE=`CT_DoDate +%Y%m%d.%H%M%S`
  52.175 -CT_SYS_GCC=`gcc -dumpversion`
  52.176 -CT_TOOLCHAIN_ID="crosstool-${CT_VERSION} build ${CT_SYS_DATE} by ${CT_SYS_USER}@${CT_SYS_HOSTNAME}"
  52.177 -
  52.178  # Redirect log to the actual log file now we can
  52.179  # It's quite understandable that the log file will be installed in the install
  52.180  # directory, so we must first ensure it exists and is writeable (above) before
  52.181 @@ -270,9 +267,11 @@
  52.182  # Do that:
  52.183  CT_DoLog EXTRA "Making build system tools available"
  52.184  mkdir -p "${CT_PREFIX_DIR}/bin"
  52.185 -for tool in ar; do
  52.186 +for tool in ar gcc; do
  52.187      ln -s "`which ${tool}`" "${CT_PREFIX_DIR}/bin/${CT_BUILD}-${tool}"
  52.188 -    ln -s "`which ${tool}`" "${CT_PREFIX_DIR}/bin/${CT_HOST}-${tool}"
  52.189 +    case "${CT_TOOLCHAIN_TYPE}" in
  52.190 +        cross|native)   ln -s "`which ${tool}`" "${CT_PREFIX_DIR}/bin/${CT_HOST}-${tool}";;
  52.191 +    esac
  52.192  done
  52.193  
  52.194  # Ha. cygwin host have an .exe suffix (extension) for executables.
  52.195 @@ -317,6 +316,7 @@
  52.196  . "${CT_TOP_DIR}/scripts/build/libc_${CT_LIBC}.sh"
  52.197  . "${CT_TOP_DIR}/scripts/build/cc_core_${CT_CC_CORE}.sh"
  52.198  . "${CT_TOP_DIR}/scripts/build/cc_${CT_CC}.sh"
  52.199 +. "${CT_TOP_DIR}/scripts/build/debug.sh"
  52.200  
  52.201  # Now for the job by itself. Go have a coffee!
  52.202  CT_DoStep INFO "Retrieving needed toolchain components' tarballs"
  52.203 @@ -326,6 +326,7 @@
  52.204  do_libfloat_get
  52.205  do_libc_get
  52.206  do_cc_get
  52.207 +do_debug_get
  52.208  CT_EndStep
  52.209  
  52.210  if [ "${CT_ONLY_DOWNLOAD}" != "y" ]; then
  52.211 @@ -336,10 +337,11 @@
  52.212      CT_DoStep INFO "Extracting and patching toolchain components"
  52.213      do_kernel_extract
  52.214      do_binutils_extract
  52.215 +    do_cc_core_extract
  52.216 +    do_libfloat_extract
  52.217      do_libc_extract
  52.218 -    do_libfloat_extract
  52.219 -    do_cc_core_extract
  52.220      do_cc_extract
  52.221 +    do_debug_extract
  52.222      CT_EndStep
  52.223  
  52.224      if [ "${CT_ONLY_EXTRACT}" != "y" ]; then
  52.225 @@ -353,6 +355,7 @@
  52.226          do_libc
  52.227          do_cc
  52.228          do_libc_finish
  52.229 +        do_debug
  52.230  
  52.231          # Create the aliases to the target tools
  52.232          if [ -n "${CT_TARGET_ALIAS}" ]; then
  52.233 @@ -370,18 +373,22 @@
  52.234          if [ "${CT_REMOVE_DOCS}" = "y" ]; then
  52.235          	CT_DoLog INFO "Removing installed documentation"
  52.236              rm -rf "${CT_PREFIX_DIR}/"{man,info}
  52.237 +            rm -rf "${CT_DEBUG_INSTALL_DIR}/usr/"{man,info}
  52.238          fi
  52.239      fi
  52.240  fi
  52.241  
  52.242 -CT_STOP_DATE=`CT_DoDate +%s%N`
  52.243 -CT_STOP_DATE_HUMAN=`CT_DoDate +%Y%m%d.%H%M%S`
  52.244 -CT_DoLog INFO "Build completed at ${CT_STOP_DATE_HUMAN}"
  52.245 -elapsed=$((CT_STOP_DATE-CT_STAR_DATE))
  52.246 -elapsed_min=$((elapsed/(60*1000*1000*1000)))
  52.247 -elapsed_sec=`printf "%02d" $(((elapsed%(60*1000*1000*1000))/(1000*1000*1000)))`
  52.248 -elapsed_csec=`printf "%02d" $(((elapsed%(1000*1000*1000))/(10*1000*1000)))`
  52.249 -CT_DoLog INFO "(elapsed: ${elapsed_min}:${elapsed_sec}.${elapsed_csec})"
  52.250 +# OK, now we're done, set the toolchain read-only
  52.251 +# Don't log, the log file may become read-only any moment...
  52.252 +chmod -R a-w "${CT_INSTALL_DIR}"
  52.253 +
  52.254 +# We stil have some small bits to log
  52.255 +chmod u+w "${CT_LOG_FILE}"
  52.256 +
  52.257 +CT_DoEnd INFO
  52.258 +
  52.259 +# All files should now be read-only, log-file included
  52.260 +chmod a-w "${CT_LOG_FILE}"
  52.261  
  52.262  # Restore a 'normal' color setting
  52.263  echo -en "${CT_NORMAL_COLOR}"
    53.1 --- a/scripts/functions	Mon May 14 19:59:41 2007 +0000
    53.2 +++ b/scripts/functions	Thu May 17 16:22:51 2007 +0000
    53.3 @@ -13,6 +13,8 @@
    53.4          CT_DoLog ERROR "      called from \"${BASH_SOURCE[${depth}]}\" at line # ${BASH_LINENO[${depth}-1]} in function \"${FUNCNAME[${depth}]}\""
    53.5      done
    53.6      CT_DoLog ERROR "Look at \"${CT_ACTUAL_LOG_FILE}\" for more info on this error."
    53.7 +    CT_STEP_COUNT=1
    53.8 +    CT_DoEnd ERROR
    53.9      exit $ret
   53.10  }
   53.11  trap CT_OnError ERR
   53.12 @@ -28,25 +30,6 @@
   53.13  CT_LOG_LEVEL_DEBUG=4
   53.14  CT_LOG_LEVEL_ALL=5
   53.15  
   53.16 -# Attributes
   53.17 -_A_NOR="\\033[0m"
   53.18 -_A_BRI="\\033[1m"
   53.19 -_A_DIM="\\033[2m"
   53.20 -_A_UND="\\033[4m"
   53.21 -_A_BRB="\\033[5m"
   53.22 -_A_REV="\\033[7m"
   53.23 -_A_HID="\\033[8m"
   53.24 -
   53.25 -# Fore colors
   53.26 -_F_BLK="\\033[30m"
   53.27 -_F_RED="\\033[31m"
   53.28 -_F_GRN="\\033[32m"
   53.29 -_F_YEL="\\033[33m"
   53.30 -_F_BLU="\\033[34m"
   53.31 -_F_MAG="\\033[35m"
   53.32 -_F_CYA="\\033[36m"
   53.33 -_F_WHI="\\033[37m"
   53.34 -
   53.35  # A function to log what is happening
   53.36  # Different log level are available:
   53.37  #   - ERROR:   A serious, fatal error occurred
   53.38 @@ -84,10 +67,8 @@
   53.39                l="`printf \"[%-5s]%*s%s%s\" \"${cur_L}\" \"${indent}\" \" \" \"${line}\"`"
   53.40                # There will always be a log file, be it /dev/null
   53.41                echo -e "${l}" >>"${CT_ACTUAL_LOG_FILE}"
   53.42 -              color="CT_${cur_L}_COLOR"
   53.43 -              normal="CT_NORMAL_COLOR"
   53.44                if [ ${cur_l} -le ${max_level} ]; then
   53.45 -                  echo -e "\r${!color}${l}${!normal}"
   53.46 +                  echo -e "\r${l}"
   53.47                fi
   53.48                if [ "${CT_LOG_PROGRESS_BAR}" = "y" ]; then
   53.49                    str=`CT_DoDate +%s`
   53.50 @@ -105,7 +86,21 @@
   53.51      return 0
   53.52  }
   53.53  
   53.54 -# Abort the execution with a error message
   53.55 +# Tail message to be logged whatever happens
   53.56 +# Usage: CT_DoEnd <level>
   53.57 +CT_DoEnd()
   53.58 +{
   53.59 +    CT_STOP_DATE=`CT_DoDate +%s%N`
   53.60 +    CT_STOP_DATE_HUMAN=`CT_DoDate +%Y%m%d.%H%M%S`
   53.61 +    CT_DoLog INFO "Build completed at ${CT_STOP_DATE_HUMAN}"
   53.62 +    elapsed=$((CT_STOP_DATE-CT_STAR_DATE))
   53.63 +    elapsed_min=$((elapsed/(60*1000*1000*1000)))
   53.64 +    elapsed_sec=`printf "%02d" $(((elapsed%(60*1000*1000*1000))/(1000*1000*1000)))`
   53.65 +    elapsed_csec=`printf "%02d" $(((elapsed%(1000*1000*1000))/(10*1000*1000)))`
   53.66 +    CT_DoLog INFO "(elapsed: ${elapsed_min}:${elapsed_sec}.${elapsed_csec})"
   53.67 +}
   53.68 +
   53.69 +# Abort the execution with an error message
   53.70  # Usage: CT_Abort <message>
   53.71  CT_Abort() {
   53.72      CT_DoLog ERROR "$1" >&2
    54.1 --- a/tools/addToolVersion.sh	Mon May 14 19:59:41 2007 +0000
    54.2 +++ b/tools/addToolVersion.sh	Thu May 17 16:22:51 2007 +0000
    54.3 @@ -7,16 +7,19 @@
    54.4      cat <<-EOF
    54.5  Usage: ${myname} <tool> [option] <version>
    54.6    'tool' in one of:
    54.7 -    --gcc, --tcc, --binutils, --glibc, --uClibc, --linux, --cygwin
    54.8 +    --gcc, --binutils, --glibc, --uClibc, --linux, --gdb
    54.9  
   54.10 -  Options:
   54.11 +  Valid options for all tools:
   54.12      --experimental, -x
   54.13        mark the version as being experimental
   54.14  
   54.15 -  Valid mandatory 'option' for tool==gcc is one of:
   54.16 +    --obsolete, -o
   54.17 +      mark the version as being obsolete
   54.18 +
   54.19 +  Valid mandatory 'option' for tool==gcc is one and only one of:
   54.20      --core, --final
   54.21  
   54.22 -  Valid mandatory 'option' for tool==linux is one of:
   54.23 +  Valid mandatory 'option' for tool==linux is one and only one of:
   54.24      --install, --sanitised, --copy
   54.25  
   54.26    'version' is a valid version for the specified tool.
   54.27 @@ -30,32 +33,38 @@
   54.28  EOF
   54.29  }
   54.30  
   54.31 +cat=
   54.32  tool=
   54.33  tool_prefix=
   54.34 +tool_suffix=
   54.35  CORE=
   54.36  FINAL=
   54.37  VERSION=
   54.38  EXP=
   54.39 +OBS=
   54.40  
   54.41  i=1
   54.42  while [ $i -le $# ]; do
   54.43      case "${!i}" in
   54.44 +        # Tools:
   54.45          --gcc)              cat=CC;        tool=gcc;      tool_prefix=cc_;      tool_suffix=;;
   54.46 -#        --tcc)              cat=CC;        tool=tcc;      tool_prefix=cc_;      tool_suffix=;;
   54.47          --binutils)         cat=BINUTILS;  tool=binutils; tool_prefix=;         tool_suffix=;;
   54.48          --glibc)            cat=LIBC;      tool=glibc;    tool_prefix=libc_;    tool_suffix=;;
   54.49          --uClibc)           cat=LIBC;      tool=uClibc;   tool_prefix=libc_;    tool_suffix=;;
   54.50 -        --linux)            cat=KERNEL;    tool=linux;    tool_prefix=kernel_;;
   54.51 -#        --cygwin)           cat=KERNEL;    tool=cygwin;   tool_prefix=kernel_;;
   54.52 -        --core)             CORE=1;;
   54.53 -        --final)            FINAL=1;;
   54.54 +        --linux)            cat=KERNEL;    tool=linux;    tool_prefix=kernel_;  tool_suffix=;;
   54.55 +        --gdb)              cat=GDB;       tool=gdb;      tool_prefix=debug/    tool_suffix=;;
   54.56 +        # Tools options:
   54.57 +        -x|--experimental)  EXP=1; OBS=;;
   54.58 +        -o|--obsolete)      OBS=1; EXP=;;
   54.59 +        --core)             CORE=1; FINAL=;;
   54.60 +        --final)            FINAL=1; CORE=;;
   54.61          --install)          tool_suffix=install;;
   54.62          --sanitised)        tool_suffix=sanitised;;
   54.63          --copy)             tool_suffix=copy;;
   54.64 -        -x|--experimental)  EXP=1;;
   54.65 +        # Misc:
   54.66          -h|--help)          doHelp; exit 0;;
   54.67 -        -*)             echo "Unknown option: \"${!i}\". (use -h/--help for help"; exit 1;;
   54.68 -        *)              VERSION="${VERSION} ${!i}";;
   54.69 +        -*)                 echo "Unknown option: \"${!i}\". (use -h/--help for help"; exit 1;;
   54.70 +        *)                  VERSION="${VERSION} ${!i}";;
   54.71      esac
   54.72      i=$((i+1))
   54.73  done
   54.74 @@ -63,30 +72,18 @@
   54.75  [ -n "${tool}" -o -n "${VERSION}" ] || { doHelp; exit 1; }
   54.76  
   54.77  case "${cat}" in
   54.78 -    CC)     [ -z "${CORE}" -a -z "${FINAL}" ] && { doHelp; exit 1; };;
   54.79 +    CC)     [    -z "${CORE}" -a -z "${FINAL}" ] && { doHelp; exit 1; };;
   54.80      KERNEL) unset FINAL CORE
   54.81              [ -z "${tool_suffix}" ] && { doHelp; exit 1; }
   54.82              ;;
   54.83 -    *)      FINAL=1; CORE=;;
   54.84 +    *)      CORE=; FINAL=;;
   54.85  esac
   54.86  
   54.87 +MIDDLE_V=; MIDDLE_F=
   54.88 +[ -n "${CORE}" ] && MIDDLE_V="_CORE" && MIDDLE_F="core_"
   54.89  for ver in ${VERSION}; do
   54.90      unset DEP L1 L2 L3 L4 L5 FILE
   54.91 -	v=`echo "${ver}" |sed -r -e 's/-/_/g; s/\./_/g;'`
   54.92 -    if [ -n "${CORE}" ]; then
   54.93 -        L1="config ${cat}_CORE_V_${v}\n"
   54.94 -        L2="    bool\n"
   54.95 -        L3="    prompt \"${ver}\"\n"
   54.96 -        L5="    default \"${ver}\" if ${cat}_CORE_V_${v}"
   54.97 -        FILE="config/${tool_prefix}core_${tool}.in"
   54.98 -    fi
   54.99 -    if [ -n "${FINAL}" ]; then
  54.100 -        L1="config ${cat}_V_${v}\n"
  54.101 -        L2="    bool\n"
  54.102 -        L3="    prompt \"${ver}\"\n"
  54.103 -        L5="    default \"${ver}\" if ${cat}_V_${v}"
  54.104 -        FILE="config/${tool_prefix}${tool}.in"
  54.105 -    fi
  54.106 +    v=`echo "${ver}" |sed -r -e 's/-/_/g; s/\./_/g;'`
  54.107      if [ "${cat}" = "KERNEL" ]; then
  54.108          TOOL_SUFFIX="`echo \"${tool_suffix}\" |tr [[:lower:]] [[:upper:]]`"
  54.109          L1="config ${cat}_${TOOL_SUFFIX}_V_${v}\n"
  54.110 @@ -99,8 +96,15 @@
  54.111          esac
  54.112          L5="    default \"${ver}\" if ${cat}_${TOOL_SUFFIX}_V_${v}"
  54.113          FILE="config/${tool_prefix}${tool}_headers_${tool_suffix}.in"
  54.114 +    else
  54.115 +        L1="config ${cat}${MIDDLE}_V_${v}\n"
  54.116 +        L2="    bool\n"
  54.117 +        L3="    prompt \"${ver}\"\n"
  54.118 +        L5="    default \"${ver}\" if ${cat}${MIDDLE}_V_${v}"
  54.119 +        FILE="config/${tool_prefix}${MIDDLE_F}${tool}.in"
  54.120      fi
  54.121      [ -n "${EXP}" ] && DEP="${DEP} && EXPERIMENTAL"
  54.122 +    [ -n "${OBS}" ] && DEP="${DEP} && OBSOLETE"
  54.123      case "${DEP}" in
  54.124          "") ;;
  54.125          *)  L4="    depends on `echo \"${DEP}\" |sed -r -e 's/^ \\&\\& //; s/\\&/\\\\&/g;'`\n"