debug/gdb: remove old versions
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Oct 28 18:59:09 2009 +0100 (2009-10-28)
changeset 1605c400f421858e
parent 1604 b3f0173f10f3
child 1606 859af0f9d110
debug/gdb: remove old versions
config/debug/gdb.in
patches/gdb/6.6/100-uclibc-conf.patch
patches/gdb/6.6/110-fix-compile-flag-mismatch.patch
patches/gdb/6.7.1/100-security-errata-20050610.patch
patches/gdb/6.7.1/110-hppa-offsets.patch
patches/gdb/6.7.1/120-deleted-children.patch
patches/gdb/6.7.1/130-dwarf-stack-overflow.patch
patches/gdb/6.7/100-security-errata-20050610.patch
patches/gdb/6.7/110-hppa-offsets.patch
patches/gdb/6.7/120-dwarf-stack-overflow.patch
     1.1 --- a/config/debug/gdb.in	Tue Oct 27 20:06:07 2009 +0100
     1.2 +++ b/config/debug/gdb.in	Wed Oct 28 18:59:09 2009 +0100
     1.3 @@ -103,20 +103,6 @@
     1.4      bool
     1.5      prompt "6.8"
     1.6  
     1.7 -config GDB_V_6_7_1
     1.8 -    bool
     1.9 -    prompt "6.7.1 (EXPERIMENTAL)"
    1.10 -    depends on EXPERIMENTAL
    1.11 -
    1.12 -config GDB_V_6_7
    1.13 -    bool
    1.14 -    prompt "6.7 (EXPERIMENTAL)"
    1.15 -    depends on EXPERIMENTAL
    1.16 -
    1.17 -config GDB_V_6_6
    1.18 -    bool
    1.19 -    prompt "6.6"
    1.20 -
    1.21  config GDB_V_snapshot
    1.22      bool
    1.23      prompt "snapshot (EXPERIMENTAL)"
    1.24 @@ -130,9 +116,6 @@
    1.25  # Don't remove next line
    1.26  # CT_INSERT_VERSION_STRING_BELOW
    1.27      default "6.8" if GDB_V_6_8
    1.28 -    default "6.7.1" if GDB_V_6_7_1
    1.29 -    default "6.7" if GDB_V_6_7
    1.30 -    default "6.6" if GDB_V_6_6
    1.31      default "snapshot" if GDB_V_snapshot
    1.32  
    1.33  if GDB_NATIVE
     2.1 --- a/patches/gdb/6.6/100-uclibc-conf.patch	Tue Oct 27 20:06:07 2009 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,82 +0,0 @@
     2.4 -diff -rNdup gdb-6.6.orig/bfd/configure gdb-6.6/bfd/configure
     2.5 ---- gdb-6.6.orig/bfd/configure	2006-10-25 08:49:20.000000000 +0200
     2.6 -+++ gdb-6.6/bfd/configure	2007-05-14 10:35:50.000000000 +0200
     2.7 -@@ -3579,6 +3579,11 @@ linux-gnu*)
     2.8 -   lt_cv_deplibs_check_method=pass_all
     2.9 -   ;;
    2.10 - 
    2.11 -+linux-uclibc*)
    2.12 -+  lt_cv_deplibs_check_method=pass_all
    2.13 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
    2.14 -+  ;;
    2.15 -+
    2.16 - netbsd* | knetbsd*-gnu)
    2.17 -   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
    2.18 -     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
    2.19 -diff -rNdup gdb-6.6.orig/libtool.m4 gdb-6.6/libtool.m4
    2.20 ---- gdb-6.6.orig/libtool.m4	2005-12-27 17:37:57.000000000 +0100
    2.21 -+++ gdb-6.6/libtool.m4	2007-05-14 10:35:50.000000000 +0200
    2.22 -@@ -751,6 +751,11 @@ netbsd* | knetbsd*-gnu)
    2.23 -   fi
    2.24 -   ;;
    2.25 - 
    2.26 -+linux-uclibc*)
    2.27 -+  lt_cv_deplibs_check_method=pass_all
    2.28 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
    2.29 -+  ;;
    2.30 -+
    2.31 - newsos6)
    2.32 -   [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
    2.33 -   lt_cv_file_magic_cmd=/usr/bin/file
    2.34 -diff -rNdup gdb-6.6.orig/ltconfig gdb-6.6/ltconfig
    2.35 ---- gdb-6.6.orig/ltconfig	2006-07-04 22:31:03.000000000 +0200
    2.36 -+++ gdb-6.6/ltconfig	2007-05-14 10:35:50.000000000 +0200
    2.37 -@@ -602,7 +602,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
    2.38 - 
    2.39 - # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
    2.40 - case $host_os in
    2.41 --linux-gnu*) ;;
    2.42 -+linux-gnu*|linux-uclibc*) ;;
    2.43 - linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
    2.44 - esac
    2.45 - 
    2.46 -@@ -1270,6 +1270,24 @@ linux-gnu*)
    2.47 -   dynamic_linker='GNU/Linux ld.so'
    2.48 -   ;;
    2.49 - 
    2.50 -+linux-uclibc*)
    2.51 -+  version_type=linux
    2.52 -+  need_lib_prefix=no
    2.53 -+  need_version=no
    2.54 -+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
    2.55 -+  soname_spec='${libname}${release}.so$major'
    2.56 -+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
    2.57 -+  shlibpath_var=LD_LIBRARY_PATH
    2.58 -+  shlibpath_overrides_runpath=no
    2.59 -+  # This implies no fast_install, which is unacceptable.
    2.60 -+  # Some rework will be needed to allow for fast_install
    2.61 -+  # before this can be enabled.
    2.62 -+  # Note: copied from linux-gnu, and may not be appropriate.
    2.63 -+  hardcode_into_libs=yes
    2.64 -+  # Assume using the uClibc dynamic linker.
    2.65 -+  dynamic_linker="uClibc ld.so"
    2.66 -+  ;;
    2.67 -+
    2.68 - netbsd*)
    2.69 -   need_lib_prefix=no
    2.70 -   need_version=no
    2.71 -diff -rNdup gdb-6.6.orig/opcodes/configure gdb-6.6/opcodes/configure
    2.72 ---- gdb-6.6.orig/opcodes/configure	2006-10-25 08:49:20.000000000 +0200
    2.73 -+++ gdb-6.6/opcodes/configure	2007-05-14 10:35:50.000000000 +0200
    2.74 -@@ -3590,6 +3590,11 @@ netbsd* | knetbsd*-gnu)
    2.75 -   fi
    2.76 -   ;;
    2.77 - 
    2.78 -+linux-uclibc*)
    2.79 -+  lt_cv_deplibs_check_method=pass_all
    2.80 -+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
    2.81 -+  ;;
    2.82 -+
    2.83 - newsos6)
    2.84 -   lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
    2.85 -   lt_cv_file_magic_cmd=/usr/bin/file
     3.1 --- a/patches/gdb/6.6/110-fix-compile-flag-mismatch.patch	Tue Oct 27 20:06:07 2009 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,69 +0,0 @@
     3.4 -diff -rduNp gdb-6.6-100/Makefile.in gdb-6.6/Makefile.in
     3.5 ---- gdb-6.6-100/Makefile.in	2006-12-18 08:21:19.000000000 +0100
     3.6 -+++ gdb-6.6/Makefile.in	2007-05-14 10:54:29.000000000 +0200
     3.7 -@@ -331,7 +331,7 @@ COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_
     3.8 - # CFLAGS will be just -g.  We want to ensure that TARGET libraries
     3.9 - # (which we know are built with gcc) are built with optimizations so
    3.10 - # prepend -O2 when setting CFLAGS_FOR_TARGET.
    3.11 --CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
    3.12 -+CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
    3.13 - SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
    3.14 - CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
    3.15 - LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
    3.16 -diff -rduNp gdb-6.6-100/Makefile.tpl gdb-6.6/Makefile.tpl
    3.17 ---- gdb-6.6-100/Makefile.tpl	2006-11-15 00:26:39.000000000 +0100
    3.18 -+++ gdb-6.6/Makefile.tpl	2007-05-14 10:54:29.000000000 +0200
    3.19 -@@ -334,7 +334,7 @@ COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_
    3.20 - # CFLAGS will be just -g.  We want to ensure that TARGET libraries
    3.21 - # (which we know are built with gcc) are built with optimizations so
    3.22 - # prepend -O2 when setting CFLAGS_FOR_TARGET.
    3.23 --CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
    3.24 -+CFLAGS_FOR_TARGET = $(strip $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
    3.25 - SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
    3.26 - CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
    3.27 - LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
    3.28 -diff -rduNp gdb-6.6-100/gdb/configure gdb-6.6/gdb/configure
    3.29 ---- gdb-6.6-100/gdb/configure	2006-12-17 16:38:59.000000000 +0100
    3.30 -+++ gdb-6.6/gdb/configure	2007-05-14 10:55:41.000000000 +0200
    3.31 -@@ -272,7 +272,7 @@ PACKAGE_STRING=
    3.32 - PACKAGE_BUGREPORT=
    3.33 - 
    3.34 - ac_unique_file="main.c"
    3.35 --ac_subdirs_all="$ac_subdirs_all doc testsuite"
    3.36 -+ac_subdirs_all="$ac_subdirs_all doc"
    3.37 - # Factoring default headers for most tests.
    3.38 - ac_includes_default="\
    3.39 - #include <stdio.h>
    3.40 -@@ -3055,7 +3055,7 @@ _ACEOF
    3.41 - 
    3.42 - 
    3.43 - 
    3.44 --subdirs="$subdirs doc testsuite"
    3.45 -+subdirs="$subdirs doc"
    3.46 - 
    3.47 - 
    3.48 - # Provide defaults for some variables set by the per-host and per-target
    3.49 -diff -rduNp gdb-6.6-100/gdb/gdbserver/configure gdb-6.6/gdb/gdbserver/configure
    3.50 ---- gdb-6.6-100/gdb/gdbserver/configure	2006-11-22 01:10:19.000000000 +0100
    3.51 -+++ gdb-6.6/gdb/gdbserver/configure	2007-05-14 10:54:29.000000000 +0200
    3.52 -@@ -1239,7 +1239,7 @@ echo "$as_me: error: \`$ac_var' was not 
    3.53 -       ac_cache_corrupted=: ;;
    3.54 -     ,);;
    3.55 -     *)
    3.56 --      if test "x$ac_old_val" != "x$ac_new_val"; then
    3.57 -+      if test "`echo $ac_old_val`" != "`echo $ac_new_val`"; then
    3.58 - 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
    3.59 - echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
    3.60 - 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
    3.61 -diff -rduNp gdb-6.6-100/gdb/testsuite/configure gdb-6.6/gdb/testsuite/configure
    3.62 ---- gdb-6.6-100/gdb/testsuite/configure	2006-06-21 15:57:21.000000000 +0200
    3.63 -+++ gdb-6.6/gdb/testsuite/configure	2007-05-14 10:54:29.000000000 +0200
    3.64 -@@ -1248,7 +1248,7 @@ echo "$as_me: error: \`$ac_var' was not 
    3.65 -       ac_cache_corrupted=: ;;
    3.66 -     ,);;
    3.67 -     *)
    3.68 --      if test "x$ac_old_val" != "x$ac_new_val"; then
    3.69 -+      if test "`echo $ac_old_val" != "`echo $ac_new_val"; then
    3.70 - 	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
    3.71 - echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
    3.72 - 	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
     4.1 --- a/patches/gdb/6.7.1/100-security-errata-20050610.patch	Tue Oct 27 20:06:07 2009 +0100
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,205 +0,0 @@
     4.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/35_all_gdb-6.3-security-errata-20050610.patch
     4.5 --= BEGIN original header =-
     4.6 -2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
     4.7 -
     4.8 -        * gdb.base/gdbinit.exp: New testcase.
     4.9 -        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
    4.10 -
    4.11 -2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
    4.12 -            Jeff Johnston  <jjohnstn@redhat.com>
    4.13 -
    4.14 -        * Makefile.in (cli-cmds.o): Update.
    4.15 -        * configure.in: Add check for getuid.
    4.16 -        * configure: Regenerated.
    4.17 -        * config.in: Ditto.
    4.18 -        * main.c (captured_main): Pass -1 to source_command when loading
    4.19 -        gdbinit files.
    4.20 -        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
    4.21 -        (source_command): Update documentation.  Check permissions if
    4.22 -        FROM_TTY is -1.
    4.23 -
    4.24 --= END original header =-
    4.25 -diff -durN gdb-6.7.1.orig/gdb/cli/cli-cmds.c gdb-6.7.1/gdb/cli/cli-cmds.c
    4.26 ---- gdb-6.7.1.orig/gdb/cli/cli-cmds.c	2007-08-23 20:08:47.000000000 +0200
    4.27 -+++ gdb-6.7.1/gdb/cli/cli-cmds.c	2008-06-17 23:27:44.000000000 +0200
    4.28 -@@ -36,6 +36,7 @@
    4.29 - #include "objfiles.h"
    4.30 - #include "source.h"
    4.31 - #include "disasm.h"
    4.32 -+#include "gdb_stat.h"
    4.33 - 
    4.34 - #include "ui-out.h"
    4.35 - 
    4.36 -@@ -459,12 +460,31 @@
    4.37 - 
    4.38 -   if (fd == -1)
    4.39 -     {
    4.40 --      if (from_tty)
    4.41 -+      if (from_tty > 0)
    4.42 - 	perror_with_name (file);
    4.43 -       else
    4.44 - 	return;
    4.45 -     }
    4.46 - 
    4.47 -+#ifdef HAVE_GETUID
    4.48 -+  if (from_tty == -1)
    4.49 -+    {
    4.50 -+      struct stat statbuf;
    4.51 -+      if (fstat (fd, &statbuf) < 0)
    4.52 -+	{
    4.53 -+	  perror_with_name (file);
    4.54 -+	  close (fd);
    4.55 -+	  return;
    4.56 -+	}
    4.57 -+      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
    4.58 -+	{
    4.59 -+          warning (_("not using untrusted file \"%s\""), file);
    4.60 -+	  close (fd);
    4.61 -+	  return;
    4.62 -+	}
    4.63 -+    }
    4.64 -+#endif
    4.65 -+
    4.66 -   stream = fdopen (fd, FOPEN_RT);
    4.67 -   script_from_file (stream, file);
    4.68 - 
    4.69 -diff -durN gdb-6.7.1.orig/gdb/main.c gdb-6.7.1/gdb/main.c
    4.70 ---- gdb-6.7.1.orig/gdb/main.c	2007-08-23 20:08:36.000000000 +0200
    4.71 -+++ gdb-6.7.1/gdb/main.c	2008-06-17 23:27:44.000000000 +0200
    4.72 -@@ -688,7 +688,7 @@
    4.73 - 
    4.74 -       if (!inhibit_gdbinit)
    4.75 - 	{
    4.76 --	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
    4.77 -+	  catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL);
    4.78 - 	}
    4.79 - 
    4.80 -       /* Do stats; no need to do them elsewhere since we'll only
    4.81 -@@ -766,7 +766,7 @@
    4.82 -       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
    4.83 -     if (!inhibit_gdbinit)
    4.84 -       {
    4.85 --	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
    4.86 -+	catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL);
    4.87 -       }
    4.88 - 
    4.89 -   for (i = 0; i < ncmd; i++)
    4.90 -diff -durN gdb-6.7.1.orig/gdb/Makefile.in gdb-6.7.1/gdb/Makefile.in
    4.91 ---- gdb-6.7.1.orig/gdb/Makefile.in	2008-06-17 23:27:44.000000000 +0200
    4.92 -+++ gdb-6.7.1/gdb/Makefile.in	2008-06-17 23:27:44.000000000 +0200
    4.93 -@@ -2885,7 +2885,7 @@
    4.94 - 	$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
    4.95 - 	$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
    4.96 - 	$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
    4.97 --	$(tui_h)
    4.98 -+	$(tui_h) $(gdb_stat_h)
    4.99 - 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
   4.100 - cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
   4.101 - 	$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
   4.102 -diff -durN gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.exp
   4.103 ---- gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.exp	1970-01-01 01:00:00.000000000 +0100
   4.104 -+++ gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.exp	2008-06-17 23:27:44.000000000 +0200
   4.105 -@@ -0,0 +1,98 @@
   4.106 -+#   Copyright 2005
   4.107 -+#   Free Software Foundation, Inc.
   4.108 -+
   4.109 -+# This program is free software; you can redistribute it and/or modify
   4.110 -+# it under the terms of the GNU General Public License as published by
   4.111 -+# the Free Software Foundation; either version 2 of the License, or
   4.112 -+# (at your option) any later version.
   4.113 -+# 
   4.114 -+# This program is distributed in the hope that it will be useful,
   4.115 -+# but WITHOUT ANY WARRANTY; without even the implied warranty of
   4.116 -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   4.117 -+# GNU General Public License for more details.
   4.118 -+# 
   4.119 -+# You should have received a copy of the GNU General Public License
   4.120 -+# along with this program; if not, write to the Free Software
   4.121 -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
   4.122 -+
   4.123 -+# Please email any bugs, comments, and/or additions to this file to:
   4.124 -+# bug-gdb@prep.ai.mit.edu
   4.125 -+
   4.126 -+# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
   4.127 -+
   4.128 -+if $tracelevel then {
   4.129 -+    strace $tracelevel
   4.130 -+}
   4.131 -+
   4.132 -+set prms_id 0
   4.133 -+set bug_id 0
   4.134 -+
   4.135 -+# are we on a target board
   4.136 -+if [is_remote target] {
   4.137 -+    return
   4.138 -+}
   4.139 -+
   4.140 -+
   4.141 -+global verbose
   4.142 -+global GDB
   4.143 -+global GDBFLAGS
   4.144 -+global gdb_prompt
   4.145 -+global timeout
   4.146 -+global gdb_spawn_id;
   4.147 -+                                                                                
   4.148 -+gdb_stop_suppressing_tests;
   4.149 -+                                                                                
   4.150 -+verbose "Spawning $GDB -nw"
   4.151 -+                                                                                
   4.152 -+if [info exists gdb_spawn_id] {
   4.153 -+    return 0;
   4.154 -+}
   4.155 -+                                                                                
   4.156 -+if ![is_remote host] {
   4.157 -+   if { [which $GDB] == 0 } then {
   4.158 -+        perror "$GDB does not exist."
   4.159 -+        exit 1
   4.160 -+    }
   4.161 -+}
   4.162 -+
   4.163 -+set env(HOME) [pwd]
   4.164 -+remote_exec build "rm .gdbinit"
   4.165 -+remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
   4.166 -+remote_exec build "chmod 646 .gdbinit"
   4.167 -+
   4.168 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
   4.169 -+if { $res < 0 || $res == "" } {
   4.170 -+    perror "Spawning $GDB failed."
   4.171 -+    return 1;
   4.172 -+}
   4.173 -+gdb_expect 360 {
   4.174 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
   4.175 -+        pass "untrusted .gdbinit caught."
   4.176 -+    }
   4.177 -+    -re "$gdb_prompt $"     {
   4.178 -+        fail "untrusted .gdbinit caught."
   4.179 -+    }
   4.180 -+    timeout {
   4.181 -+        fail "(timeout) untrusted .gdbinit caught."
   4.182 -+    }
   4.183 -+}
   4.184 -+
   4.185 -+remote_exec build "chmod 644 .gdbinit"
   4.186 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
   4.187 -+if { $res < 0 || $res == "" } {
   4.188 -+    perror "Spawning $GDB failed."
   4.189 -+    return 1;
   4.190 -+}
   4.191 -+gdb_expect 360 {
   4.192 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
   4.193 -+        fail "trusted .gdbinit allowed."
   4.194 -+    }
   4.195 -+    -re "in gdbinit.*$gdb_prompt $"     {
   4.196 -+        pass "trusted .gdbinit allowed."
   4.197 -+    }
   4.198 -+    timeout {
   4.199 -+        fail "(timeout) trusted .gdbinit allowed."
   4.200 -+    }
   4.201 -+}
   4.202 -+
   4.203 -+remote_exec build "rm .gdbinit"
   4.204 -diff -durN gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.sample
   4.205 ---- gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.sample	1970-01-01 01:00:00.000000000 +0100
   4.206 -+++ gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.sample	2008-06-17 23:27:44.000000000 +0200
   4.207 -@@ -0,0 +1 @@
   4.208 -+echo "\nin gdbinit"
     5.1 --- a/patches/gdb/6.7.1/110-hppa-offsets.patch	Tue Oct 27 20:06:07 2009 +0100
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,272 +0,0 @@
     5.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/45_all_gdb-hppa-offsets.patch
     5.5 --= BEGIN original header =-
     5.6 -sanitized headers dont include asm/offsets.h, so cache a local copy 
     5.7 -
     5.8 -http://bugs.gentoo.org/180476
     5.9 -http://lists.parisc-linux.org/pipermail/parisc-linux/2007-February/031162.html
    5.10 -
    5.11 --= END original header =-
    5.12 -diff -durN gdb-6.7.1.orig/gdb/hppa-linux-nat.c gdb-6.7.1/gdb/hppa-linux-nat.c
    5.13 ---- gdb-6.7.1.orig/gdb/hppa-linux-nat.c	2007-08-23 20:08:33.000000000 +0200
    5.14 -+++ gdb-6.7.1/gdb/hppa-linux-nat.c	2008-06-17 23:27:45.000000000 +0200
    5.15 -@@ -32,7 +32,7 @@
    5.16 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43)
    5.17 - #include <asm/offset.h>
    5.18 - #else
    5.19 --#include <asm/offsets.h>
    5.20 -+#include <hppa-offsets.h>
    5.21 - #endif
    5.22 - 
    5.23 - #include "hppa-tdep.h"
    5.24 -diff -durN gdb-6.7.1.orig/gdb/hppa-offsets.h gdb-6.7.1/gdb/hppa-offsets.h
    5.25 ---- gdb-6.7.1.orig/gdb/hppa-offsets.h	1970-01-01 01:00:00.000000000 +0100
    5.26 -+++ gdb-6.7.1/gdb/hppa-offsets.h	2008-06-17 23:27:45.000000000 +0200
    5.27 -@@ -0,0 +1,248 @@
    5.28 -+#ifndef __ASM_OFFSETS_H__
    5.29 -+#define __ASM_OFFSETS_H__
    5.30 -+/*
    5.31 -+ * DO NOT MODIFY.
    5.32 -+ *
    5.33 -+ * This file was generated by arch/parisc/Makefile
    5.34 -+ *
    5.35 -+ */
    5.36 -+
    5.37 -+#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */
    5.38 -+#define TASK_STATE 0 /* offsetof(struct task_struct, state) */
    5.39 -+#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */
    5.40 -+#define TASK_SIGPENDING 1188 /* offsetof(struct task_struct, pending) */
    5.41 -+#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */
    5.42 -+#define TASK_MM 108 /* offsetof(struct task_struct, mm) */
    5.43 -+#define TASK_PERSONALITY 132 /* offsetof(struct task_struct, personality) */
    5.44 -+#define TASK_PID 140 /* offsetof(struct task_struct, pid) */
    5.45 -+
    5.46 -+#define TASK_REGS 664 /* offsetof(struct task_struct, thread.regs) */
    5.47 -+#define TASK_PT_PSW 664 /* offsetof(struct task_struct, thread.regs.gr[ 0]) */
    5.48 -+#define TASK_PT_GR1 668 /* offsetof(struct task_struct, thread.regs.gr[ 1]) */
    5.49 -+#define TASK_PT_GR2 672 /* offsetof(struct task_struct, thread.regs.gr[ 2]) */
    5.50 -+#define TASK_PT_GR3 676 /* offsetof(struct task_struct, thread.regs.gr[ 3]) */
    5.51 -+#define TASK_PT_GR4 680 /* offsetof(struct task_struct, thread.regs.gr[ 4]) */
    5.52 -+#define TASK_PT_GR5 684 /* offsetof(struct task_struct, thread.regs.gr[ 5]) */
    5.53 -+#define TASK_PT_GR6 688 /* offsetof(struct task_struct, thread.regs.gr[ 6]) */
    5.54 -+#define TASK_PT_GR7 692 /* offsetof(struct task_struct, thread.regs.gr[ 7]) */
    5.55 -+#define TASK_PT_GR8 696 /* offsetof(struct task_struct, thread.regs.gr[ 8]) */
    5.56 -+#define TASK_PT_GR9 700 /* offsetof(struct task_struct, thread.regs.gr[ 9]) */
    5.57 -+#define TASK_PT_GR10 704 /* offsetof(struct task_struct, thread.regs.gr[10]) */
    5.58 -+#define TASK_PT_GR11 708 /* offsetof(struct task_struct, thread.regs.gr[11]) */
    5.59 -+#define TASK_PT_GR12 712 /* offsetof(struct task_struct, thread.regs.gr[12]) */
    5.60 -+#define TASK_PT_GR13 716 /* offsetof(struct task_struct, thread.regs.gr[13]) */
    5.61 -+#define TASK_PT_GR14 720 /* offsetof(struct task_struct, thread.regs.gr[14]) */
    5.62 -+#define TASK_PT_GR15 724 /* offsetof(struct task_struct, thread.regs.gr[15]) */
    5.63 -+#define TASK_PT_GR16 728 /* offsetof(struct task_struct, thread.regs.gr[16]) */
    5.64 -+#define TASK_PT_GR17 732 /* offsetof(struct task_struct, thread.regs.gr[17]) */
    5.65 -+#define TASK_PT_GR18 736 /* offsetof(struct task_struct, thread.regs.gr[18]) */
    5.66 -+#define TASK_PT_GR19 740 /* offsetof(struct task_struct, thread.regs.gr[19]) */
    5.67 -+#define TASK_PT_GR20 744 /* offsetof(struct task_struct, thread.regs.gr[20]) */
    5.68 -+#define TASK_PT_GR21 748 /* offsetof(struct task_struct, thread.regs.gr[21]) */
    5.69 -+#define TASK_PT_GR22 752 /* offsetof(struct task_struct, thread.regs.gr[22]) */
    5.70 -+#define TASK_PT_GR23 756 /* offsetof(struct task_struct, thread.regs.gr[23]) */
    5.71 -+#define TASK_PT_GR24 760 /* offsetof(struct task_struct, thread.regs.gr[24]) */
    5.72 -+#define TASK_PT_GR25 764 /* offsetof(struct task_struct, thread.regs.gr[25]) */
    5.73 -+#define TASK_PT_GR26 768 /* offsetof(struct task_struct, thread.regs.gr[26]) */
    5.74 -+#define TASK_PT_GR27 772 /* offsetof(struct task_struct, thread.regs.gr[27]) */
    5.75 -+#define TASK_PT_GR28 776 /* offsetof(struct task_struct, thread.regs.gr[28]) */
    5.76 -+#define TASK_PT_GR29 780 /* offsetof(struct task_struct, thread.regs.gr[29]) */
    5.77 -+#define TASK_PT_GR30 784 /* offsetof(struct task_struct, thread.regs.gr[30]) */
    5.78 -+#define TASK_PT_GR31 788 /* offsetof(struct task_struct, thread.regs.gr[31]) */
    5.79 -+#define TASK_PT_FR0 792 /* offsetof(struct task_struct, thread.regs.fr[ 0]) */
    5.80 -+#define TASK_PT_FR1 800 /* offsetof(struct task_struct, thread.regs.fr[ 1]) */
    5.81 -+#define TASK_PT_FR2 808 /* offsetof(struct task_struct, thread.regs.fr[ 2]) */
    5.82 -+#define TASK_PT_FR3 816 /* offsetof(struct task_struct, thread.regs.fr[ 3]) */
    5.83 -+#define TASK_PT_FR4 824 /* offsetof(struct task_struct, thread.regs.fr[ 4]) */
    5.84 -+#define TASK_PT_FR5 832 /* offsetof(struct task_struct, thread.regs.fr[ 5]) */
    5.85 -+#define TASK_PT_FR6 840 /* offsetof(struct task_struct, thread.regs.fr[ 6]) */
    5.86 -+#define TASK_PT_FR7 848 /* offsetof(struct task_struct, thread.regs.fr[ 7]) */
    5.87 -+#define TASK_PT_FR8 856 /* offsetof(struct task_struct, thread.regs.fr[ 8]) */
    5.88 -+#define TASK_PT_FR9 864 /* offsetof(struct task_struct, thread.regs.fr[ 9]) */
    5.89 -+#define TASK_PT_FR10 872 /* offsetof(struct task_struct, thread.regs.fr[10]) */
    5.90 -+#define TASK_PT_FR11 880 /* offsetof(struct task_struct, thread.regs.fr[11]) */
    5.91 -+#define TASK_PT_FR12 888 /* offsetof(struct task_struct, thread.regs.fr[12]) */
    5.92 -+#define TASK_PT_FR13 896 /* offsetof(struct task_struct, thread.regs.fr[13]) */
    5.93 -+#define TASK_PT_FR14 904 /* offsetof(struct task_struct, thread.regs.fr[14]) */
    5.94 -+#define TASK_PT_FR15 912 /* offsetof(struct task_struct, thread.regs.fr[15]) */
    5.95 -+#define TASK_PT_FR16 920 /* offsetof(struct task_struct, thread.regs.fr[16]) */
    5.96 -+#define TASK_PT_FR17 928 /* offsetof(struct task_struct, thread.regs.fr[17]) */
    5.97 -+#define TASK_PT_FR18 936 /* offsetof(struct task_struct, thread.regs.fr[18]) */
    5.98 -+#define TASK_PT_FR19 944 /* offsetof(struct task_struct, thread.regs.fr[19]) */
    5.99 -+#define TASK_PT_FR20 952 /* offsetof(struct task_struct, thread.regs.fr[20]) */
   5.100 -+#define TASK_PT_FR21 960 /* offsetof(struct task_struct, thread.regs.fr[21]) */
   5.101 -+#define TASK_PT_FR22 968 /* offsetof(struct task_struct, thread.regs.fr[22]) */
   5.102 -+#define TASK_PT_FR23 976 /* offsetof(struct task_struct, thread.regs.fr[23]) */
   5.103 -+#define TASK_PT_FR24 984 /* offsetof(struct task_struct, thread.regs.fr[24]) */
   5.104 -+#define TASK_PT_FR25 992 /* offsetof(struct task_struct, thread.regs.fr[25]) */
   5.105 -+#define TASK_PT_FR26 1000 /* offsetof(struct task_struct, thread.regs.fr[26]) */
   5.106 -+#define TASK_PT_FR27 1008 /* offsetof(struct task_struct, thread.regs.fr[27]) */
   5.107 -+#define TASK_PT_FR28 1016 /* offsetof(struct task_struct, thread.regs.fr[28]) */
   5.108 -+#define TASK_PT_FR29 1024 /* offsetof(struct task_struct, thread.regs.fr[29]) */
   5.109 -+#define TASK_PT_FR30 1032 /* offsetof(struct task_struct, thread.regs.fr[30]) */
   5.110 -+#define TASK_PT_FR31 1040 /* offsetof(struct task_struct, thread.regs.fr[31]) */
   5.111 -+#define TASK_PT_SR0 1048 /* offsetof(struct task_struct, thread.regs.sr[ 0]) */
   5.112 -+#define TASK_PT_SR1 1052 /* offsetof(struct task_struct, thread.regs.sr[ 1]) */
   5.113 -+#define TASK_PT_SR2 1056 /* offsetof(struct task_struct, thread.regs.sr[ 2]) */
   5.114 -+#define TASK_PT_SR3 1060 /* offsetof(struct task_struct, thread.regs.sr[ 3]) */
   5.115 -+#define TASK_PT_SR4 1064 /* offsetof(struct task_struct, thread.regs.sr[ 4]) */
   5.116 -+#define TASK_PT_SR5 1068 /* offsetof(struct task_struct, thread.regs.sr[ 5]) */
   5.117 -+#define TASK_PT_SR6 1072 /* offsetof(struct task_struct, thread.regs.sr[ 6]) */
   5.118 -+#define TASK_PT_SR7 1076 /* offsetof(struct task_struct, thread.regs.sr[ 7]) */
   5.119 -+#define TASK_PT_IASQ0 1080 /* offsetof(struct task_struct, thread.regs.iasq[0]) */
   5.120 -+#define TASK_PT_IASQ1 1084 /* offsetof(struct task_struct, thread.regs.iasq[1]) */
   5.121 -+#define TASK_PT_IAOQ0 1088 /* offsetof(struct task_struct, thread.regs.iaoq[0]) */
   5.122 -+#define TASK_PT_IAOQ1 1092 /* offsetof(struct task_struct, thread.regs.iaoq[1]) */
   5.123 -+#define TASK_PT_CR27 1096 /* offsetof(struct task_struct, thread.regs.cr27) */
   5.124 -+#define TASK_PT_ORIG_R28 1104 /* offsetof(struct task_struct, thread.regs.orig_r28) */
   5.125 -+#define TASK_PT_KSP 1108 /* offsetof(struct task_struct, thread.regs.ksp) */
   5.126 -+#define TASK_PT_KPC 1112 /* offsetof(struct task_struct, thread.regs.kpc) */
   5.127 -+#define TASK_PT_SAR 1116 /* offsetof(struct task_struct, thread.regs.sar) */
   5.128 -+#define TASK_PT_IIR 1120 /* offsetof(struct task_struct, thread.regs.iir) */
   5.129 -+#define TASK_PT_ISR 1124 /* offsetof(struct task_struct, thread.regs.isr) */
   5.130 -+#define TASK_PT_IOR 1128 /* offsetof(struct task_struct, thread.regs.ior) */
   5.131 -+
   5.132 -+#define TASK_SZ 1272 /* sizeof(struct task_struct) */
   5.133 -+#define TASK_SZ_ALGN 1344 /* align(sizeof(struct task_struct), 64) */
   5.134 -+
   5.135 -+#define PT_PSW 0 /* offsetof(struct pt_regs, gr[ 0]) */
   5.136 -+#define PT_GR1 4 /* offsetof(struct pt_regs, gr[ 1]) */
   5.137 -+#define PT_GR2 8 /* offsetof(struct pt_regs, gr[ 2]) */
   5.138 -+#define PT_GR3 12 /* offsetof(struct pt_regs, gr[ 3]) */
   5.139 -+#define PT_GR4 16 /* offsetof(struct pt_regs, gr[ 4]) */
   5.140 -+#define PT_GR5 20 /* offsetof(struct pt_regs, gr[ 5]) */
   5.141 -+#define PT_GR6 24 /* offsetof(struct pt_regs, gr[ 6]) */
   5.142 -+#define PT_GR7 28 /* offsetof(struct pt_regs, gr[ 7]) */
   5.143 -+#define PT_GR8 32 /* offsetof(struct pt_regs, gr[ 8]) */
   5.144 -+#define PT_GR9 36 /* offsetof(struct pt_regs, gr[ 9]) */
   5.145 -+#define PT_GR10 40 /* offsetof(struct pt_regs, gr[10]) */
   5.146 -+#define PT_GR11 44 /* offsetof(struct pt_regs, gr[11]) */
   5.147 -+#define PT_GR12 48 /* offsetof(struct pt_regs, gr[12]) */
   5.148 -+#define PT_GR13 52 /* offsetof(struct pt_regs, gr[13]) */
   5.149 -+#define PT_GR14 56 /* offsetof(struct pt_regs, gr[14]) */
   5.150 -+#define PT_GR15 60 /* offsetof(struct pt_regs, gr[15]) */
   5.151 -+#define PT_GR16 64 /* offsetof(struct pt_regs, gr[16]) */
   5.152 -+#define PT_GR17 68 /* offsetof(struct pt_regs, gr[17]) */
   5.153 -+#define PT_GR18 72 /* offsetof(struct pt_regs, gr[18]) */
   5.154 -+#define PT_GR19 76 /* offsetof(struct pt_regs, gr[19]) */
   5.155 -+#define PT_GR20 80 /* offsetof(struct pt_regs, gr[20]) */
   5.156 -+#define PT_GR21 84 /* offsetof(struct pt_regs, gr[21]) */
   5.157 -+#define PT_GR22 88 /* offsetof(struct pt_regs, gr[22]) */
   5.158 -+#define PT_GR23 92 /* offsetof(struct pt_regs, gr[23]) */
   5.159 -+#define PT_GR24 96 /* offsetof(struct pt_regs, gr[24]) */
   5.160 -+#define PT_GR25 100 /* offsetof(struct pt_regs, gr[25]) */
   5.161 -+#define PT_GR26 104 /* offsetof(struct pt_regs, gr[26]) */
   5.162 -+#define PT_GR27 108 /* offsetof(struct pt_regs, gr[27]) */
   5.163 -+#define PT_GR28 112 /* offsetof(struct pt_regs, gr[28]) */
   5.164 -+#define PT_GR29 116 /* offsetof(struct pt_regs, gr[29]) */
   5.165 -+#define PT_GR30 120 /* offsetof(struct pt_regs, gr[30]) */
   5.166 -+#define PT_GR31 124 /* offsetof(struct pt_regs, gr[31]) */
   5.167 -+#define PT_FR0 128 /* offsetof(struct pt_regs, fr[ 0]) */
   5.168 -+#define PT_FR1 136 /* offsetof(struct pt_regs, fr[ 1]) */
   5.169 -+#define PT_FR2 144 /* offsetof(struct pt_regs, fr[ 2]) */
   5.170 -+#define PT_FR3 152 /* offsetof(struct pt_regs, fr[ 3]) */
   5.171 -+#define PT_FR4 160 /* offsetof(struct pt_regs, fr[ 4]) */
   5.172 -+#define PT_FR5 168 /* offsetof(struct pt_regs, fr[ 5]) */
   5.173 -+#define PT_FR6 176 /* offsetof(struct pt_regs, fr[ 6]) */
   5.174 -+#define PT_FR7 184 /* offsetof(struct pt_regs, fr[ 7]) */
   5.175 -+#define PT_FR8 192 /* offsetof(struct pt_regs, fr[ 8]) */
   5.176 -+#define PT_FR9 200 /* offsetof(struct pt_regs, fr[ 9]) */
   5.177 -+#define PT_FR10 208 /* offsetof(struct pt_regs, fr[10]) */
   5.178 -+#define PT_FR11 216 /* offsetof(struct pt_regs, fr[11]) */
   5.179 -+#define PT_FR12 224 /* offsetof(struct pt_regs, fr[12]) */
   5.180 -+#define PT_FR13 232 /* offsetof(struct pt_regs, fr[13]) */
   5.181 -+#define PT_FR14 240 /* offsetof(struct pt_regs, fr[14]) */
   5.182 -+#define PT_FR15 248 /* offsetof(struct pt_regs, fr[15]) */
   5.183 -+#define PT_FR16 256 /* offsetof(struct pt_regs, fr[16]) */
   5.184 -+#define PT_FR17 264 /* offsetof(struct pt_regs, fr[17]) */
   5.185 -+#define PT_FR18 272 /* offsetof(struct pt_regs, fr[18]) */
   5.186 -+#define PT_FR19 280 /* offsetof(struct pt_regs, fr[19]) */
   5.187 -+#define PT_FR20 288 /* offsetof(struct pt_regs, fr[20]) */
   5.188 -+#define PT_FR21 296 /* offsetof(struct pt_regs, fr[21]) */
   5.189 -+#define PT_FR22 304 /* offsetof(struct pt_regs, fr[22]) */
   5.190 -+#define PT_FR23 312 /* offsetof(struct pt_regs, fr[23]) */
   5.191 -+#define PT_FR24 320 /* offsetof(struct pt_regs, fr[24]) */
   5.192 -+#define PT_FR25 328 /* offsetof(struct pt_regs, fr[25]) */
   5.193 -+#define PT_FR26 336 /* offsetof(struct pt_regs, fr[26]) */
   5.194 -+#define PT_FR27 344 /* offsetof(struct pt_regs, fr[27]) */
   5.195 -+#define PT_FR28 352 /* offsetof(struct pt_regs, fr[28]) */
   5.196 -+#define PT_FR29 360 /* offsetof(struct pt_regs, fr[29]) */
   5.197 -+#define PT_FR30 368 /* offsetof(struct pt_regs, fr[30]) */
   5.198 -+#define PT_FR31 376 /* offsetof(struct pt_regs, fr[31]) */
   5.199 -+#define PT_SR0 384 /* offsetof(struct pt_regs, sr[ 0]) */
   5.200 -+#define PT_SR1 388 /* offsetof(struct pt_regs, sr[ 1]) */
   5.201 -+#define PT_SR2 392 /* offsetof(struct pt_regs, sr[ 2]) */
   5.202 -+#define PT_SR3 396 /* offsetof(struct pt_regs, sr[ 3]) */
   5.203 -+#define PT_SR4 400 /* offsetof(struct pt_regs, sr[ 4]) */
   5.204 -+#define PT_SR5 404 /* offsetof(struct pt_regs, sr[ 5]) */
   5.205 -+#define PT_SR6 408 /* offsetof(struct pt_regs, sr[ 6]) */
   5.206 -+#define PT_SR7 412 /* offsetof(struct pt_regs, sr[ 7]) */
   5.207 -+#define PT_IASQ0 416 /* offsetof(struct pt_regs, iasq[0]) */
   5.208 -+#define PT_IASQ1 420 /* offsetof(struct pt_regs, iasq[1]) */
   5.209 -+#define PT_IAOQ0 424 /* offsetof(struct pt_regs, iaoq[0]) */
   5.210 -+#define PT_IAOQ1 428 /* offsetof(struct pt_regs, iaoq[1]) */
   5.211 -+#define PT_CR27 432 /* offsetof(struct pt_regs, cr27) */
   5.212 -+#define PT_ORIG_R28 440 /* offsetof(struct pt_regs, orig_r28) */
   5.213 -+#define PT_KSP 444 /* offsetof(struct pt_regs, ksp) */
   5.214 -+#define PT_KPC 448 /* offsetof(struct pt_regs, kpc) */
   5.215 -+#define PT_SAR 452 /* offsetof(struct pt_regs, sar) */
   5.216 -+#define PT_IIR 456 /* offsetof(struct pt_regs, iir) */
   5.217 -+#define PT_ISR 460 /* offsetof(struct pt_regs, isr) */
   5.218 -+#define PT_IOR 464 /* offsetof(struct pt_regs, ior) */
   5.219 -+#define PT_SIZE 472 /* sizeof(struct pt_regs) */
   5.220 -+#define PT_SZ_ALGN 576 /* align(sizeof(struct pt_regs), 64) */
   5.221 -+
   5.222 -+#define TI_TASK 0 /* offsetof(struct thread_info, task) */
   5.223 -+#define TI_EXEC_DOMAIN 4 /* offsetof(struct thread_info, exec_domain) */
   5.224 -+#define TI_FLAGS 8 /* offsetof(struct thread_info, flags) */
   5.225 -+#define TI_CPU 16 /* offsetof(struct thread_info, cpu) */
   5.226 -+#define TI_SEGMENT 12 /* offsetof(struct thread_info, addr_limit) */
   5.227 -+#define TI_PRE_COUNT 20 /* offsetof(struct thread_info, preempt_count) */
   5.228 -+#define THREAD_SZ 44 /* sizeof(struct thread_info) */
   5.229 -+#define THREAD_SZ_ALGN 128 /* align(sizeof(struct thread_info), 64) */
   5.230 -+
   5.231 -+#define IRQSTAT_SIRQ_PEND 0 /* offsetof(irq_cpustat_t, __softirq_pending) */
   5.232 -+#define IRQSTAT_SZ 64 /* sizeof(irq_cpustat_t) */
   5.233 -+
   5.234 -+#define ICACHE_BASE 8 /* offsetof(struct pdc_cache_info, ic_base) */
   5.235 -+#define ICACHE_STRIDE 12 /* offsetof(struct pdc_cache_info, ic_stride) */
   5.236 -+#define ICACHE_COUNT 16 /* offsetof(struct pdc_cache_info, ic_count) */
   5.237 -+#define ICACHE_LOOP 20 /* offsetof(struct pdc_cache_info, ic_loop) */
   5.238 -+#define DCACHE_BASE 32 /* offsetof(struct pdc_cache_info, dc_base) */
   5.239 -+#define DCACHE_STRIDE 36 /* offsetof(struct pdc_cache_info, dc_stride) */
   5.240 -+#define DCACHE_COUNT 40 /* offsetof(struct pdc_cache_info, dc_count) */
   5.241 -+#define DCACHE_LOOP 44 /* offsetof(struct pdc_cache_info, dc_loop) */
   5.242 -+#define ITLB_SID_BASE 56 /* offsetof(struct pdc_cache_info, it_sp_base) */
   5.243 -+#define ITLB_SID_STRIDE 60 /* offsetof(struct pdc_cache_info, it_sp_stride) */
   5.244 -+#define ITLB_SID_COUNT 64 /* offsetof(struct pdc_cache_info, it_sp_count) */
   5.245 -+#define ITLB_OFF_BASE 68 /* offsetof(struct pdc_cache_info, it_off_base) */
   5.246 -+#define ITLB_OFF_STRIDE 72 /* offsetof(struct pdc_cache_info, it_off_stride) */
   5.247 -+#define ITLB_OFF_COUNT 76 /* offsetof(struct pdc_cache_info, it_off_count) */
   5.248 -+#define ITLB_LOOP 80 /* offsetof(struct pdc_cache_info, it_loop) */
   5.249 -+#define DTLB_SID_BASE 92 /* offsetof(struct pdc_cache_info, dt_sp_base) */
   5.250 -+#define DTLB_SID_STRIDE 96 /* offsetof(struct pdc_cache_info, dt_sp_stride) */
   5.251 -+#define DTLB_SID_COUNT 100 /* offsetof(struct pdc_cache_info, dt_sp_count) */
   5.252 -+#define DTLB_OFF_BASE 104 /* offsetof(struct pdc_cache_info, dt_off_base) */
   5.253 -+#define DTLB_OFF_STRIDE 108 /* offsetof(struct pdc_cache_info, dt_off_stride) */
   5.254 -+#define DTLB_OFF_COUNT 112 /* offsetof(struct pdc_cache_info, dt_off_count) */
   5.255 -+#define DTLB_LOOP 116 /* offsetof(struct pdc_cache_info, dt_loop) */
   5.256 -+
   5.257 -+#define PA_BLOCKSTEP_BIT 1 /* 31-PT_BLOCKSTEP_BIT */
   5.258 -+#define PA_SINGLESTEP_BIT 0 /* 31-PT_SINGLESTEP_BIT */
   5.259 -+
   5.260 -+#define ASM_PMD_SHIFT 21 /* PMD_SHIFT */
   5.261 -+#define ASM_PGDIR_SHIFT 21 /* PGDIR_SHIFT */
   5.262 -+#define ASM_BITS_PER_PGD 11 /* BITS_PER_PGD */
   5.263 -+#define ASM_BITS_PER_PMD 0 /* BITS_PER_PMD */
   5.264 -+#define ASM_BITS_PER_PTE 9 /* BITS_PER_PTE */
   5.265 -+#define ASM_PGD_PMD_OFFSET -8192 /* -(PAGE_SIZE << PGD_ORDER) */
   5.266 -+#define ASM_PMD_ENTRY 128 /* ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT) */
   5.267 -+#define ASM_PGD_ENTRY 128 /* PAGE_OFFSET >> PGDIR_SHIFT */
   5.268 -+#define ASM_PGD_ENTRY_SIZE 4 /* PGD_ENTRY_SIZE */
   5.269 -+#define ASM_PMD_ENTRY_SIZE 4 /* PMD_ENTRY_SIZE */
   5.270 -+#define ASM_PTE_ENTRY_SIZE 8 /* PTE_ENTRY_SIZE */
   5.271 -+#define ASM_PT_INITIAL 4 /* PT_INITIAL */
   5.272 -+#define ASM_PAGE_SIZE 4096 /* PAGE_SIZE */
   5.273 -+
   5.274 -+
   5.275 -+#endif
     6.1 --- a/patches/gdb/6.7.1/120-deleted-children.patch	Tue Oct 27 20:06:07 2009 +0100
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,26 +0,0 @@
     6.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/50_all_gdb-deleted-children.patch
     6.5 --= BEGIN original header =-
     6.6 -http://bugs.gentoo.org/210636
     6.7 -http://sourceware.org/ml/gdb-patches/2007-11/msg00136.html
     6.8 -
     6.9 -2007-11-07  Vladimir Prus  <vladimir@codesourcery.com>
    6.10 -
    6.11 -	Fix crash when a variable object being deleted
    6.12 -	has any of its children deleted previously.
    6.13 -	
    6.14 -	* varobj.c (delete_variable_1): Don't recurse
    6.15 -	into deleted children.
    6.16 -
    6.17 --= END original header =-
    6.18 -diff -durN gdb-6.7.1.orig/gdb/varobj.c gdb-6.7.1/gdb/varobj.c
    6.19 ---- gdb-6.7.1.orig/gdb/varobj.c	2007-08-31 21:01:17.000000000 +0200
    6.20 -+++ gdb-6.7.1/gdb/varobj.c	2008-06-17 23:27:45.000000000 +0200
    6.21 -@@ -1295,6 +1295,8 @@
    6.22 -   for (i = 0; i < VEC_length (varobj_p, var->children); ++i)
    6.23 -     {   
    6.24 -       varobj_p child = VEC_index (varobj_p, var->children, i);
    6.25 -+      if (!child)
    6.26 -+	continue;
    6.27 -       if (!remove_from_parent_p)
    6.28 - 	child->parent = NULL;
    6.29 -       delete_variable_1 (resultp, delcountp, child, 0, only_children_p);
     7.1 --- a/patches/gdb/6.7.1/130-dwarf-stack-overflow.patch	Tue Oct 27 20:06:07 2009 +0100
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,52 +0,0 @@
     7.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/80_all_gdb-6.5-dwarf-stack-overflow.patch
     7.5 --= BEGIN original header =-
     7.6 -http://bugs.gentoo.org/144833
     7.7 -
     7.8 -for gdb/ChangeLog:
     7.9 -2006-08-22  Will Drewry <wad@google.com>
    7.10 -	    Tavis Ormandy <taviso@google.com>
    7.11 -
    7.12 -	* dwarf2read.c (decode_locdesc): Enforce location description stack
    7.13 -	boundaries.
    7.14 -	* dwarfread.c (locval): Likewise.
    7.15 -
    7.16 --= END original header =-
    7.17 -diff -durN gdb-6.7.1.orig/gdb/dwarf2read.c gdb-6.7.1/gdb/dwarf2read.c
    7.18 ---- gdb-6.7.1.orig/gdb/dwarf2read.c	2007-09-05 02:51:48.000000000 +0200
    7.19 -+++ gdb-6.7.1/gdb/dwarf2read.c	2008-06-17 23:27:46.000000000 +0200
    7.20 -@@ -9061,8 +9061,7 @@
    7.21 -    callers will only want a very basic result and this can become a
    7.22 -    complaint.
    7.23 - 
    7.24 --   Note that stack[0] is unused except as a default error return.
    7.25 --   Note that stack overflow is not yet handled.  */
    7.26 -+   Note that stack[0] is unused except as a default error return. */
    7.27 - 
    7.28 - static CORE_ADDR
    7.29 - decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
    7.30 -@@ -9079,7 +9078,7 @@
    7.31 - 
    7.32 -   i = 0;
    7.33 -   stacki = 0;
    7.34 --  stack[stacki] = 0;
    7.35 -+  stack[++stacki] = 0;
    7.36 - 
    7.37 -   while (i < size)
    7.38 -     {
    7.39 -@@ -9261,6 +9260,16 @@
    7.40 - 		     dwarf_stack_op_name (op));
    7.41 - 	  return (stack[stacki]);
    7.42 - 	}
    7.43 -+      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
    7.44 -+         outside of the allocated space. Also enforce minimum > 0.
    7.45 -+         -- wad@google.com 14 Aug 2006 */
    7.46 -+      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
    7.47 -+	internal_error (__FILE__, __LINE__,
    7.48 -+	                _("location description stack too deep: %d"),
    7.49 -+	                stacki);
    7.50 -+      if (stacki <= 0)
    7.51 -+	internal_error (__FILE__, __LINE__,
    7.52 -+	                _("location description stack too shallow"));
    7.53 -     }
    7.54 -   return (stack[stacki]);
    7.55 - }
     8.1 --- a/patches/gdb/6.7/100-security-errata-20050610.patch	Tue Oct 27 20:06:07 2009 +0100
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,205 +0,0 @@
     8.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/35_all_gdb-6.3-security-errata-20050610.patch
     8.5 --= BEGIN original header =-
     8.6 -2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
     8.7 -
     8.8 -        * gdb.base/gdbinit.exp: New testcase.
     8.9 -        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
    8.10 -
    8.11 -2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
    8.12 -            Jeff Johnston  <jjohnstn@redhat.com>
    8.13 -
    8.14 -        * Makefile.in (cli-cmds.o): Update.
    8.15 -        * configure.in: Add check for getuid.
    8.16 -        * configure: Regenerated.
    8.17 -        * config.in: Ditto.
    8.18 -        * main.c (captured_main): Pass -1 to source_command when loading
    8.19 -        gdbinit files.
    8.20 -        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
    8.21 -        (source_command): Update documentation.  Check permissions if
    8.22 -        FROM_TTY is -1.
    8.23 -
    8.24 --= END original header =-
    8.25 -diff -durN gdb-6.7.orig/gdb/cli/cli-cmds.c gdb-6.7/gdb/cli/cli-cmds.c
    8.26 ---- gdb-6.7.orig/gdb/cli/cli-cmds.c	2007-08-23 20:08:47.000000000 +0200
    8.27 -+++ gdb-6.7/gdb/cli/cli-cmds.c	2008-06-17 23:25:23.000000000 +0200
    8.28 -@@ -36,6 +36,7 @@
    8.29 - #include "objfiles.h"
    8.30 - #include "source.h"
    8.31 - #include "disasm.h"
    8.32 -+#include "gdb_stat.h"
    8.33 - 
    8.34 - #include "ui-out.h"
    8.35 - 
    8.36 -@@ -459,12 +460,31 @@
    8.37 - 
    8.38 -   if (fd == -1)
    8.39 -     {
    8.40 --      if (from_tty)
    8.41 -+      if (from_tty > 0)
    8.42 - 	perror_with_name (file);
    8.43 -       else
    8.44 - 	return;
    8.45 -     }
    8.46 - 
    8.47 -+#ifdef HAVE_GETUID
    8.48 -+  if (from_tty == -1)
    8.49 -+    {
    8.50 -+      struct stat statbuf;
    8.51 -+      if (fstat (fd, &statbuf) < 0)
    8.52 -+	{
    8.53 -+	  perror_with_name (file);
    8.54 -+	  close (fd);
    8.55 -+	  return;
    8.56 -+	}
    8.57 -+      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
    8.58 -+	{
    8.59 -+          warning (_("not using untrusted file \"%s\""), file);
    8.60 -+	  close (fd);
    8.61 -+	  return;
    8.62 -+	}
    8.63 -+    }
    8.64 -+#endif
    8.65 -+
    8.66 -   stream = fdopen (fd, FOPEN_RT);
    8.67 -   script_from_file (stream, file);
    8.68 - 
    8.69 -diff -durN gdb-6.7.orig/gdb/main.c gdb-6.7/gdb/main.c
    8.70 ---- gdb-6.7.orig/gdb/main.c	2007-08-23 20:08:36.000000000 +0200
    8.71 -+++ gdb-6.7/gdb/main.c	2008-06-17 23:25:23.000000000 +0200
    8.72 -@@ -688,7 +688,7 @@
    8.73 - 
    8.74 -       if (!inhibit_gdbinit)
    8.75 - 	{
    8.76 --	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
    8.77 -+	  catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL);
    8.78 - 	}
    8.79 - 
    8.80 -       /* Do stats; no need to do them elsewhere since we'll only
    8.81 -@@ -766,7 +766,7 @@
    8.82 -       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
    8.83 -     if (!inhibit_gdbinit)
    8.84 -       {
    8.85 --	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
    8.86 -+	catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL);
    8.87 -       }
    8.88 - 
    8.89 -   for (i = 0; i < ncmd; i++)
    8.90 -diff -durN gdb-6.7.orig/gdb/Makefile.in gdb-6.7/gdb/Makefile.in
    8.91 ---- gdb-6.7.orig/gdb/Makefile.in	2007-09-05 02:14:02.000000000 +0200
    8.92 -+++ gdb-6.7/gdb/Makefile.in	2008-06-17 23:25:23.000000000 +0200
    8.93 -@@ -2882,7 +2882,7 @@
    8.94 - 	$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
    8.95 - 	$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
    8.96 - 	$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
    8.97 --	$(tui_h)
    8.98 -+	$(tui_h) $(gdb_stat_h)
    8.99 - 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
   8.100 - cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
   8.101 - 	$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
   8.102 -diff -durN gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.7/gdb/testsuite/gdb.base/gdbinit.exp
   8.103 ---- gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.exp	1970-01-01 01:00:00.000000000 +0100
   8.104 -+++ gdb-6.7/gdb/testsuite/gdb.base/gdbinit.exp	2008-06-17 23:25:23.000000000 +0200
   8.105 -@@ -0,0 +1,98 @@
   8.106 -+#   Copyright 2005
   8.107 -+#   Free Software Foundation, Inc.
   8.108 -+
   8.109 -+# This program is free software; you can redistribute it and/or modify
   8.110 -+# it under the terms of the GNU General Public License as published by
   8.111 -+# the Free Software Foundation; either version 2 of the License, or
   8.112 -+# (at your option) any later version.
   8.113 -+# 
   8.114 -+# This program is distributed in the hope that it will be useful,
   8.115 -+# but WITHOUT ANY WARRANTY; without even the implied warranty of
   8.116 -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   8.117 -+# GNU General Public License for more details.
   8.118 -+# 
   8.119 -+# You should have received a copy of the GNU General Public License
   8.120 -+# along with this program; if not, write to the Free Software
   8.121 -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
   8.122 -+
   8.123 -+# Please email any bugs, comments, and/or additions to this file to:
   8.124 -+# bug-gdb@prep.ai.mit.edu
   8.125 -+
   8.126 -+# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
   8.127 -+
   8.128 -+if $tracelevel then {
   8.129 -+    strace $tracelevel
   8.130 -+}
   8.131 -+
   8.132 -+set prms_id 0
   8.133 -+set bug_id 0
   8.134 -+
   8.135 -+# are we on a target board
   8.136 -+if [is_remote target] {
   8.137 -+    return
   8.138 -+}
   8.139 -+
   8.140 -+
   8.141 -+global verbose
   8.142 -+global GDB
   8.143 -+global GDBFLAGS
   8.144 -+global gdb_prompt
   8.145 -+global timeout
   8.146 -+global gdb_spawn_id;
   8.147 -+                                                                                
   8.148 -+gdb_stop_suppressing_tests;
   8.149 -+                                                                                
   8.150 -+verbose "Spawning $GDB -nw"
   8.151 -+                                                                                
   8.152 -+if [info exists gdb_spawn_id] {
   8.153 -+    return 0;
   8.154 -+}
   8.155 -+                                                                                
   8.156 -+if ![is_remote host] {
   8.157 -+   if { [which $GDB] == 0 } then {
   8.158 -+        perror "$GDB does not exist."
   8.159 -+        exit 1
   8.160 -+    }
   8.161 -+}
   8.162 -+
   8.163 -+set env(HOME) [pwd]
   8.164 -+remote_exec build "rm .gdbinit"
   8.165 -+remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
   8.166 -+remote_exec build "chmod 646 .gdbinit"
   8.167 -+
   8.168 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
   8.169 -+if { $res < 0 || $res == "" } {
   8.170 -+    perror "Spawning $GDB failed."
   8.171 -+    return 1;
   8.172 -+}
   8.173 -+gdb_expect 360 {
   8.174 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
   8.175 -+        pass "untrusted .gdbinit caught."
   8.176 -+    }
   8.177 -+    -re "$gdb_prompt $"     {
   8.178 -+        fail "untrusted .gdbinit caught."
   8.179 -+    }
   8.180 -+    timeout {
   8.181 -+        fail "(timeout) untrusted .gdbinit caught."
   8.182 -+    }
   8.183 -+}
   8.184 -+
   8.185 -+remote_exec build "chmod 644 .gdbinit"
   8.186 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
   8.187 -+if { $res < 0 || $res == "" } {
   8.188 -+    perror "Spawning $GDB failed."
   8.189 -+    return 1;
   8.190 -+}
   8.191 -+gdb_expect 360 {
   8.192 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
   8.193 -+        fail "trusted .gdbinit allowed."
   8.194 -+    }
   8.195 -+    -re "in gdbinit.*$gdb_prompt $"     {
   8.196 -+        pass "trusted .gdbinit allowed."
   8.197 -+    }
   8.198 -+    timeout {
   8.199 -+        fail "(timeout) trusted .gdbinit allowed."
   8.200 -+    }
   8.201 -+}
   8.202 -+
   8.203 -+remote_exec build "rm .gdbinit"
   8.204 -diff -durN gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.7/gdb/testsuite/gdb.base/gdbinit.sample
   8.205 ---- gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.sample	1970-01-01 01:00:00.000000000 +0100
   8.206 -+++ gdb-6.7/gdb/testsuite/gdb.base/gdbinit.sample	2008-06-17 23:25:23.000000000 +0200
   8.207 -@@ -0,0 +1 @@
   8.208 -+echo "\nin gdbinit"
     9.1 --- a/patches/gdb/6.7/110-hppa-offsets.patch	Tue Oct 27 20:06:07 2009 +0100
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,272 +0,0 @@
     9.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/45_all_gdb-hppa-offsets.patch
     9.5 --= BEGIN original header =-
     9.6 -sanitized headers dont include asm/offsets.h, so cache a local copy 
     9.7 -
     9.8 -http://bugs.gentoo.org/180476
     9.9 -http://lists.parisc-linux.org/pipermail/parisc-linux/2007-February/031162.html
    9.10 -
    9.11 --= END original header =-
    9.12 -diff -durN gdb-6.7.orig/gdb/hppa-linux-nat.c gdb-6.7/gdb/hppa-linux-nat.c
    9.13 ---- gdb-6.7.orig/gdb/hppa-linux-nat.c	2007-08-23 20:08:33.000000000 +0200
    9.14 -+++ gdb-6.7/gdb/hppa-linux-nat.c	2008-06-17 23:25:28.000000000 +0200
    9.15 -@@ -32,7 +32,7 @@
    9.16 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43)
    9.17 - #include <asm/offset.h>
    9.18 - #else
    9.19 --#include <asm/offsets.h>
    9.20 -+#include <hppa-offsets.h>
    9.21 - #endif
    9.22 - 
    9.23 - #include "hppa-tdep.h"
    9.24 -diff -durN gdb-6.7.orig/gdb/hppa-offsets.h gdb-6.7/gdb/hppa-offsets.h
    9.25 ---- gdb-6.7.orig/gdb/hppa-offsets.h	1970-01-01 01:00:00.000000000 +0100
    9.26 -+++ gdb-6.7/gdb/hppa-offsets.h	2008-06-17 23:25:28.000000000 +0200
    9.27 -@@ -0,0 +1,248 @@
    9.28 -+#ifndef __ASM_OFFSETS_H__
    9.29 -+#define __ASM_OFFSETS_H__
    9.30 -+/*
    9.31 -+ * DO NOT MODIFY.
    9.32 -+ *
    9.33 -+ * This file was generated by arch/parisc/Makefile
    9.34 -+ *
    9.35 -+ */
    9.36 -+
    9.37 -+#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */
    9.38 -+#define TASK_STATE 0 /* offsetof(struct task_struct, state) */
    9.39 -+#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */
    9.40 -+#define TASK_SIGPENDING 1188 /* offsetof(struct task_struct, pending) */
    9.41 -+#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */
    9.42 -+#define TASK_MM 108 /* offsetof(struct task_struct, mm) */
    9.43 -+#define TASK_PERSONALITY 132 /* offsetof(struct task_struct, personality) */
    9.44 -+#define TASK_PID 140 /* offsetof(struct task_struct, pid) */
    9.45 -+
    9.46 -+#define TASK_REGS 664 /* offsetof(struct task_struct, thread.regs) */
    9.47 -+#define TASK_PT_PSW 664 /* offsetof(struct task_struct, thread.regs.gr[ 0]) */
    9.48 -+#define TASK_PT_GR1 668 /* offsetof(struct task_struct, thread.regs.gr[ 1]) */
    9.49 -+#define TASK_PT_GR2 672 /* offsetof(struct task_struct, thread.regs.gr[ 2]) */
    9.50 -+#define TASK_PT_GR3 676 /* offsetof(struct task_struct, thread.regs.gr[ 3]) */
    9.51 -+#define TASK_PT_GR4 680 /* offsetof(struct task_struct, thread.regs.gr[ 4]) */
    9.52 -+#define TASK_PT_GR5 684 /* offsetof(struct task_struct, thread.regs.gr[ 5]) */
    9.53 -+#define TASK_PT_GR6 688 /* offsetof(struct task_struct, thread.regs.gr[ 6]) */
    9.54 -+#define TASK_PT_GR7 692 /* offsetof(struct task_struct, thread.regs.gr[ 7]) */
    9.55 -+#define TASK_PT_GR8 696 /* offsetof(struct task_struct, thread.regs.gr[ 8]) */
    9.56 -+#define TASK_PT_GR9 700 /* offsetof(struct task_struct, thread.regs.gr[ 9]) */
    9.57 -+#define TASK_PT_GR10 704 /* offsetof(struct task_struct, thread.regs.gr[10]) */
    9.58 -+#define TASK_PT_GR11 708 /* offsetof(struct task_struct, thread.regs.gr[11]) */
    9.59 -+#define TASK_PT_GR12 712 /* offsetof(struct task_struct, thread.regs.gr[12]) */
    9.60 -+#define TASK_PT_GR13 716 /* offsetof(struct task_struct, thread.regs.gr[13]) */
    9.61 -+#define TASK_PT_GR14 720 /* offsetof(struct task_struct, thread.regs.gr[14]) */
    9.62 -+#define TASK_PT_GR15 724 /* offsetof(struct task_struct, thread.regs.gr[15]) */
    9.63 -+#define TASK_PT_GR16 728 /* offsetof(struct task_struct, thread.regs.gr[16]) */
    9.64 -+#define TASK_PT_GR17 732 /* offsetof(struct task_struct, thread.regs.gr[17]) */
    9.65 -+#define TASK_PT_GR18 736 /* offsetof(struct task_struct, thread.regs.gr[18]) */
    9.66 -+#define TASK_PT_GR19 740 /* offsetof(struct task_struct, thread.regs.gr[19]) */
    9.67 -+#define TASK_PT_GR20 744 /* offsetof(struct task_struct, thread.regs.gr[20]) */
    9.68 -+#define TASK_PT_GR21 748 /* offsetof(struct task_struct, thread.regs.gr[21]) */
    9.69 -+#define TASK_PT_GR22 752 /* offsetof(struct task_struct, thread.regs.gr[22]) */
    9.70 -+#define TASK_PT_GR23 756 /* offsetof(struct task_struct, thread.regs.gr[23]) */
    9.71 -+#define TASK_PT_GR24 760 /* offsetof(struct task_struct, thread.regs.gr[24]) */
    9.72 -+#define TASK_PT_GR25 764 /* offsetof(struct task_struct, thread.regs.gr[25]) */
    9.73 -+#define TASK_PT_GR26 768 /* offsetof(struct task_struct, thread.regs.gr[26]) */
    9.74 -+#define TASK_PT_GR27 772 /* offsetof(struct task_struct, thread.regs.gr[27]) */
    9.75 -+#define TASK_PT_GR28 776 /* offsetof(struct task_struct, thread.regs.gr[28]) */
    9.76 -+#define TASK_PT_GR29 780 /* offsetof(struct task_struct, thread.regs.gr[29]) */
    9.77 -+#define TASK_PT_GR30 784 /* offsetof(struct task_struct, thread.regs.gr[30]) */
    9.78 -+#define TASK_PT_GR31 788 /* offsetof(struct task_struct, thread.regs.gr[31]) */
    9.79 -+#define TASK_PT_FR0 792 /* offsetof(struct task_struct, thread.regs.fr[ 0]) */
    9.80 -+#define TASK_PT_FR1 800 /* offsetof(struct task_struct, thread.regs.fr[ 1]) */
    9.81 -+#define TASK_PT_FR2 808 /* offsetof(struct task_struct, thread.regs.fr[ 2]) */
    9.82 -+#define TASK_PT_FR3 816 /* offsetof(struct task_struct, thread.regs.fr[ 3]) */
    9.83 -+#define TASK_PT_FR4 824 /* offsetof(struct task_struct, thread.regs.fr[ 4]) */
    9.84 -+#define TASK_PT_FR5 832 /* offsetof(struct task_struct, thread.regs.fr[ 5]) */
    9.85 -+#define TASK_PT_FR6 840 /* offsetof(struct task_struct, thread.regs.fr[ 6]) */
    9.86 -+#define TASK_PT_FR7 848 /* offsetof(struct task_struct, thread.regs.fr[ 7]) */
    9.87 -+#define TASK_PT_FR8 856 /* offsetof(struct task_struct, thread.regs.fr[ 8]) */
    9.88 -+#define TASK_PT_FR9 864 /* offsetof(struct task_struct, thread.regs.fr[ 9]) */
    9.89 -+#define TASK_PT_FR10 872 /* offsetof(struct task_struct, thread.regs.fr[10]) */
    9.90 -+#define TASK_PT_FR11 880 /* offsetof(struct task_struct, thread.regs.fr[11]) */
    9.91 -+#define TASK_PT_FR12 888 /* offsetof(struct task_struct, thread.regs.fr[12]) */
    9.92 -+#define TASK_PT_FR13 896 /* offsetof(struct task_struct, thread.regs.fr[13]) */
    9.93 -+#define TASK_PT_FR14 904 /* offsetof(struct task_struct, thread.regs.fr[14]) */
    9.94 -+#define TASK_PT_FR15 912 /* offsetof(struct task_struct, thread.regs.fr[15]) */
    9.95 -+#define TASK_PT_FR16 920 /* offsetof(struct task_struct, thread.regs.fr[16]) */
    9.96 -+#define TASK_PT_FR17 928 /* offsetof(struct task_struct, thread.regs.fr[17]) */
    9.97 -+#define TASK_PT_FR18 936 /* offsetof(struct task_struct, thread.regs.fr[18]) */
    9.98 -+#define TASK_PT_FR19 944 /* offsetof(struct task_struct, thread.regs.fr[19]) */
    9.99 -+#define TASK_PT_FR20 952 /* offsetof(struct task_struct, thread.regs.fr[20]) */
   9.100 -+#define TASK_PT_FR21 960 /* offsetof(struct task_struct, thread.regs.fr[21]) */
   9.101 -+#define TASK_PT_FR22 968 /* offsetof(struct task_struct, thread.regs.fr[22]) */
   9.102 -+#define TASK_PT_FR23 976 /* offsetof(struct task_struct, thread.regs.fr[23]) */
   9.103 -+#define TASK_PT_FR24 984 /* offsetof(struct task_struct, thread.regs.fr[24]) */
   9.104 -+#define TASK_PT_FR25 992 /* offsetof(struct task_struct, thread.regs.fr[25]) */
   9.105 -+#define TASK_PT_FR26 1000 /* offsetof(struct task_struct, thread.regs.fr[26]) */
   9.106 -+#define TASK_PT_FR27 1008 /* offsetof(struct task_struct, thread.regs.fr[27]) */
   9.107 -+#define TASK_PT_FR28 1016 /* offsetof(struct task_struct, thread.regs.fr[28]) */
   9.108 -+#define TASK_PT_FR29 1024 /* offsetof(struct task_struct, thread.regs.fr[29]) */
   9.109 -+#define TASK_PT_FR30 1032 /* offsetof(struct task_struct, thread.regs.fr[30]) */
   9.110 -+#define TASK_PT_FR31 1040 /* offsetof(struct task_struct, thread.regs.fr[31]) */
   9.111 -+#define TASK_PT_SR0 1048 /* offsetof(struct task_struct, thread.regs.sr[ 0]) */
   9.112 -+#define TASK_PT_SR1 1052 /* offsetof(struct task_struct, thread.regs.sr[ 1]) */
   9.113 -+#define TASK_PT_SR2 1056 /* offsetof(struct task_struct, thread.regs.sr[ 2]) */
   9.114 -+#define TASK_PT_SR3 1060 /* offsetof(struct task_struct, thread.regs.sr[ 3]) */
   9.115 -+#define TASK_PT_SR4 1064 /* offsetof(struct task_struct, thread.regs.sr[ 4]) */
   9.116 -+#define TASK_PT_SR5 1068 /* offsetof(struct task_struct, thread.regs.sr[ 5]) */
   9.117 -+#define TASK_PT_SR6 1072 /* offsetof(struct task_struct, thread.regs.sr[ 6]) */
   9.118 -+#define TASK_PT_SR7 1076 /* offsetof(struct task_struct, thread.regs.sr[ 7]) */
   9.119 -+#define TASK_PT_IASQ0 1080 /* offsetof(struct task_struct, thread.regs.iasq[0]) */
   9.120 -+#define TASK_PT_IASQ1 1084 /* offsetof(struct task_struct, thread.regs.iasq[1]) */
   9.121 -+#define TASK_PT_IAOQ0 1088 /* offsetof(struct task_struct, thread.regs.iaoq[0]) */
   9.122 -+#define TASK_PT_IAOQ1 1092 /* offsetof(struct task_struct, thread.regs.iaoq[1]) */
   9.123 -+#define TASK_PT_CR27 1096 /* offsetof(struct task_struct, thread.regs.cr27) */
   9.124 -+#define TASK_PT_ORIG_R28 1104 /* offsetof(struct task_struct, thread.regs.orig_r28) */
   9.125 -+#define TASK_PT_KSP 1108 /* offsetof(struct task_struct, thread.regs.ksp) */
   9.126 -+#define TASK_PT_KPC 1112 /* offsetof(struct task_struct, thread.regs.kpc) */
   9.127 -+#define TASK_PT_SAR 1116 /* offsetof(struct task_struct, thread.regs.sar) */
   9.128 -+#define TASK_PT_IIR 1120 /* offsetof(struct task_struct, thread.regs.iir) */
   9.129 -+#define TASK_PT_ISR 1124 /* offsetof(struct task_struct, thread.regs.isr) */
   9.130 -+#define TASK_PT_IOR 1128 /* offsetof(struct task_struct, thread.regs.ior) */
   9.131 -+
   9.132 -+#define TASK_SZ 1272 /* sizeof(struct task_struct) */
   9.133 -+#define TASK_SZ_ALGN 1344 /* align(sizeof(struct task_struct), 64) */
   9.134 -+
   9.135 -+#define PT_PSW 0 /* offsetof(struct pt_regs, gr[ 0]) */
   9.136 -+#define PT_GR1 4 /* offsetof(struct pt_regs, gr[ 1]) */
   9.137 -+#define PT_GR2 8 /* offsetof(struct pt_regs, gr[ 2]) */
   9.138 -+#define PT_GR3 12 /* offsetof(struct pt_regs, gr[ 3]) */
   9.139 -+#define PT_GR4 16 /* offsetof(struct pt_regs, gr[ 4]) */
   9.140 -+#define PT_GR5 20 /* offsetof(struct pt_regs, gr[ 5]) */
   9.141 -+#define PT_GR6 24 /* offsetof(struct pt_regs, gr[ 6]) */
   9.142 -+#define PT_GR7 28 /* offsetof(struct pt_regs, gr[ 7]) */
   9.143 -+#define PT_GR8 32 /* offsetof(struct pt_regs, gr[ 8]) */
   9.144 -+#define PT_GR9 36 /* offsetof(struct pt_regs, gr[ 9]) */
   9.145 -+#define PT_GR10 40 /* offsetof(struct pt_regs, gr[10]) */
   9.146 -+#define PT_GR11 44 /* offsetof(struct pt_regs, gr[11]) */
   9.147 -+#define PT_GR12 48 /* offsetof(struct pt_regs, gr[12]) */
   9.148 -+#define PT_GR13 52 /* offsetof(struct pt_regs, gr[13]) */
   9.149 -+#define PT_GR14 56 /* offsetof(struct pt_regs, gr[14]) */
   9.150 -+#define PT_GR15 60 /* offsetof(struct pt_regs, gr[15]) */
   9.151 -+#define PT_GR16 64 /* offsetof(struct pt_regs, gr[16]) */
   9.152 -+#define PT_GR17 68 /* offsetof(struct pt_regs, gr[17]) */
   9.153 -+#define PT_GR18 72 /* offsetof(struct pt_regs, gr[18]) */
   9.154 -+#define PT_GR19 76 /* offsetof(struct pt_regs, gr[19]) */
   9.155 -+#define PT_GR20 80 /* offsetof(struct pt_regs, gr[20]) */
   9.156 -+#define PT_GR21 84 /* offsetof(struct pt_regs, gr[21]) */
   9.157 -+#define PT_GR22 88 /* offsetof(struct pt_regs, gr[22]) */
   9.158 -+#define PT_GR23 92 /* offsetof(struct pt_regs, gr[23]) */
   9.159 -+#define PT_GR24 96 /* offsetof(struct pt_regs, gr[24]) */
   9.160 -+#define PT_GR25 100 /* offsetof(struct pt_regs, gr[25]) */
   9.161 -+#define PT_GR26 104 /* offsetof(struct pt_regs, gr[26]) */
   9.162 -+#define PT_GR27 108 /* offsetof(struct pt_regs, gr[27]) */
   9.163 -+#define PT_GR28 112 /* offsetof(struct pt_regs, gr[28]) */
   9.164 -+#define PT_GR29 116 /* offsetof(struct pt_regs, gr[29]) */
   9.165 -+#define PT_GR30 120 /* offsetof(struct pt_regs, gr[30]) */
   9.166 -+#define PT_GR31 124 /* offsetof(struct pt_regs, gr[31]) */
   9.167 -+#define PT_FR0 128 /* offsetof(struct pt_regs, fr[ 0]) */
   9.168 -+#define PT_FR1 136 /* offsetof(struct pt_regs, fr[ 1]) */
   9.169 -+#define PT_FR2 144 /* offsetof(struct pt_regs, fr[ 2]) */
   9.170 -+#define PT_FR3 152 /* offsetof(struct pt_regs, fr[ 3]) */
   9.171 -+#define PT_FR4 160 /* offsetof(struct pt_regs, fr[ 4]) */
   9.172 -+#define PT_FR5 168 /* offsetof(struct pt_regs, fr[ 5]) */
   9.173 -+#define PT_FR6 176 /* offsetof(struct pt_regs, fr[ 6]) */
   9.174 -+#define PT_FR7 184 /* offsetof(struct pt_regs, fr[ 7]) */
   9.175 -+#define PT_FR8 192 /* offsetof(struct pt_regs, fr[ 8]) */
   9.176 -+#define PT_FR9 200 /* offsetof(struct pt_regs, fr[ 9]) */
   9.177 -+#define PT_FR10 208 /* offsetof(struct pt_regs, fr[10]) */
   9.178 -+#define PT_FR11 216 /* offsetof(struct pt_regs, fr[11]) */
   9.179 -+#define PT_FR12 224 /* offsetof(struct pt_regs, fr[12]) */
   9.180 -+#define PT_FR13 232 /* offsetof(struct pt_regs, fr[13]) */
   9.181 -+#define PT_FR14 240 /* offsetof(struct pt_regs, fr[14]) */
   9.182 -+#define PT_FR15 248 /* offsetof(struct pt_regs, fr[15]) */
   9.183 -+#define PT_FR16 256 /* offsetof(struct pt_regs, fr[16]) */
   9.184 -+#define PT_FR17 264 /* offsetof(struct pt_regs, fr[17]) */
   9.185 -+#define PT_FR18 272 /* offsetof(struct pt_regs, fr[18]) */
   9.186 -+#define PT_FR19 280 /* offsetof(struct pt_regs, fr[19]) */
   9.187 -+#define PT_FR20 288 /* offsetof(struct pt_regs, fr[20]) */
   9.188 -+#define PT_FR21 296 /* offsetof(struct pt_regs, fr[21]) */
   9.189 -+#define PT_FR22 304 /* offsetof(struct pt_regs, fr[22]) */
   9.190 -+#define PT_FR23 312 /* offsetof(struct pt_regs, fr[23]) */
   9.191 -+#define PT_FR24 320 /* offsetof(struct pt_regs, fr[24]) */
   9.192 -+#define PT_FR25 328 /* offsetof(struct pt_regs, fr[25]) */
   9.193 -+#define PT_FR26 336 /* offsetof(struct pt_regs, fr[26]) */
   9.194 -+#define PT_FR27 344 /* offsetof(struct pt_regs, fr[27]) */
   9.195 -+#define PT_FR28 352 /* offsetof(struct pt_regs, fr[28]) */
   9.196 -+#define PT_FR29 360 /* offsetof(struct pt_regs, fr[29]) */
   9.197 -+#define PT_FR30 368 /* offsetof(struct pt_regs, fr[30]) */
   9.198 -+#define PT_FR31 376 /* offsetof(struct pt_regs, fr[31]) */
   9.199 -+#define PT_SR0 384 /* offsetof(struct pt_regs, sr[ 0]) */
   9.200 -+#define PT_SR1 388 /* offsetof(struct pt_regs, sr[ 1]) */
   9.201 -+#define PT_SR2 392 /* offsetof(struct pt_regs, sr[ 2]) */
   9.202 -+#define PT_SR3 396 /* offsetof(struct pt_regs, sr[ 3]) */
   9.203 -+#define PT_SR4 400 /* offsetof(struct pt_regs, sr[ 4]) */
   9.204 -+#define PT_SR5 404 /* offsetof(struct pt_regs, sr[ 5]) */
   9.205 -+#define PT_SR6 408 /* offsetof(struct pt_regs, sr[ 6]) */
   9.206 -+#define PT_SR7 412 /* offsetof(struct pt_regs, sr[ 7]) */
   9.207 -+#define PT_IASQ0 416 /* offsetof(struct pt_regs, iasq[0]) */
   9.208 -+#define PT_IASQ1 420 /* offsetof(struct pt_regs, iasq[1]) */
   9.209 -+#define PT_IAOQ0 424 /* offsetof(struct pt_regs, iaoq[0]) */
   9.210 -+#define PT_IAOQ1 428 /* offsetof(struct pt_regs, iaoq[1]) */
   9.211 -+#define PT_CR27 432 /* offsetof(struct pt_regs, cr27) */
   9.212 -+#define PT_ORIG_R28 440 /* offsetof(struct pt_regs, orig_r28) */
   9.213 -+#define PT_KSP 444 /* offsetof(struct pt_regs, ksp) */
   9.214 -+#define PT_KPC 448 /* offsetof(struct pt_regs, kpc) */
   9.215 -+#define PT_SAR 452 /* offsetof(struct pt_regs, sar) */
   9.216 -+#define PT_IIR 456 /* offsetof(struct pt_regs, iir) */
   9.217 -+#define PT_ISR 460 /* offsetof(struct pt_regs, isr) */
   9.218 -+#define PT_IOR 464 /* offsetof(struct pt_regs, ior) */
   9.219 -+#define PT_SIZE 472 /* sizeof(struct pt_regs) */
   9.220 -+#define PT_SZ_ALGN 576 /* align(sizeof(struct pt_regs), 64) */
   9.221 -+
   9.222 -+#define TI_TASK 0 /* offsetof(struct thread_info, task) */
   9.223 -+#define TI_EXEC_DOMAIN 4 /* offsetof(struct thread_info, exec_domain) */
   9.224 -+#define TI_FLAGS 8 /* offsetof(struct thread_info, flags) */
   9.225 -+#define TI_CPU 16 /* offsetof(struct thread_info, cpu) */
   9.226 -+#define TI_SEGMENT 12 /* offsetof(struct thread_info, addr_limit) */
   9.227 -+#define TI_PRE_COUNT 20 /* offsetof(struct thread_info, preempt_count) */
   9.228 -+#define THREAD_SZ 44 /* sizeof(struct thread_info) */
   9.229 -+#define THREAD_SZ_ALGN 128 /* align(sizeof(struct thread_info), 64) */
   9.230 -+
   9.231 -+#define IRQSTAT_SIRQ_PEND 0 /* offsetof(irq_cpustat_t, __softirq_pending) */
   9.232 -+#define IRQSTAT_SZ 64 /* sizeof(irq_cpustat_t) */
   9.233 -+
   9.234 -+#define ICACHE_BASE 8 /* offsetof(struct pdc_cache_info, ic_base) */
   9.235 -+#define ICACHE_STRIDE 12 /* offsetof(struct pdc_cache_info, ic_stride) */
   9.236 -+#define ICACHE_COUNT 16 /* offsetof(struct pdc_cache_info, ic_count) */
   9.237 -+#define ICACHE_LOOP 20 /* offsetof(struct pdc_cache_info, ic_loop) */
   9.238 -+#define DCACHE_BASE 32 /* offsetof(struct pdc_cache_info, dc_base) */
   9.239 -+#define DCACHE_STRIDE 36 /* offsetof(struct pdc_cache_info, dc_stride) */
   9.240 -+#define DCACHE_COUNT 40 /* offsetof(struct pdc_cache_info, dc_count) */
   9.241 -+#define DCACHE_LOOP 44 /* offsetof(struct pdc_cache_info, dc_loop) */
   9.242 -+#define ITLB_SID_BASE 56 /* offsetof(struct pdc_cache_info, it_sp_base) */
   9.243 -+#define ITLB_SID_STRIDE 60 /* offsetof(struct pdc_cache_info, it_sp_stride) */
   9.244 -+#define ITLB_SID_COUNT 64 /* offsetof(struct pdc_cache_info, it_sp_count) */
   9.245 -+#define ITLB_OFF_BASE 68 /* offsetof(struct pdc_cache_info, it_off_base) */
   9.246 -+#define ITLB_OFF_STRIDE 72 /* offsetof(struct pdc_cache_info, it_off_stride) */
   9.247 -+#define ITLB_OFF_COUNT 76 /* offsetof(struct pdc_cache_info, it_off_count) */
   9.248 -+#define ITLB_LOOP 80 /* offsetof(struct pdc_cache_info, it_loop) */
   9.249 -+#define DTLB_SID_BASE 92 /* offsetof(struct pdc_cache_info, dt_sp_base) */
   9.250 -+#define DTLB_SID_STRIDE 96 /* offsetof(struct pdc_cache_info, dt_sp_stride) */
   9.251 -+#define DTLB_SID_COUNT 100 /* offsetof(struct pdc_cache_info, dt_sp_count) */
   9.252 -+#define DTLB_OFF_BASE 104 /* offsetof(struct pdc_cache_info, dt_off_base) */
   9.253 -+#define DTLB_OFF_STRIDE 108 /* offsetof(struct pdc_cache_info, dt_off_stride) */
   9.254 -+#define DTLB_OFF_COUNT 112 /* offsetof(struct pdc_cache_info, dt_off_count) */
   9.255 -+#define DTLB_LOOP 116 /* offsetof(struct pdc_cache_info, dt_loop) */
   9.256 -+
   9.257 -+#define PA_BLOCKSTEP_BIT 1 /* 31-PT_BLOCKSTEP_BIT */
   9.258 -+#define PA_SINGLESTEP_BIT 0 /* 31-PT_SINGLESTEP_BIT */
   9.259 -+
   9.260 -+#define ASM_PMD_SHIFT 21 /* PMD_SHIFT */
   9.261 -+#define ASM_PGDIR_SHIFT 21 /* PGDIR_SHIFT */
   9.262 -+#define ASM_BITS_PER_PGD 11 /* BITS_PER_PGD */
   9.263 -+#define ASM_BITS_PER_PMD 0 /* BITS_PER_PMD */
   9.264 -+#define ASM_BITS_PER_PTE 9 /* BITS_PER_PTE */
   9.265 -+#define ASM_PGD_PMD_OFFSET -8192 /* -(PAGE_SIZE << PGD_ORDER) */
   9.266 -+#define ASM_PMD_ENTRY 128 /* ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT) */
   9.267 -+#define ASM_PGD_ENTRY 128 /* PAGE_OFFSET >> PGDIR_SHIFT */
   9.268 -+#define ASM_PGD_ENTRY_SIZE 4 /* PGD_ENTRY_SIZE */
   9.269 -+#define ASM_PMD_ENTRY_SIZE 4 /* PMD_ENTRY_SIZE */
   9.270 -+#define ASM_PTE_ENTRY_SIZE 8 /* PTE_ENTRY_SIZE */
   9.271 -+#define ASM_PT_INITIAL 4 /* PT_INITIAL */
   9.272 -+#define ASM_PAGE_SIZE 4096 /* PAGE_SIZE */
   9.273 -+
   9.274 -+
   9.275 -+#endif
    10.1 --- a/patches/gdb/6.7/120-dwarf-stack-overflow.patch	Tue Oct 27 20:06:07 2009 +0100
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,52 +0,0 @@
    10.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/80_all_gdb-6.5-dwarf-stack-overflow.patch
    10.5 --= BEGIN original header =-
    10.6 -http://bugs.gentoo.org/144833
    10.7 -
    10.8 -for gdb/ChangeLog:
    10.9 -2006-08-22  Will Drewry <wad@google.com>
   10.10 -	    Tavis Ormandy <taviso@google.com>
   10.11 -
   10.12 -	* dwarf2read.c (decode_locdesc): Enforce location description stack
   10.13 -	boundaries.
   10.14 -	* dwarfread.c (locval): Likewise.
   10.15 -
   10.16 --= END original header =-
   10.17 -diff -durN gdb-6.7.orig/gdb/dwarf2read.c gdb-6.7/gdb/dwarf2read.c
   10.18 ---- gdb-6.7.orig/gdb/dwarf2read.c	2007-09-05 02:51:48.000000000 +0200
   10.19 -+++ gdb-6.7/gdb/dwarf2read.c	2008-06-17 23:25:38.000000000 +0200
   10.20 -@@ -9061,8 +9061,7 @@
   10.21 -    callers will only want a very basic result and this can become a
   10.22 -    complaint.
   10.23 - 
   10.24 --   Note that stack[0] is unused except as a default error return.
   10.25 --   Note that stack overflow is not yet handled.  */
   10.26 -+   Note that stack[0] is unused except as a default error return. */
   10.27 - 
   10.28 - static CORE_ADDR
   10.29 - decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
   10.30 -@@ -9079,7 +9078,7 @@
   10.31 - 
   10.32 -   i = 0;
   10.33 -   stacki = 0;
   10.34 --  stack[stacki] = 0;
   10.35 -+  stack[++stacki] = 0;
   10.36 - 
   10.37 -   while (i < size)
   10.38 -     {
   10.39 -@@ -9261,6 +9260,16 @@
   10.40 - 		     dwarf_stack_op_name (op));
   10.41 - 	  return (stack[stacki]);
   10.42 - 	}
   10.43 -+      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
   10.44 -+         outside of the allocated space. Also enforce minimum > 0.
   10.45 -+         -- wad@google.com 14 Aug 2006 */
   10.46 -+      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
   10.47 -+	internal_error (__FILE__, __LINE__,
   10.48 -+	                _("location description stack too deep: %d"),
   10.49 -+	                stacki);
   10.50 -+      if (stacki <= 0)
   10.51 -+	internal_error (__FILE__, __LINE__,
   10.52 -+	                _("location description stack too shallow"));
   10.53 -     }
   10.54 -   return (stack[stacki]);
   10.55 - }