rpms/gdb/devel gdb-6.8-bz377541-fortran-dynamic-arrays.patch, NONE, 1.1 gdb-6.8-watchpoint-inaccessible-memory.patch, NONE, 1.1 .cvsignore, 1.24, 1.25 gdb-6.3-catch-debug-registers-error-20060527.patch, 1.2, 1.3 gdb-6.3-dwattype0-20050201.patch, 1.2, 1.3 gdb-6.3-ia64-info-frame-fix-20050725.patch, 1.1, 1.2 gdb-6.3-ia64-sigtramp-fp-20050926.patch, 1.3, 1.4 gdb-6.3-nonthreaded-wp-20050117.patch, 1.6, 1.7 gdb-6.3-pie-20050110.patch, 1.6, 1.7 gdb-6.5-bz181390-memory-address-width.patch, 1.2, 1.3 gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch, 1.4, 1.5 gdb-6.5-gcore-i386-on-amd64.patch, 1.3, 1.4 gdb-6.5-sharedlibrary-path.patch, 1.2, 1.3 gdb-6.6-buildid-locate.patch, 1.8, 1.9 gdb-6.6-bz235197-fork-detach-info.patch, 1.1, 1.2 gdb-6.6-bz247354-leader-exit-fix.patch, 1.1, 1.2 gdb-6.6-multifork-debugreg.patch, 1.3, 1.4 gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch, 1.3, 1.4 gdb-6.7-bz233852-attach-signalled-fix.patch, 1.1, 1.2 gdb-6.7-bz426600-DW_TAG_interface_type-fix.patch, 1.1, 1.2 gdb-6.7-bz426600-DW_TAG_interface_type-test.patch, 1.1, 1.2 gdb.spec, 1.271, 1.272 sources, 1.23, 1.24 gdb-6.3-ia64-sigaltstack-20050711.patch, 1.2, NONE gdb-6.3-ppc64section-20041026.patch, 1.1, NONE gdb-6.3-test-pie-20050107.patch, 1.4, NONE gdb-6.3-threaded-watchpoints-20041213.patch, 1.8, NONE gdb-6.3-threaded-watchpoints2-20050225.patch, 1.5, NONE gdb-6.5-bz237872-ppc-long-double.patch, 1.2, NONE gdb-6.6-bz232371-selinux-thread-error.patch, 1.1, NONE gdb-6.6-bz237096-watchthreads-testcasefix.patch, 1.1, NONE gdb-6.6-cu-ranges.patch, 1.1, NONE gdb-6.7-bz428882-ia64-fix.patch, 1.1, NONE gdb-6.7.1-upstream.patch, 1.4, NONE

Jan Kratochvil (jkratoch) fedora-extras-commits at redhat.com
Mon Mar 3 16:14:39 UTC 2008


Author: jkratoch

Update of /cvs/pkgs/rpms/gdb/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23301

Modified Files:
	.cvsignore gdb-6.3-catch-debug-registers-error-20060527.patch 
	gdb-6.3-dwattype0-20050201.patch 
	gdb-6.3-ia64-info-frame-fix-20050725.patch 
	gdb-6.3-ia64-sigtramp-fp-20050926.patch 
	gdb-6.3-nonthreaded-wp-20050117.patch 
	gdb-6.3-pie-20050110.patch 
	gdb-6.5-bz181390-memory-address-width.patch 
	gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch 
	gdb-6.5-gcore-i386-on-amd64.patch 
	gdb-6.5-sharedlibrary-path.patch gdb-6.6-buildid-locate.patch 
	gdb-6.6-bz235197-fork-detach-info.patch 
	gdb-6.6-bz247354-leader-exit-fix.patch 
	gdb-6.6-multifork-debugreg.patch 
	gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch 
	gdb-6.7-bz233852-attach-signalled-fix.patch 
	gdb-6.7-bz426600-DW_TAG_interface_type-fix.patch 
	gdb-6.7-bz426600-DW_TAG_interface_type-test.patch gdb.spec 
	sources 
Added Files:
	gdb-6.8-bz377541-fortran-dynamic-arrays.patch 
	gdb-6.8-watchpoint-inaccessible-memory.patch 
Removed Files:
	gdb-6.3-ia64-sigaltstack-20050711.patch 
	gdb-6.3-ppc64section-20041026.patch 
	gdb-6.3-test-pie-20050107.patch 
	gdb-6.3-threaded-watchpoints-20041213.patch 
	gdb-6.3-threaded-watchpoints2-20050225.patch 
	gdb-6.5-bz237872-ppc-long-double.patch 
	gdb-6.6-bz232371-selinux-thread-error.patch 
	gdb-6.6-bz237096-watchthreads-testcasefix.patch 
	gdb-6.6-cu-ranges.patch gdb-6.7-bz428882-ia64-fix.patch 
	gdb-6.7.1-upstream.patch 
Log Message:
* Mon Mar  3 2008 Jan Kratochvil <jan.kratochvil at redhat.com> - 6.7.50.20080227-1
- Upgrade to the upstream gdb-6.8 prerelease.
- Cleanup the leftover `.orig' files during %prep.
- Add expat-devel check by the configure script (for the other-arch builds).
- `--with testsuite' now also BuildRequires: fpc
- Backport fix of a segfault + PIE regression since 6.7.1 on PIE executables.
- Update the printed GDB version string to be Fedora specific.


gdb-6.8-bz377541-fortran-dynamic-arrays.patch:

--- NEW FILE gdb-6.8-bz377541-fortran-dynamic-arrays.patch ---
The last version posted upstream:

0: http://sources.redhat.com/ml/gdb-patches/2007-11/msg00438.html
1: http://sources.redhat.com/ml/gdb-patches/2007-11/msg00439.html
2: http://sources.redhat.com/ml/gdb-patches/2007-11/msg00440.html
3: http://sources.redhat.com/ml/gdb-patches/2007-11/msg00441.html
4: http://sources.redhat.com/ml/gdb-patches/2007-11/msg00442.html
5: http://sources.redhat.com/ml/gdb-patches/2007-11/msg00443.html
6: http://sources.redhat.com/ml/gdb-patches/2007-11/msg00444.html

2008-02-24  Jan Kratochvil  <jan.kratochvil at redhat.com>

	Port to GDB-6.8pre.

diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/Makefile.in gdb-6.8cvs20080219/gdb/Makefile.in
--- gdb-6.8cvs20080219-fortranless/gdb/Makefile.in	2008-02-22 08:19:37.000000000 +0100
+++ gdb-6.8cvs20080219/gdb/Makefile.in	2008-02-22 16:59:22.000000000 +0100
@@ -758,6 +758,7 @@ disasm_h = disasm.h
 doublest_h = doublest.h $(floatformat_h)
 dummy_frame_h = dummy-frame.h
 dfp_h = dfp.h
+dwarf2block_h = dwarf2block.h
 dwarf2expr_h = dwarf2expr.h
 dwarf2_frame_h = dwarf2-frame.h
 dwarf2loc_h = dwarf2loc.h
@@ -1051,7 +1052,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $
 	exec.o bcache.o objfiles.o observer.o minsyms.o maint.o demangle.o \
 	dbxread.o coffread.o coff-pe-read.o \
 	dwarf2read.o mipsread.o stabsread.o corefile.o \
-	dwarf2expr.o dwarf2loc.o dwarf2-frame.o \
+	dwarf2block.o dwarf2expr.o dwarf2loc.o dwarf2-frame.o \
 	ada-lang.o c-lang.o f-lang.o objc-lang.o \
 	ui-out.o cli-out.o \
 	varobj.o vec.o wrapper.o \
@@ -2086,6 +2087,8 @@ dummy-frame.o: dummy-frame.c $(defs_h) $
 	$(command_h) $(gdbcmd_h) $(gdb_string_h)
 dfp.o: dfp.c $(defs_h) $(expression_h) $(gdbtypes_h) $(value_h) $(dfp_h) \
 	$(decimal128_h) $(decimal64_h) $(decimal32_h)
+dwarf2block.o: dwarf2block.c $(dwarf2block_h) $(defs_h) $(gdbcore_h) \
+	$(dwarf2expr_h) $(exceptions_h)
 dwarf2expr.o: dwarf2expr.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(value_h) \
 	$(gdbcore_h) $(elf_dwarf2_h) $(dwarf2expr_h)
 dwarf2-frame.o: dwarf2-frame.c $(defs_h) $(dwarf2expr_h) $(elf_dwarf2_h) \
@@ -2096,13 +2099,14 @@ dwarf2-frame.o: dwarf2-frame.c $(defs_h)
 dwarf2loc.o: dwarf2loc.c $(defs_h) $(ui_out_h) $(value_h) $(frame_h) \
 	$(gdbcore_h) $(target_h) $(inferior_h) $(ax_h) $(ax_gdb_h) \
 	$(regcache_h) $(objfiles_h) $(exceptions_h) $(elf_dwarf2_h) \
-	$(dwarf2expr_h) $(dwarf2loc_h) $(gdb_string_h) $(gdb_assert_h)
+	$(dwarf2expr_h) $(dwarf2loc_h) $(gdb_string_h) $(gdb_assert_h) \
+	$(dwarf2block_h)
 dwarf2read.o: dwarf2read.c $(defs_h) $(bfd_h) $(symtab_h) $(gdbtypes_h) \
 	$(objfiles_h) $(elf_dwarf2_h) $(buildsym_h) $(demangle_h) \
 	$(expression_h) $(filenames_h) $(macrotab_h) $(language_h) \
 	$(complaints_h) $(bcache_h) $(dwarf2expr_h) $(dwarf2loc_h) \
 	$(cp_support_h) $(hashtab_h) $(command_h) $(gdbcmd_h) \
-	$(gdb_string_h) $(gdb_assert_h)
+	$(gdb_string_h) $(gdb_assert_h) $(dwarf2block_h) $(f_lang_h)
 elfread.o: elfread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(elf_bfd_h) \
 	$(elf_mips_h) $(symtab_h) $(symfile_h) $(objfiles_h) $(buildsym_h) \
 	$(stabsread_h) $(gdb_stabs_h) $(complaints_h) $(demangle_h) \
@@ -2138,10 +2142,10 @@ f-exp.o: f-exp.c $(defs_h) $(gdb_string_
 findvar.o: findvar.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(frame_h) \
 	$(value_h) $(gdbcore_h) $(inferior_h) $(target_h) $(gdb_string_h) \
 	$(gdb_assert_h) $(floatformat_h) $(symfile_h) $(regcache_h) \
-	$(user_regs_h) $(block_h)
+	$(user_regs_h) $(block_h) $(dwarf2block_h)
 f-lang.o: f-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
 	$(expression_h) $(parser_defs_h) $(language_h) $(f_lang_h) \
-	$(valprint_h) $(value_h)
+	$(valprint_h) $(value_h) $(dwarf2block_h)
 fork-child.o: fork-child.c $(defs_h) $(gdb_string_h) $(frame_h) \
 	$(inferior_h) $(target_h) $(gdb_wait_h) $(gdb_vfork_h) $(gdbcore_h) \
 	$(terminal_h) $(gdbthread_h) $(command_h) $(solib_h)
@@ -2166,7 +2170,7 @@ frv-tdep.o: frv-tdep.c $(defs_h) $(gdb_s
 	$(frv_tdep_h)
 f-typeprint.o: f-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
 	$(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \
-	$(f_lang_h) $(gdb_string_h)
+	$(f_lang_h) $(gdb_string_h) $(dwarf2block_h)
 f-valprint.o: f-valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) \
 	$(gdbtypes_h) $(expression_h) $(value_h) $(valprint_h) $(language_h) \
 	$(f_lang_h) $(frame_h) $(gdbcore_h) $(command_h) $(block_h)
@@ -2181,7 +2185,8 @@ gdb-events.o: gdb-events.c $(defs_h) $(g
 gdbtypes.o: gdbtypes.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \
 	$(symfile_h) $(objfiles_h) $(gdbtypes_h) $(expression_h) \
 	$(language_h) $(target_h) $(value_h) $(demangle_h) $(complaints_h) \
-	$(gdbcmd_h) $(wrapper_h) $(cp_abi_h) $(gdb_assert_h) $(hashtab_h)
+	$(gdbcmd_h) $(wrapper_h) $(cp_abi_h) $(gdb_assert_h) $(hashtab_h) \
+	$(dwarf2block_h)
 glibc-tdep.o: glibc-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(symfile_h) \
 	$(objfiles_h) $(glibc_tdep_h)
 gnu-nat.o: gnu-nat.c $(gdb_string_h) $(defs_h) $(inferior_h) $(symtab_h) \
@@ -2939,7 +2944,7 @@ tramp-frame.o: tramp-frame.c $(defs_h) $
 typeprint.o: typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
 	$(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(command_h) \
 	$(gdbcmd_h) $(target_h) $(language_h) $(cp_abi_h) $(typeprint_h) \
-	$(gdb_string_h)
+	$(gdb_string_h) $(dwarf2block_h)
 ui-file.o: ui-file.c $(defs_h) $(ui_file_h) $(gdb_string_h)
 ui-out.o: ui-out.c $(defs_h) $(gdb_string_h) $(expression_h) $(language_h) \
 	$(ui_out_h) $(gdb_assert_h)
diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/ada-lang.c gdb-6.8cvs20080219/gdb/ada-lang.c
--- gdb-6.8cvs20080219-fortranless/gdb/ada-lang.c	2008-02-14 23:03:56.000000000 +0100
+++ gdb-6.8cvs20080219/gdb/ada-lang.c	2008-02-22 16:47:53.000000000 +0100
@@ -11012,6 +11012,7 @@ const struct language_defn ada_language_
   ada_language_arch_info,
   ada_print_array_index,
   default_pass_by_reference,
+  default_value_address_get,	/* Retrieve the real data value */
   LANG_MAGIC
 };
 
diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/c-lang.c gdb-6.8cvs20080219/gdb/c-lang.c
--- gdb-6.8cvs20080219-fortranless/gdb/c-lang.c	2008-02-14 23:03:56.000000000 +0100
+++ gdb-6.8cvs20080219/gdb/c-lang.c	2008-02-22 17:01:17.000000000 +0100
@@ -427,6 +427,7 @@ const struct language_defn c_language_de
   c_language_arch_info,
   default_print_array_index,
   default_pass_by_reference,
+  default_value_address_get,	/* Retrieve the real data value */
   LANG_MAGIC
 };
 
@@ -540,6 +541,7 @@ const struct language_defn cplus_languag
   cplus_language_arch_info,
   default_print_array_index,
   cp_pass_by_reference,
+  default_value_address_get,	/* Retrieve the real data value */
   LANG_MAGIC
 };
 
@@ -575,6 +577,7 @@ const struct language_defn asm_language_
   c_language_arch_info, /* FIXME: la_language_arch_info.  */
   default_print_array_index,
   default_pass_by_reference,
+  default_value_address_get,	/* Retrieve the real data value */
   LANG_MAGIC
 };
 
@@ -615,6 +618,7 @@ const struct language_defn minimal_langu
   c_language_arch_info,
   default_print_array_index,
   default_pass_by_reference,
+  default_value_address_get,	/* Retrieve the real data value */
   LANG_MAGIC
 };
 
diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/dwarf2block.c gdb-6.8cvs20080219/gdb/dwarf2block.c
--- gdb-6.8cvs20080219-fortranless/gdb/dwarf2block.c	1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.8cvs20080219/gdb/dwarf2block.c	2008-02-22 16:49:35.000000000 +0100
@@ -0,0 +1,153 @@
+/* DWARF DW_FORM_block* expression evaluation.
+
+   Copyright (C) 2007 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include "defs.h"
+#include "dwarf2block.h"
+#include "gdbcore.h"
+#include "dwarf2expr.h"
+#include "exceptions.h"
+
+/* This is the baton used when performing dwarf2 DW_BLOCK evaluation.  */
+struct dwarf_block_baton
+{
+  CORE_ADDR address;
+};
+
+/* Read memory at ADDR (length LEN) into BUF.  */
+
+static void
+dwarf_block_read_mem (void *baton, gdb_byte *buf, CORE_ADDR addr, size_t len)
+{
+  read_memory (addr, buf, len);
+}
+
+static CORE_ADDR
+dwarf_block_object_address (void *baton)
+{
+  struct dwarf_block_baton *debaton = baton;
+
+  /* The message is suppressed in DWARF_BLOCK_EXEC.  */
+  if (debaton->address == 0)
+    error (_("Cannot resolve DW_OP_push_object_address for a missing object"));
+
[...1840 lines suppressed...]
+# $1 = (( ( 3, 3, 3, 3, 3, 3) ( 3, 3, 3, 3, 3, 3) --- , 3) ) ( ( 3, 3, ...) ...) ...)
+gdb_test "p varw" "\\$\[0-9\]* = \\(\[()3, .\]*\\)"
+
+gdb_breakpoint [gdb_get_line_number "varw-almostfilled"]
+gdb_continue_to_breakpoint "varw-almostfilled"
+gdb_test "ptype varw" "type = real\\*4 \\(5,4,3\\)"
+gdb_test "p varw(3,1,1)=1" "\\$\[0-9\]* = 1"
+# $1 = (( ( 6, 5, 1, 5, 5, 5) ( 5, 5, 5, 5, 5, 5) --- , 5) ) ( ( 5, 5, ...) ...) ...)
+gdb_test "p varw" "\\$\[0-9\]* = \\( *\\( *\\( *6, *5, *1,\[()5, .\]*\\)"
+# "up" works with GCC but other Fortran compilers may copy the values into the
+# outer function only on the exit of the inner function.
+gdb_test "finish" ".*call bar \\(y, x\\)"
+gdb_test "p z(2,4,5)" "\\$\[0-9\]* = 3"
+gdb_test "p z(2,4,6)" "\\$\[0-9\]* = 6"
+gdb_test "p z(2,4,7)" "\\$\[0-9\]* = 5"
+gdb_test "p z(4,4,6)" "\\$\[0-9\]* = 1"
+
+gdb_breakpoint [gdb_get_line_number "varz-almostfilled"]
+gdb_continue_to_breakpoint "varz-almostfilled"
+# GCC uses the pointer type here, Intel Fortran Compiler 10.1.008 does not.
+gdb_test "ptype varz" "type = (PTR TO -> \\( )?real\\*4 \\(\\*\\)\\)?"
+# Intel Fortran Compiler 10.1.008 has a bug here - (2:11,7:7)
+# as it produces DW_AT_lower_bound == DW_AT_upper_bound == 7.
+gdb_test "ptype vart" "type = (PTR TO -> \\( )?real\\*4 \\(2:11,7:\\*\\)\\)?"
+gdb_test "p varz(3)" "\\$\[0-9\]* = 4"
+# maps to foo::vary(1,1)
+gdb_test "p vart(2,7)" "\\$\[0-9\]* = 8"
+# maps to foo::vary(2,2)
+gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9"
+# maps to foo::vary(1,3)
+gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10"
diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/testsuite/gdb.fortran/dynamic.f90 gdb-6.8cvs20080219/gdb/testsuite/gdb.fortran/dynamic.f90
--- gdb-6.8cvs20080219-fortranless/gdb/testsuite/gdb.fortran/dynamic.f90	1970-01-01 01:00:00.000000000 +0100
+++ gdb-6.8cvs20080219/gdb/testsuite/gdb.fortran/dynamic.f90	2008-02-22 16:59:42.000000000 +0100
@@ -0,0 +1,97 @@
+! Copyright 2007 Free Software Foundation, Inc.
+!
+! This program is free software; you can redistribute it and/or modify
+! it under the terms of the GNU General Public License as published by
+! the Free Software Foundation; either version 2 of the License, or
+! (at your option) any later version.
+!
+! This program is distributed in the hope that it will be useful,
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+! GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License
+! along with this program; if not, write to the Free Software
+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+!
+! Ihis file is the Fortran source file for dynamic.exp.
+! Original file written by Jakub Jelinek <jakub at redhat.com>.
+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil at redhat.com>.
+
+subroutine baz
+  real, target, allocatable :: varx (:, :, :)
+  real, pointer :: varv (:, :, :)
+  real, target :: varu (1, 2, 3)
+  logical :: l
+  allocate (varx (1:6, 5:15, 17:28))		! varx-init
+  l = allocated (varx)
+  varx(:, :, :) = 6				! varx-allocated
+  varx(1, 5, 17) = 7
+  varx(2, 6, 18) = 8
+  varx(6, 15, 28) = 9
+  varv => varx					! varx-filled
+  l = associated (varv)
+  varv(3, 7, 19) = 10				! varv-associated
+  varv => null ()				! varv-filled
+  l = associated (varv)
+  deallocate (varx)				! varv-deassociated
+  l = allocated (varx)
+  varu(:, :, :) = 10				! varx-deallocated
+  allocate (varv (1:6, 5:15, 17:28))
+  l = associated (varv)
+  varv(:, :, :) = 6
+  varv(1, 5, 17) = 7
+  varv(2, 6, 18) = 8
+  varv(6, 15, 28) = 9
+  deallocate (varv)
+  l = associated (varv)
+  varv => varu
+  varv(1, 1, 1) = 6
+  varv(1, 2, 3) = 7
+  l = associated (varv)
+end subroutine baz
+subroutine foo (vary, varw)
+  real :: vary (:, :)
+  real :: varw (:, :, :)
+  vary(:, :) = 4				! vary-passed
+  vary(1, 1) = 8
+  vary(2, 2) = 9
+  vary(1, 3) = 10
+  varw(:, :, :) = 5				! vary-filled
+  varw(1, 1, 1) = 6
+  varw(2, 2, 2) = 7				! varw-almostfilled
+end subroutine foo
+subroutine bar (varz, vart)
+  real :: varz (*)
+  real :: vart (2:11, 7:*)
+  varz(1:3) = 4
+  varz(2) = 5					! varz-almostfilled
+end subroutine bar
+program test
+  interface
+    subroutine foo (vary, varw)
+    real :: vary (:, :)
+    real :: varw (:, :, :)
+    end subroutine
+  end interface
+  interface
+    subroutine bar (varz, vart)
+    real :: varz (*)
+    real :: vart (2:11, 7:*)
+    end subroutine
+  end interface
+  real :: x (10, 10), y (5), z(8, 8, 8)
+  x(:,:) = 1
+  y(:) = 2
+  z(:,:,:) = 3
+  call baz
+  call foo (x, z(2:6, 4:7, 6:8))
+  call bar (y, x)
+  if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
+  if (x (1, 3) .ne. 10) call abort
+  if (z (2, 4, 6) .ne. 6 .or. z (3, 5, 7) .ne. 7 .or. z (2, 4, 7) .ne. 5) call abort
+  if (any (y .ne. (/4, 5, 4, 2, 2/))) call abort
+  call foo (transpose (x), z)
+  if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
+  if (x (3, 1) .ne. 10) call abort
+end
diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/typeprint.c gdb-6.8cvs20080219/gdb/typeprint.c
--- gdb-6.8cvs20080219-fortranless/gdb/typeprint.c	2008-02-14 23:04:00.000000000 +0100
+++ gdb-6.8cvs20080219/gdb/typeprint.c	2008-02-22 16:49:35.000000000 +0100
@@ -33,6 +33,7 @@
 #include "cp-abi.h"
 #include "typeprint.h"
 #include "gdb_string.h"
+#include "dwarf2block.h"
 #include <errno.h>
 
 /* For real-type printing in whatis_exp() */
@@ -130,6 +131,7 @@ whatis_exp (char *exp, int show)
     val = access_value_history (0);
 
   type = value_type (val);
+  object_address_set (VALUE_ADDRESS (val));
 
   if (objectprint)
     {
diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/valops.c gdb-6.8cvs20080219/gdb/valops.c
--- gdb-6.8cvs20080219-fortranless/gdb/valops.c	2008-02-22 08:19:37.000000000 +0100
+++ gdb-6.8cvs20080219/gdb/valops.c	2008-02-22 16:47:53.000000000 +0100
@@ -571,12 +571,21 @@ value_at_lazy (struct type *type, CORE_A
 int
 value_fetch_lazy (struct value *val)
 {
-  CORE_ADDR addr = VALUE_ADDRESS (val) + value_offset (val);
-  int length = TYPE_LENGTH (value_enclosing_type (val));
+  CORE_ADDR addr;
+  int length;
 
-  struct type *type = value_type (val);
-  if (length)
-    read_memory (addr, value_contents_all_raw (val), length);
+  addr = VALUE_ADDRESS (val);
+  if (LA_VALUE_ADDRESS_GET (value_type (val), &addr))
+    {
+      struct type *type = value_enclosing_type (val);
+      int length = TYPE_LENGTH (check_typedef (type));
+
+      if (length)
+        {
+	  addr += value_offset (val);
+	  read_memory (addr, value_contents_all_raw (val), length);
+	}
+    }
 
   set_value_lazy (val, 0);
   return 0;
@@ -880,12 +889,17 @@ struct value *
 value_coerce_array (struct value *arg1)
 {
   struct type *type = check_typedef (value_type (arg1));
+  CORE_ADDR address;
 
   if (VALUE_LVAL (arg1) != lval_memory)
     error (_("Attempt to take address of value not located in memory."));
 
+  address = VALUE_ADDRESS (arg1);
+  if (!LA_VALUE_ADDRESS_GET (type, &address))
+    error (_("Attempt to take address of non-valid value."));
+
   return value_from_pointer (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
-			     (VALUE_ADDRESS (arg1) + value_offset (arg1)));
+			     address + value_offset (arg1));
 }
 
 /* Given a value which is a function, return a value which is a pointer

gdb-6.8-watchpoint-inaccessible-memory.patch:

--- NEW FILE gdb-6.8-watchpoint-inaccessible-memory.patch ---
http://sourceware.org/ml/gdb-patches/2008-02/msg00472.html

2008-02-28  Daniel Jacobowitz  <dan at codesourcery.com>

	* breakpoint.c (fetch_watchpoint_value): New function.
	(update_watchpoint): Set and clear val_valid.  Use
	fetch_watchpoint_value.  Handle unreadable values on the
	value chain.  Correct check for user-requested array watchpoints.
	(breakpoint_init_inferior): Clear val_valid.
	(watchpoint_value_print): New function.
	(print_it_typical): Use it.  Do not free or clear old_val.  Print
	watchpoints even if old_val == NULL.
	(watchpoint_check): Use fetch_watchpoint_value.  Check for values
	becoming readable or unreadable.
	(watch_command_1): Use fetch_watchpoint_value.  Set val_valid.
	(do_enable_watchpoint): Likewise.
	* breakpoint.h (struct breakpoint): Update comment for val.  Add
	val_valid.
	* NEWS: Mention watchpoints on inaccessible memory.

2008-02-28  Daniel Jacobowitz  <dan at codesourcery.com>

	* gdb.base/watchpoint.c (global_ptr, func4): New.
	(main): Call func4.
	* gdb.base/watchpoint.exp: Call test_inaccessible_watchpoint.
	(test_inaccessible_watchpoint): New.

[ Backported for GDB-6.8pre.  ]

It fixes the regression since GDB-6.7.1rh on x86_64 -m64 -fPIE/-pie:
	-PASS: gdb.base/watchpoint.exp: run to marker1 in test_simple_watchpoint
	+FAIL: gdb.base/watchpoint.exp: run to marker1 in test_simple_watchpoint

diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.50.20080227-orig/gdb/NEWS gdb-6.7.50.20080227-dynwatch/gdb/NEWS
--- gdb-6.7.50.20080227-orig/gdb/NEWS	2008-03-03 08:42:11.000000000 +0100
+++ gdb-6.7.50.20080227-dynwatch/gdb/NEWS	2008-03-03 08:38:18.000000000 +0100
@@ -1,6 +1,9 @@
 		What has changed in GDB?
 	     (Organized release by release)
 
+* Watchpoints can now be set on unreadable memory locations, e.g. addresses
+which will be allocated using malloc later in program execution.
+
 *** Changes since GDB 6.7
 
 * New native configurations
diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.50.20080227-orig/gdb/breakpoint.c gdb-6.7.50.20080227-dynwatch/gdb/breakpoint.c
--- gdb-6.7.50.20080227-orig/gdb/breakpoint.c	2008-03-03 08:42:10.000000000 +0100
+++ gdb-6.7.50.20080227-dynwatch/gdb/breakpoint.c	2008-03-03 08:37:33.000000000 +0100
@@ -55,6 +55,7 @@
 #include "memattr.h"
 #include "ada-lang.h"
 #include "top.h"
+#include "wrapper.h"
 
 #include "gdb-events.h"
 #include "mi/mi-common.h"
@@ -826,7 +827,65 @@ is_hardware_watchpoint (struct breakpoin
 	  || bpt->type == bp_access_watchpoint);
 }
 
-/* Assuming that B is a hardware breakpoint:
+/* Find the current value of a watchpoint on EXP.  Return the value in
+   *VALP and *RESULTP and the chain of intermediate and final values
+   in *VAL_CHAIN.  RESULTP and VAL_CHAIN may be NULL if the caller does
+   not need them.
+
+   If an error occurs while evaluating the expression, *RESULTP will
+   be set to NULL.  *RESULTP may be a lazy value, if the result could
+   not be read from memory.  It is used to determine whether a value
+   is user-specified (we should watch the whole value) or intermediate
+   (we should watch only the bit used to locate the final value).
+
+   If the final value, or any intermediate value, could not be read
+   from memory, *VALP will be set to NULL.  *VAL_CHAIN will still be
+   set to any referenced values.  *VALP will never be a lazy value.
+   This is the value which we store in struct breakpoint.
+
+   If VAL_CHAIN is non-NULL, *VAL_CHAIN will be released from the
+   value chain.  The caller must free the values individually.  If
+   VAL_CHAIN is NULL, all generated values will be left on the value
+   chain.  */
+
+static void
+fetch_watchpoint_value (struct expression *exp, struct value **valp,
+			struct value **resultp, struct value **val_chain)
+{
+  struct value *mark, *new_mark, *result;
+
+  *valp = NULL;
+  if (resultp)
+    *resultp = NULL;
+  if (val_chain)
+    *val_chain = NULL;
+
+  /* Evaluate the expression.  */
+  mark = value_mark ();
+  result = NULL;
+  gdb_evaluate_expression (exp, &result);
+  new_mark = value_mark ();
+  if (mark == new_mark)
+    return;
+  if (resultp)
+    *resultp = result;
+
+  /* Make sure it's not lazy, so that after the target stops again we
+     have a non-lazy previous value to compare with.  */
+  if (result != NULL
+      && (!value_lazy (result) || gdb_value_fetch_lazy (result)))
+    *valp = result;
+
+  if (val_chain)
+    {
+      /* Return the chain of intermediate values.  We use this to
+	 decide which addresses to watch.  */
+      *val_chain = new_mark;
+      value_release_to_mark (mark);
+    }
+}
+
+/* Assuming that B is a hardware watchpoint:
    - Reparse watchpoint expression, is REPARSE is non-zero
    - Evaluate expression and store the result in B->val
    - Update the list of values that must be watched in B->loc.
@@ -837,7 +896,6 @@ static void
 update_watchpoint (struct breakpoint *b, int reparse)
 {
   int within_current_scope;
-  struct value *mark = value_mark ();
   struct frame_id saved_frame_id;
   struct bp_location *loc;
   bpstat bs;
@@ -889,9 +947,9 @@ update_watchpoint (struct breakpoint *b,
 	 to the user when the old value and the new value may actually
 	 be completely different objects.  */
       value_free (b->val);
-      b->val = NULL;      
+      b->val = NULL;
+      b->val_valid = 0;
     }
-  
 
   /* If we failed to parse the expression, for example because
      it refers to a global variable in a not-yet-loaded shared library,
@@ -900,43 +958,37 @@ update_watchpoint (struct breakpoint *b,
      is different from out-of-scope watchpoint.  */
   if (within_current_scope && b->exp)
     {
-      struct value *v, *next;
+      struct value *val_chain, *v, *result, *next;
+
+      fetch_watchpoint_value (b->exp, &v, &result, &val_chain);
 
-      /* Evaluate the expression and make sure it's not lazy, so that
-	 after target stops again, we have a non-lazy previous value
-	 to compare with. Also, making the value non-lazy will fetch
-	 intermediate values as needed, which we use to decide which
-	 addresses to watch.
-
-	 The value returned by evaluate_expression is stored in b->val.
-	 In addition, we look at all values which were created
-	 during evaluation, and set watchoints at addresses as needed.
-	 Those values are explicitly deleted here.  */
-      v = evaluate_expression (b->exp);
       /* Avoid setting b->val if it's already set.  The meaning of
 	 b->val is 'the last value' user saw, and we should update
 	 it only if we reported that last value to user.  As it
 	 happens, the code that reports it updates b->val directly.  */
-      if (b->val == NULL)
-	b->val = v;
-      value_contents (v);
-      value_release_to_mark (mark);
+      if (!b->val_valid)
+	{
+	  b->val = v;
+	  b->val_valid = 1;
+	}
 
       /* Look at each value on the value chain.  */
-      for (; v; v = value_next (v))
+      for (v = val_chain; v; v = value_next (v))
 	{
 	  /* If it's a memory location, and GDB actually needed
 	     its contents to evaluate the expression, then we
-	     must watch it.  */
+	     must watch it.  If the first value returned is
+	     still lazy, that means an error occurred reading it;
+	     watch it anyway in case it becomes readable.  */
 	  if (VALUE_LVAL (v) == lval_memory
-	      && ! value_lazy (v))
+	      && (v == val_chain || ! value_lazy (v)))
 	    {
 	      struct type *vtype = check_typedef (value_type (v));
 
 	      /* We only watch structs and arrays if user asked
 		 for it explicitly, never if they just happen to
 		 appear in the middle of some value chain.  */
-	      if (v == b->val
+	      if (v == result
 		  || (TYPE_CODE (vtype) != TYPE_CODE_STRUCT
 		      && TYPE_CODE (vtype) != TYPE_CODE_ARRAY))
 		{
@@ -1682,6 +1734,7 @@ breakpoint_init_inferior (enum inf_conte
 	    if (b->val)
 	      value_free (b->val);
 	    b->val = NULL;
+	    b->val_valid = 0;
 	  }
 	break;
       default:
@@ -2104,6 +2157,17 @@ top:
   do_cleanups (old_chain);
 }
 
+/* Print out the (old or new) value associated with a watchpoint.  */
+
+static void
+watchpoint_value_print (struct value *val, struct ui_file *stream)
+{
+  if (val == NULL)
+    fprintf_unfiltered (stream, _("<unreadable>"));
+  else
+    value_print (val, stream, 0, Val_pretty_default);
+}
+
 /* This is the normal print function for a bpstat.  In the future,
    much of this logic could (should?) be moved to bpstat_stop_status,
    by having it set different print_it values.
@@ -2222,26 +2286,21 @@ print_it_typical (bpstat bs)
 
     case bp_watchpoint:
     case bp_hardware_watchpoint:
-      if (bs->old_val != NULL)
-	{
-	  annotate_watchpoint (b->number);
-	  if (ui_out_is_mi_like_p (uiout))
-	    ui_out_field_string
-	      (uiout, "reason",
-	       async_reason_lookup (EXEC_ASYNC_WATCHPOINT_TRIGGER));
-	  mention (b);
-	  ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
-	  ui_out_text (uiout, "\nOld value = ");
-	  value_print (bs->old_val, stb->stream, 0, Val_pretty_default);
-	  ui_out_field_stream (uiout, "old", stb);
-	  ui_out_text (uiout, "\nNew value = ");
-	  value_print (b->val, stb->stream, 0, Val_pretty_default);
-	  ui_out_field_stream (uiout, "new", stb);
-	  do_cleanups (ui_out_chain);
-	  ui_out_text (uiout, "\n");
-	  value_free (bs->old_val);
-	  bs->old_val = NULL;
-	}
+      annotate_watchpoint (b->number);
+      if (ui_out_is_mi_like_p (uiout))
+	ui_out_field_string
+	  (uiout, "reason",
+	   async_reason_lookup (EXEC_ASYNC_WATCHPOINT_TRIGGER));
+      mention (b);
+      ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
+      ui_out_text (uiout, "\nOld value = ");
+      watchpoint_value_print (bs->old_val, stb->stream);
+      ui_out_field_stream (uiout, "old", stb);
+      ui_out_text (uiout, "\nNew value = ");
+      watchpoint_value_print (b->val, stb->stream);
+      ui_out_field_stream (uiout, "new", stb);
+      do_cleanups (ui_out_chain);
+      ui_out_text (uiout, "\n");
       /* More than one watchpoint may have been triggered.  */
       return PRINT_UNKNOWN;
       break;
@@ -2254,7 +2313,7 @@ print_it_typical (bpstat bs)
       mention (b);
       ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
       ui_out_text (uiout, "\nValue = ");
-      value_print (b->val, stb->stream, 0, Val_pretty_default);
+      watchpoint_value_print (b->val, stb->stream);
       ui_out_field_stream (uiout, "value", stb);
       do_cleanups (ui_out_chain);
       ui_out_text (uiout, "\n");
@@ -2262,7 +2321,7 @@ print_it_typical (bpstat bs)
       break;
 
     case bp_access_watchpoint:
-      if (bs->old_val != NULL)     
+      if (bs->old_val != NULL)
 	{
 	  annotate_watchpoint (b->number);
 	  if (ui_out_is_mi_like_p (uiout))
@@ -2272,10 +2331,8 @@ print_it_typical (bpstat bs)
 	  mention (b);
 	  ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
 	  ui_out_text (uiout, "\nOld value = ");
-	  value_print (bs->old_val, stb->stream, 0, Val_pretty_default);
+	  watchpoint_value_print (bs->old_val, stb->stream);
 	  ui_out_field_stream (uiout, "old", stb);
-	  value_free (bs->old_val);
-	  bs->old_val = NULL;
 	  ui_out_text (uiout, "\nNew value = ");
 	}
       else 
@@ -2288,7 +2345,7 @@ print_it_typical (bpstat bs)
 	  ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value");
 	  ui_out_text (uiout, "\nValue = ");
 	}
-      value_print (b->val, stb->stream, 0,Val_pretty_default);
+      watchpoint_value_print (b->val, stb->stream);
       ui_out_field_stream (uiout, "new", stb);
       do_cleanups (ui_out_chain);
       ui_out_text (uiout, "\n");
@@ -2575,13 +2632,20 @@ watchpoint_check (void *p)
          we might be in the middle of evaluating a function call.  */
 
       struct value *mark = value_mark ();
-      struct value *new_val = evaluate_expression (b->exp);
-      if (!value_equal (b->val, new_val))
+      struct value *new_val;
+
+      fetch_watchpoint_value (b->exp, &new_val, NULL, NULL);
+      if ((b->val != NULL) != (new_val != NULL)
+	  || (b->val != NULL && !value_equal (b->val, new_val)))
 	{
-	  release_value (new_val);
-	  value_free_to_mark (mark);
+	  if (new_val != NULL)
+	    {
+	      release_value (new_val);
+	      value_free_to_mark (mark);
+	    }
 	  bs->old_val = b->val;
 	  b->val = new_val;
+	  b->val_valid = 1;
 	  /* We will stop here */
 	  return WP_VALUE_CHANGED;
 	}
@@ -5780,10 +5844,9 @@ watch_command_1 (char *arg, int accessfl
   exp_end = arg;
   exp_valid_block = innermost_block;
   mark = value_mark ();
-  val = evaluate_expression (exp);
-  release_value (val);
-  if (value_lazy (val))
-    value_fetch_lazy (val);
+  fetch_watchpoint_value (exp, &val, NULL, NULL);
+  if (val != NULL)
+    release_value (val);
 
   tok = arg;
   while (*tok == ' ' || *tok == '\t')
@@ -5872,6 +5935,7 @@ watch_command_1 (char *arg, int accessfl
   b->exp_valid_block = exp_valid_block;
   b->exp_string = savestring (exp_start, exp_end - exp_start);
   b->val = val;
+  b->val_valid = 1;
   b->loc->cond = cond;
   if (cond_start)
     b->cond_string = savestring (cond_start, cond_end - cond_start);
@@ -7755,11 +7819,11 @@ is valid is not currently in scope.\n"),
       if (bpt->val)
 	value_free (bpt->val);
       mark = value_mark ();
-      bpt->val = evaluate_expression (bpt->exp);
-      release_value (bpt->val);
-      if (value_lazy (bpt->val))
-	value_fetch_lazy (bpt->val);
-      
+      fetch_watchpoint_value (bpt->exp, &bpt->val, NULL, NULL);
+      if (bpt->val)
+	release_value (bpt->val);
+      bpt->val_valid = 1;
+
       if (bpt->type == bp_hardware_watchpoint ||
 	  bpt->type == bp_read_watchpoint ||
 	  bpt->type == bp_access_watchpoint)
diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.50.20080227-orig/gdb/breakpoint.h gdb-6.7.50.20080227-dynwatch/gdb/breakpoint.h
--- gdb-6.7.50.20080227-orig/gdb/breakpoint.h	2008-03-03 08:42:10.000000000 +0100
+++ gdb-6.7.50.20080227-dynwatch/gdb/breakpoint.h	2008-03-03 08:34:20.000000000 +0100
@@ -392,8 +392,13 @@ struct breakpoint
     /* The largest block within which it is valid, or NULL if it is
        valid anywhere (e.g. consists just of global symbols).  */
     struct block *exp_valid_block;
-    /* Value of the watchpoint the last time we checked it.  */
+    /* Value of the watchpoint the last time we checked it, or NULL
+       when we do not know the value yet or the value was not
+       readable.  VAL is never lazy.  */
     struct value *val;
+    /* Nonzero if VAL is valid.  If VAL_VALID is set but VAL is NULL,
+       then an error occurred reading the value.  */
+    int val_valid;
 
     /* Holds the address of the related watchpoint_scope breakpoint
        when using watchpoints on local variables (might the concept
diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.50.20080227-orig/gdb/testsuite/gdb.base/watchpoint.c gdb-6.7.50.20080227-dynwatch/gdb/testsuite/gdb.base/watchpoint.c
--- gdb-6.7.50.20080227-orig/gdb/testsuite/gdb.base/watchpoint.c	2003-03-17 20:51:58.000000000 +0100
+++ gdb-6.7.50.20080227-dynwatch/gdb/testsuite/gdb.base/watchpoint.c	2008-03-03 08:34:20.000000000 +0100
@@ -39,6 +39,8 @@ struct foo struct1, struct2, *ptr1, *ptr
 
 int doread = 0;
 
+char *global_ptr;
+
 void marker1 ()
 {
 }
@@ -110,6 +112,14 @@ func1 ()
   return 73;
 }
 
+void
+func4 ()
+{
+  buf[0] = 3;
+  global_ptr = buf;
+  buf[0] = 7;
+}
+
 int main ()
 {
 #ifdef usestubs
@@ -185,5 +195,7 @@ int main ()
 
   func3 ();
 
+  func4 ();
+
   return 0;
 }
diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.50.20080227-orig/gdb/testsuite/gdb.base/watchpoint.exp gdb-6.7.50.20080227-dynwatch/gdb/testsuite/gdb.base/watchpoint.exp
--- gdb-6.7.50.20080227-orig/gdb/testsuite/gdb.base/watchpoint.exp	2008-01-01 23:53:19.000000000 +0100
+++ gdb-6.7.50.20080227-dynwatch/gdb/testsuite/gdb.base/watchpoint.exp	2008-03-03 08:34:20.000000000 +0100
@@ -645,6 +645,30 @@ proc test_watchpoint_and_breakpoint {} {
     }
 }
     
+proc test_inaccessible_watchpoint {} {
+    global gdb_prompt
+
+    # This is a test for watchpoints on currently inaccessible (but later
+    # valid) memory.
+
+    if [runto func4] then {
+	gdb_test "watch *global_ptr" ".*atchpoint \[0-9\]+: \\*global_ptr"
+	gdb_test "next" ".*global_ptr = buf.*"
+	gdb_test_multiple "next" "next over ptr init" {
+	    -re ".*atchpoint \[0-9\]+: \\*global_ptr\r\n\r\nOld value = .*\r\nNew value = 3 .*\r\n.*$gdb_prompt $" {
+		# We can not test for <unknown> here because NULL may be readable.
+		# This test does rely on *NULL != 3.
+		pass "next over ptr init"
+	    }
+	}
+	gdb_test_multiple "next" "next over buffer set" {
+	    -re ".*atchpoint \[0-9\]+: \\*global_ptr\r\n\r\nOld value = 3 .*\r\nNew value = 7 .*\r\n.*$gdb_prompt $" {
+		pass "next over buffer set"
+	    }
+	}
+    }
+}
+    
 # Start with a fresh gdb.
 
 gdb_exit
@@ -655,6 +679,7 @@ set prev_timeout $timeout
 set timeout 600	
 verbose "Timeout now 600 sec.\n"
 
+gdb_test "set debug solib 1"
 if [initialize] then {
 
     test_simple_watchpoint
@@ -797,6 +822,8 @@ if [initialize] then {
       }
     }
 
+    test_inaccessible_watchpoint
+
     # See above.
     if [istarget "mips-idt-*"] then {
 	gdb_exit


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/.cvsignore,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- .cvsignore	1 Nov 2007 22:28:37 -0000	1.24
+++ .cvsignore	3 Mar 2008 16:13:47 -0000	1.25
@@ -1 +1 @@
-gdb-6.7.1.tar.bz2
+gdb-6.7.50.20080227.tar.bz2

gdb-6.3-catch-debug-registers-error-20060527.patch:

Index: gdb-6.3-catch-debug-registers-error-20060527.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.3-catch-debug-registers-error-20060527.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- gdb-6.3-catch-debug-registers-error-20060527.patch	11 Jul 2006 08:25:57 -0000	1.2
+++ gdb-6.3-catch-debug-registers-error-20060527.patch	3 Mar 2008 16:13:47 -0000	1.3
@@ -6,52 +6,153 @@
 	(i386_linux_set_debug_regs_for_thread): ... this, and
 	add new function to catch exceptions in the old one.
 
-Index: gdb-6.5/gdb/i386-linux-nat.c
+2008-02-24  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
+
+This patch was originally made to workaround a deficiency of ia32el (==ia32
+emulator on ia64) which EIOs on ptrace(2) of the debug registers.
+
+Currently I can no longer run gdb.i386 on RHEL-5.1.ia64 as it fails on
+	$ rpm -qv kernel
+	kernel-2.6.18-53.el5.ia64
+	$ file /emul/ia32-linux/usr/bin/gdb ./print-threads
+	/emul/ia32-linux/usr/bin/gdb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
+	./print-threads:              ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
+	$ /emul/ia32-linux/usr/bin/gdb ./print-threads
+	(gdb) r
+	Starting program: /root/jkratoch/redhat/print-threads 
+	Warning:
+	Cannot insert breakpoint -2.
+	Error accessing memory address 0x555766fb: Input/output error.
+	(gdb) maint info breakpoints 
+	Num Type           Disp Enb Address    What
+	-1  longjmp resume keep n   0x00000000 
+	-2  shlib events   keep y   0x555766fb 
+
+ia32-on-ia64 run problem info:
+
+the inconsistency is in function linux_nat_wait - there is a variable called
+block_mask, which is assumed to represent the current signal mask. in the
+following execution path this assumption does not hold:
+
+1) block-mask is filled with SIGCHLD and the signal is masked in
+   lin_lwp_attach_lwp, which is called at the beginning of the procedure
+   that handles a new thread in the debuggee.
+2) further down this procedure gdb tries to set the debug regs of the debuggee.
+   when trying to set debug regs - gdb fails and calls throw_exception. this
+   function finishes with siglongjmp, which clears the sigmask (seq. 1).
+3) further down, linux_nat_wait is called to wait on the new child. in
+   linux_nat_wait there is a sequence :
+
+      if ( ! (block_mask & SIGCHLD) )
+        mask- SIGCHLD
+        while () {
+          wait-no-hang( )
+          if no child found then
+            sigsuspend (SIGCHLD)
+
+4) the signal that notifies the debugger about the child is received after the
+   wait and before the sigsuspend. originally, this was not supposed to happen
+   because SIGCHLD is supposed to be blocked, but because what happens in step
+   2, the signal mask is cleared and the signal is received at this point,
+   which results with a hang
+
+sequence 1:
+
+catch_errors (symbol_add_stubs)
+  symbol_file_add_with_addrs_or_offsets
+    deprecated_target_new_objfile_hook
+      tui_new_objfile_hook
+        attach_thread
+          observer_notify_linux_new_thread
+            generic_observer_notify
+              observer_linux_new_thread_notification_stub
+                i386_linux_new_thread
+                  i386_linux_set_debug_regs_for_thread
+                    i386_linux_dr_set_addr
+                      i386_linux_dr_set
+                        perror_with_name
+                          .
+                          .
+                          .
+                          throw_exception
+                            siglongjmp
+
+RHEL Bug 175270
+
+Index: gdb-6.8cvs20080219/gdb/i386-linux-nat.c
 ===================================================================
---- gdb-6.5.orig/gdb/i386-linux-nat.c	2006-07-11 05:21:58.000000000 -0300
-+++ gdb-6.5/gdb/i386-linux-nat.c	2006-07-11 05:24:29.000000000 -0300
-@@ -27,6 +27,7 @@
- #include "observer.h"
+--- gdb-6.8cvs20080219.orig/gdb/i386-linux-nat.c	2008-01-10 19:19:02.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/i386-linux-nat.c	2008-02-24 09:23:09.000000000 +0100
+@@ -24,6 +24,7 @@
+ #include "regcache.h"
  #include "target.h"
  #include "linux-nat.h"
 +#include "exceptions.h"
  
  #include "gdb_assert.h"
  #include "gdb_string.h"
-@@ -695,14 +696,33 @@ struct i386_debug_register_state
-   unsigned long control;
- };
+@@ -611,20 +612,40 @@ i386_linux_dr_get (ptid_t ptid, int regn
+   return value;
+ }
  
 -static void
--i386_linux_set_debug_regs_for_thread (ptid_t ptid,
--				      struct i386_debug_register_state *dbs)
-+struct i386_debug_register_for_thread
-+{
-+  ptid_t ptid;
-+  struct i386_debug_register_state *dbs;
-+};
-+
+-i386_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
+-{
+-  int tid;
++struct i386_linux_dr_set
++  {
++    int tid;
++    int regnum;
++    unsigned long value;
++  };
+ 
+-  tid = TIDGET (ptid);
+-  if (tid == 0)
+-    tid = PIDGET (ptid);
 +static int
-+i386_linux_set_dr_for_thread (void *drp)
- {
-+  ptid_t ptid = ((struct i386_debug_register_for_thread *)drp)->ptid;
-+  struct i386_debug_register_state *dbs
-+    = ((struct i386_debug_register_for_thread *)drp)->dbs;
-   int i;
-   for (i = 0; i < (DR_LASTADDR - DR_FIRSTADDR) + 1; ++i)
-     i386_linux_dr_set_addr (ptid, i, dbs->addr[i]);
-   i386_linux_dr_set_control (ptid, dbs->control);
++i386_linux_dr_set_core (void *data_pointer)
++{
++  struct i386_linux_dr_set *data = data_pointer;
+ 
+   errno = 0;
+-  ptrace (PTRACE_POKEUSER, tid,
+-	  offsetof (struct user, u_debugreg[regnum]), value);
++  ptrace (PTRACE_POKEUSER, data->tid,
++	  offsetof (struct user, u_debugreg[data->regnum]), data->value);
+   if (errno != 0)
+     perror_with_name (_("Couldn't write debug register"));
 +  return 1;
 +}
 +
 +static int
-+i386_linux_set_debug_regs_for_thread (ptid_t ptid,
-+				      struct i386_debug_register_state *dbs)
++i386_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
 +{
-+  struct i386_debug_register_for_thread dr;
-+  dr.ptid = ptid;
-+  dr.dbs = dbs;
-+  return catch_errors (i386_linux_set_dr_for_thread, &dr, "", RETURN_MASK_ALL);
++  struct i386_linux_dr_set data;
++  int tid;
++
++  data.tid = TIDGET (ptid);
++  if (data.tid == 0)
++    data.tid = PIDGET (ptid);
++
++  data.regnum = regnum;
++  data.value = value;
++
++  return catch_errors (i386_linux_dr_set_core, &data, "", RETURN_MASK_ALL);
  }
  
- /* Iterator function to support syncing debug registers across all threads.  */
+ void
+Index: gdb-6.8cvs20080219/gdb/Makefile.in
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/Makefile.in	2008-02-24 09:13:35.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/Makefile.in	2008-02-24 09:14:26.000000000 +0100
+@@ -2252,7 +2252,7 @@ i386gnu-tdep.o: i386gnu-tdep.c $(defs_h)
+ i386-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
+ 	$(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \
+ 	$(gregset_h) $(i387_tdep_h) $(i386_tdep_h) $(i386_linux_tdep_h) \
+-	$(gdb_proc_service_h) $(target_h)
++	$(gdb_proc_service_h) $(target_h) $(exceptions_h)
+ i386-linux-tdep.o: i386-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \
+ 	$(value_h) $(regcache_h) $(inferior_h) $(osabi_h) $(reggroups_h) \
+ 	$(dwarf2_frame_h) $(gdb_string_h) $(i386_tdep_h) \

gdb-6.3-dwattype0-20050201.patch:

Index: gdb-6.3-dwattype0-20050201.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.3-dwattype0-20050201.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- gdb-6.3-dwattype0-20050201.patch	22 Feb 2005 17:34:05 -0000	1.2
+++ gdb-6.3-dwattype0-20050201.patch	3 Mar 2008 16:13:47 -0000	1.3
@@ -3,11 +3,17 @@
         * dwarf2read.c (die_type): Tolerate a type reference to location
         <0> and treat as unknown type.
 
---- gdb-6.3/gdb/dwarf2read.c.fix	Tue Feb  1 16:48:49 2005
-+++ gdb-6.3/gdb/dwarf2read.c	Tue Feb  1 16:50:12 2005
-@@ -7120,6 +7120,10 @@ die_type (struct die_info *die, struct d
+2008-02-24  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
+
+Index: gdb-6.8cvs20080219/gdb/dwarf2read.c
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/dwarf2read.c	2008-02-22 08:10:39.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/dwarf2read.c	2008-02-22 08:17:56.000000000 +0100
+@@ -7634,6 +7634,10 @@ die_type (struct die_info *die, struct d
        /* A missing DW_AT_type represents a void type.  */
-       return dwarf2_fundamental_type (cu->objfile, FT_VOID, cu);
+       return builtin_type (current_gdbarch)->builtin_void;
      }
 +  else if (DW_ADDR (type_attr) == 0)
 +    /* If we have an invalid reference to 0, ignore it and treat

gdb-6.3-ia64-info-frame-fix-20050725.patch:

Index: gdb-6.3-ia64-info-frame-fix-20050725.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.3-ia64-info-frame-fix-20050725.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- gdb-6.3-ia64-info-frame-fix-20050725.patch	25 Jul 2005 22:43:34 -0000	1.1
+++ gdb-6.3-ia64-info-frame-fix-20050725.patch	3 Mar 2008 16:13:47 -0000	1.2
@@ -9,6 +9,10 @@
 	* gdb.arch/ia64-sigtramp.exp: New test.
 	* gdb.arch/ia64-sigtramp.c: Ditto.
 
+2008-02-24  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.  (Only the testcase has remained.)
+
 --- gdb-6.3/gdb/testsuite/gdb.arch/ia64-sigtramp.c.fix	2005-07-25 16:42:46.000000000 -0400
 +++ gdb-6.3/gdb/testsuite/gdb.arch/ia64-sigtramp.c	2005-07-25 16:42:08.000000000 -0400
 @@ -0,0 +1,23 @@
@@ -104,17 +108,3 @@
 +gdb_test "f 1" ".*signal handler called.*" "frame 1"
 +gdb_test "info frame" "Stack level 1.*p63 at .*" "info sigtramp frame"
 + 
---- gdb-6.3/gdb/libunwind-frame.c.fix	2005-07-25 16:41:30.000000000 -0400
-+++ gdb-6.3/gdb/libunwind-frame.c	2005-07-25 16:46:23.000000000 -0400
-@@ -303,8 +303,9 @@ libunwind_frame_prev_register (struct fr
-      modification to support unwinding through a sigaltstack.  */
-   if (uw_regnum == INT_MAX)
-     {
--      store_unsigned_integer (valuep, sizeof (CORE_ADDR), 
--			      (CORE_ADDR)&cache->cursor);
-+      if (valuep)
-+        store_unsigned_integer (valuep, sizeof (CORE_ADDR), 
-+			        (CORE_ADDR)&cache->cursor);
-       return;
-     }
- 

gdb-6.3-ia64-sigtramp-fp-20050926.patch:

Index: gdb-6.3-ia64-sigtramp-fp-20050926.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.3-ia64-sigtramp-fp-20050926.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- gdb-6.3-ia64-sigtramp-fp-20050926.patch	1 Nov 2007 20:24:20 -0000	1.3
+++ gdb-6.3-ia64-sigtramp-fp-20050926.patch	3 Mar 2008 16:13:47 -0000	1.4
@@ -16,10 +16,14 @@
 
 	Port to GDB-6.7.
 
-Index: gdb-6.7/gdb/libunwind-frame.c
+2008-02-24  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
+
+Index: gdb-6.8cvs20080219/gdb/libunwind-frame.c
 ===================================================================
---- gdb-6.7.orig/gdb/libunwind-frame.c	2007-10-15 00:08:30.000000000 +0200
-+++ gdb-6.7/gdb/libunwind-frame.c	2007-10-15 00:13:29.000000000 +0200
+--- gdb-6.8cvs20080219.orig/gdb/libunwind-frame.c	2008-01-02 00:04:03.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/libunwind-frame.c	2008-02-24 20:25:56.000000000 +0100
 @@ -61,6 +61,7 @@ static unw_word_t (*unw_find_dyn_list_p)
  struct libunwind_frame_cache
  {
@@ -28,19 +32,19 @@
    CORE_ADDR func_addr;
    unw_cursor_t cursor;
    unw_addr_space_t as;
-@@ -134,7 +135,7 @@ libunwind_frame_cache (struct frame_info
+@@ -133,6 +134,7 @@ libunwind_frame_cache (struct frame_info
    unw_accessors_t *acc;
    unw_addr_space_t as;
-   unw_cursor_t *cursor_addr;
--  unw_word_t fp;
+   unw_word_t fp;
 +  unw_word_t fp, sp;
    unw_regnum_t uw_sp_regnum;
    struct libunwind_frame_cache *cache;
    struct libunwind_descr *descr;
-@@ -183,14 +184,29 @@ libunwind_frame_cache (struct frame_info
-   else /* make copy */
-     cache->cursor = *cursor_addr;
+@@ -171,14 +173,30 @@ libunwind_frame_cache (struct frame_info
+ 				 : __LITTLE_ENDIAN);
  
+   unw_init_remote_p (&cache->cursor, as, next_frame);
++
 +  /* For the base address, we have a small problem.  The majority
 +     of the time, we can get the stack pointer of the previous
 +     frame to use as a frame pointer.  In the case where we have
@@ -50,7 +54,7 @@
 +     sigaltstack as we want.  To handle this, we record the stack
 +     address so the caller may calculate a more correct base address
 +     to use.  */
-+  uw_sp_regnum = descr->gdb2uw (gdbarch_sp_regnum (current_gdbarch));
++  uw_sp_regnum = descr->gdb2uw (gdbarch_sp_regnum (gdbarch));
 +  ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &sp);
 +  if (ret < 0)
 +    {
@@ -65,11 +69,11 @@
      }
  
 -  /* To get base address, get sp from previous frame.  */
--  uw_sp_regnum = descr->gdb2uw (gdbarch_sp_regnum (current_gdbarch));
+-  uw_sp_regnum = descr->gdb2uw (gdbarch_sp_regnum (gdbarch));
    ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &fp);
    if (ret < 0)
      {
-@@ -198,6 +214,7 @@ libunwind_frame_cache (struct frame_info
+@@ -186,6 +204,7 @@ libunwind_frame_cache (struct frame_info
        error (_("Can't get libunwind sp register."));
      }
  
@@ -77,7 +81,7 @@
    cache->base = (CORE_ADDR)fp;
    cache->as = as;
  
-@@ -402,6 +419,31 @@ libunwind_search_unwind_table (void *as,
+@@ -381,6 +400,31 @@ libunwind_search_unwind_table (void *as,
  				    di, pi, need_unwind_info, args);
  }
  
@@ -109,7 +113,7 @@
  /* Verify if we are in a sigtramp frame and we can use libunwind to unwind.  */
  const struct frame_unwind *
  libunwind_sigtramp_frame_sniffer (struct frame_info *next_frame)
-@@ -439,7 +481,7 @@ libunwind_sigtramp_frame_sniffer (struct
+@@ -419,7 +463,7 @@ libunwind_sigtramp_frame_sniffer (struct
    ret = unw_is_signal_frame_p (&cursor);
    unw_destroy_addr_space_p (as);
    if (ret > 0)
@@ -118,11 +122,11 @@
  
    return NULL;
  }
-Index: gdb-6.7/gdb/libunwind-frame.h
+Index: gdb-6.8cvs20080219/gdb/libunwind-frame.h
 ===================================================================
---- gdb-6.7.orig/gdb/libunwind-frame.h	2007-10-15 00:05:20.000000000 +0200
-+++ gdb-6.7/gdb/libunwind-frame.h	2007-10-15 00:08:36.000000000 +0200
-@@ -48,6 +48,9 @@ void libunwind_frame_set_descr (struct g
+--- gdb-6.8cvs20080219.orig/gdb/libunwind-frame.h	2008-01-02 00:04:03.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/libunwind-frame.h	2008-02-24 20:23:47.000000000 +0100
+@@ -47,6 +47,9 @@ void libunwind_frame_set_descr (struct g
  
  void libunwind_frame_this_id (struct frame_info *next_frame, void **this_cache,
  			      struct frame_id *this_id);
@@ -132,11 +136,11 @@
  void libunwind_frame_prev_register (struct frame_info *next_frame, void **this_cache,
  				    int regnum, int *optimizedp,
  				    enum lval_type *lvalp, CORE_ADDR *addrp,
-Index: gdb-6.7/gdb/ia64-tdep.c
+Index: gdb-6.8cvs20080219/gdb/ia64-tdep.c
 ===================================================================
---- gdb-6.7.orig/gdb/ia64-tdep.c	2007-10-15 00:05:20.000000000 +0200
-+++ gdb-6.7/gdb/ia64-tdep.c	2007-10-15 00:08:36.000000000 +0200
-@@ -2968,7 +2968,7 @@ ia64_libunwind_sigtramp_frame_this_id (s
+--- gdb-6.8cvs20080219.orig/gdb/ia64-tdep.c	2008-02-24 20:23:40.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/ia64-tdep.c	2008-02-24 20:23:47.000000000 +0100
+@@ -2942,7 +2942,7 @@ ia64_libunwind_sigtramp_frame_this_id (s
    struct frame_id id;
    CORE_ADDR prev_ip;
  
@@ -145,7 +149,7 @@
    if (frame_id_eq (id, null_frame_id))
      {
        (*this_id) = null_frame_id;
-@@ -2980,8 +2980,14 @@ ia64_libunwind_sigtramp_frame_this_id (s
+@@ -2954,8 +2954,14 @@ ia64_libunwind_sigtramp_frame_this_id (s
    frame_unwind_register (next_frame, IA64_BSP_REGNUM, buf);
    bsp = extract_unsigned_integer (buf, 8);
  

gdb-6.3-nonthreaded-wp-20050117.patch:

Index: gdb-6.3-nonthreaded-wp-20050117.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.3-nonthreaded-wp-20050117.patch,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- gdb-6.3-nonthreaded-wp-20050117.patch	1 Nov 2007 20:24:20 -0000	1.6
+++ gdb-6.3-nonthreaded-wp-20050117.patch	3 Mar 2008 16:13:47 -0000	1.7
@@ -13,10 +13,14 @@
 
 	Port to GDB-6.7.
 
-Index: gdb-6.7/gdb/doc/observer.texi
+2008-02-24  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
+
+Index: gdb-6.8cvs20080219/gdb/doc/observer.texi
 ===================================================================
---- gdb-6.7.orig/gdb/doc/observer.texi	2007-10-13 05:09:50.000000000 +0200
-+++ gdb-6.7/gdb/doc/observer.texi	2007-10-14 23:24:52.000000000 +0200
+--- gdb-6.8cvs20080219.orig/gdb/doc/observer.texi	2007-10-09 13:06:07.000000000 +0200
++++ gdb-6.8cvs20080219/gdb/doc/observer.texi	2008-02-21 17:45:46.000000000 +0100
 @@ -119,6 +119,10 @@ when @value{GDBN} calls this observer, t
  haven't been loaded yet.
  @end deftypefun
@@ -28,11 +32,19 @@
  @deftypefun void solib_unloaded (struct so_list *@var{solib})
  The shared library specified by @var{solib} has been unloaded.
  @end deftypefun
-Index: gdb-6.7/gdb/linux-nat.c
+Index: gdb-6.8cvs20080219/gdb/linux-nat.c
 ===================================================================
---- gdb-6.7.orig/gdb/linux-nat.c	2007-10-13 05:09:50.000000000 +0200
-+++ gdb-6.7/gdb/linux-nat.c	2007-10-14 23:24:52.000000000 +0200
-@@ -742,11 +742,26 @@ iterate_over_lwps (int (*callback) (stru
+--- gdb-6.8cvs20080219.orig/gdb/linux-nat.c	2008-02-21 17:45:45.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/linux-nat.c	2008-02-22 08:12:57.000000000 +0100
+@@ -37,6 +37,7 @@
+ #include "regset.h"
+ #include "inf-ptrace.h"
+ #include "auxv.h"
++#include "observer.h"
+ #include <sys/param.h>		/* for MAXPATHLEN */
+ #include <sys/procfs.h>		/* for elf_gregset etc. */
+ #include "elf-bfd.h"		/* for elfcore_write_* */
+@@ -751,11 +752,26 @@ iterate_over_lwps (int (*callback) (stru
  {
    struct lwp_info *lp, *lpnext;
  
@@ -62,8 +74,8 @@
      }
  
    return NULL;
-@@ -3272,6 +3284,18 @@ linux_nat_add_target (struct target_ops 
-   thread_db_init (t);
+@@ -3319,6 +3335,18 @@ linux_nat_get_siginfo (ptid_t ptid)
+   return &lp->siginfo;
  }
  
 +/* Observer function for a mourn inferior event.  This is needed
@@ -81,7 +93,7 @@
  void
  _initialize_linux_nat (void)
  {
-@@ -3286,6 +3310,8 @@ Specify any of the following keywords fo
+@@ -3333,6 +3361,8 @@ Specify any of the following keywords fo
    status   -- list a different bunch of random process info.\n\
    all      -- list all available /proc info."));
  
@@ -90,10 +102,10 @@
    /* Save the original signal mask.  */
    sigprocmask (SIG_SETMASK, NULL, &normal_mask);
  
-Index: gdb-6.7/gdb/target.c
+Index: gdb-6.8cvs20080219/gdb/target.c
 ===================================================================
---- gdb-6.7.orig/gdb/target.c	2007-08-23 20:08:45.000000000 +0200
-+++ gdb-6.7/gdb/target.c	2007-10-14 23:25:13.000000000 +0200
+--- gdb-6.8cvs20080219.orig/gdb/target.c	2008-02-14 23:04:00.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/target.c	2008-02-22 08:10:37.000000000 +0100
 @@ -39,6 +39,7 @@
  #include "gdbcore.h"
  #include "exceptions.h"
@@ -116,11 +128,11 @@
  static int
  nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write,
  	  struct target_ops *t)
-Index: gdb-6.7/gdb/target.h
+Index: gdb-6.8cvs20080219/gdb/target.h
 ===================================================================
---- gdb-6.7.orig/gdb/target.h	2007-08-23 20:08:46.000000000 +0200
-+++ gdb-6.7/gdb/target.h	2007-10-14 23:24:52.000000000 +0200
-@@ -864,8 +864,7 @@ int target_follow_fork (int follow_child
+--- gdb-6.8cvs20080219.orig/gdb/target.h	2008-01-02 00:04:05.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/target.h	2008-02-22 08:10:37.000000000 +0100
+@@ -861,8 +861,7 @@ int target_follow_fork (int follow_child
  
  /* The inferior process has died.  Do what is right.  */
  
@@ -130,9 +142,10 @@
  
  /* Does target have enough data to do a run or attach command? */
  
-diff -u -u -X /home/jkratoch/.diffi.list -rup gdb-6.6-orig/gdb/testsuite/gdb.base/follow-child.c gdb-6.6/gdb/testsuite/gdb.base/follow-child.c
---- gdb-6.6-orig/gdb/testsuite/gdb.base/follow-child.c	2007-10-13 19:24:58.000000000 +0200
-+++ gdb-6.6/gdb/testsuite/gdb.base/follow-child.c	2007-10-13 19:11:08.000000000 +0200
+Index: gdb-6.8cvs20080219/gdb/testsuite/gdb.base/follow-child.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8cvs20080219/gdb/testsuite/gdb.base/follow-child.c	2008-02-22 08:14:04.000000000 +0100
 @@ -0,0 +1,29 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
@@ -147,7 +160,7 @@
 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +   GNU General Public License for more details.
-+ 
++
 +   You should have received a copy of the GNU General Public License
 +   along with this program; if not, write to the Free Software
 +   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -163,9 +176,10 @@
 +  sleep (60);
 +  return 0;
 +}
-diff -u -u -X /home/jkratoch/.diffi.list -rup gdb-6.6-orig/gdb/testsuite/gdb.base/follow-child.exp gdb-6.6/gdb/testsuite/gdb.base/follow-child.exp
---- gdb-6.6-orig/gdb/testsuite/gdb.base/follow-child.exp	2007-10-13 19:24:58.000000000 +0200
-+++ gdb-6.6/gdb/testsuite/gdb.base/follow-child.exp	2007-10-13 19:24:21.000000000 +0200
+Index: gdb-6.8cvs20080219/gdb/testsuite/gdb.base/follow-child.exp
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8cvs20080219/gdb/testsuite/gdb.base/follow-child.exp	2008-02-22 08:14:17.000000000 +0100
 @@ -0,0 +1,55 @@
 +# Copyright 2007 Free Software Foundation, Inc.
 +
@@ -181,7 +195,7 @@
 +# 
 +# You should have received a copy of the GNU General Public License
 +# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 +
 +if $tracelevel then {
 +    strace $tracelevel
@@ -222,3 +236,16 @@
 +	fail $test
 +    }
 +}
+Index: gdb-6.8cvs20080219/gdb/Makefile.in
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/Makefile.in	2008-02-22 08:10:38.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/Makefile.in	2008-02-22 08:13:31.000000000 +0100
+@@ -2377,7 +2377,7 @@ linux-nat.o: linux-nat.c $(defs_h) $(inf
+ 	$(gdb_wait_h) $(gdb_assert_h) $(linux_nat_h) $(gdbthread_h) \
+ 	$(gdbcmd_h) $(regcache_h) $(regset_h) $(inf_ptrace_h) $(auxv_h) \
+ 	$(elf_bfd_h) $(gregset_h) $(gdbcore_h) $(gdbthread_h) $(gdb_stat_h) \
+-	$(linux_fork_h)
++	$(linux_fork_h) $(observer_h)
+ linux-thread-db.o: linux-thread-db.c $(defs_h) $(gdb_assert_h) \
+ 	$(gdb_proc_service_h) $(gdb_thread_db_h) $(bfd_h) $(exceptions_h) \
+ 	$(gdbthread_h) $(inferior_h) $(symfile_h) $(objfiles_h) $(target_h) \

gdb-6.3-pie-20050110.patch:

Index: gdb-6.3-pie-20050110.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.3-pie-20050110.patch,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- gdb-6.3-pie-20050110.patch	16 Nov 2007 02:15:40 -0000	1.6
+++ gdb-6.3-pie-20050110.patch	3 Mar 2008 16:13:47 -0000	1.7
@@ -10,11 +10,19 @@
 
 	* solib-svr4.c (svr4_current_sos): Fix segfault on NULL EXEC_BFD.
 
-Index: gdb-6.7.1/gdb/dwarf2read.c
+2008-02-24  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
+
+2008-02-27  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to gdb-6.7.50.20080227.
+
+Index: gdb-6.7.50.20080227/gdb/dwarf2read.c
 ===================================================================
---- gdb-6.7.1.orig/gdb/dwarf2read.c	2007-11-02 15:24:10.000000000 +0100
-+++ gdb-6.7.1/gdb/dwarf2read.c	2007-11-02 15:24:19.000000000 +0100
-@@ -1226,7 +1226,7 @@ dwarf2_build_psymtabs (struct objfile *o
+--- gdb-6.7.50.20080227.orig/gdb/dwarf2read.c	2008-02-27 08:57:20.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/dwarf2read.c	2008-02-27 08:57:31.000000000 +0100
+@@ -1217,7 +1217,7 @@ dwarf2_build_psymtabs (struct objfile *o
    else
      dwarf2_per_objfile->loc_buffer = NULL;
  
@@ -23,10 +31,10 @@
        || (objfile->global_psymbols.size == 0
  	  && objfile->static_psymbols.size == 0))
      {
-Index: gdb-6.7.1/gdb/auxv.c
+Index: gdb-6.7.50.20080227/gdb/auxv.c
 ===================================================================
---- gdb-6.7.1.orig/gdb/auxv.c	2007-08-23 20:08:26.000000000 +0200
-+++ gdb-6.7.1/gdb/auxv.c	2007-11-02 15:24:19.000000000 +0100
+--- gdb-6.7.50.20080227.orig/gdb/auxv.c	2008-01-16 17:27:37.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/auxv.c	2008-02-27 08:57:31.000000000 +0100
 @@ -80,7 +80,7 @@ procfs_xfer_auxv (struct target_ops *ops
     Return 1 if an entry was read into *TYPEP and *VALP.  */
  int
@@ -89,7 +97,7 @@
  	{
  #define TAG(tag, text, kind) \
  	case tag: name = #tag; description = text; flavor = kind; break
-@@ -211,7 +213,7 @@ fprint_target_auxv (struct ui_file *file
+@@ -213,7 +215,7 @@ fprint_target_auxv (struct ui_file *file
  	}
  
        fprintf_filtered (file, "%-4s %-20s %-30s ",
@@ -98,10 +106,10 @@
        switch (flavor)
  	{
  	case dec:
-Index: gdb-6.7.1/gdb/auxv.h
+Index: gdb-6.7.50.20080227/gdb/auxv.h
 ===================================================================
---- gdb-6.7.1.orig/gdb/auxv.h	2007-08-23 20:08:26.000000000 +0200
-+++ gdb-6.7.1/gdb/auxv.h	2007-11-02 15:24:19.000000000 +0100
+--- gdb-6.7.50.20080227.orig/gdb/auxv.h	2008-01-01 23:53:09.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/auxv.h	2008-02-27 08:57:31.000000000 +0100
 @@ -35,14 +35,14 @@ struct target_ops;		/* Forward declarati
     Return 1 if an entry was read into *TYPEP and *VALP.  */
  extern int target_auxv_parse (struct target_ops *ops,
@@ -119,11 +127,11 @@
  
  /* Print the contents of the target's AUXV on the specified file. */
  extern int fprint_target_auxv (struct ui_file *file, struct target_ops *ops);
-Index: gdb-6.7.1/gdb/breakpoint.h
+Index: gdb-6.7.50.20080227/gdb/breakpoint.h
 ===================================================================
---- gdb-6.7.1.orig/gdb/breakpoint.h	2007-11-02 15:22:24.000000000 +0100
-+++ gdb-6.7.1/gdb/breakpoint.h	2007-11-02 15:24:59.000000000 +0100
-@@ -150,6 +150,7 @@ enum enable_state
+--- gdb-6.7.50.20080227.orig/gdb/breakpoint.h	2008-02-01 17:24:46.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/breakpoint.h	2008-02-27 08:57:31.000000000 +0100
+@@ -144,6 +144,7 @@ enum enable_state
  			   automatically enabled and reset when the call 
  			   "lands" (either completes, or stops at another 
  			   eventpoint). */
@@ -131,7 +139,7 @@
      bp_permanent	/* There is a breakpoint instruction hard-wired into
  			   the target's code.  Don't try to write another
  			   breakpoint instruction on top of it, or restore
-@@ -826,6 +827,10 @@ extern void remove_thread_event_breakpoi
+@@ -823,6 +824,10 @@ extern void remove_thread_event_breakpoi
  
  extern void disable_breakpoints_in_shlibs (void);
  
@@ -139,13 +147,13 @@
 +
 +extern void re_enable_breakpoints_at_startup (void);
 +
- extern void create_solib_load_event_breakpoint (char *, int, char *, char *);
+ /* This function returns TRUE if ep is a catchpoint. */
+ extern int ep_is_catchpoint (struct breakpoint *);
  
- extern void create_solib_unload_event_breakpoint (char *, int,
-Index: gdb-6.7.1/gdb/symfile-mem.c
+Index: gdb-6.7.50.20080227/gdb/symfile-mem.c
 ===================================================================
---- gdb-6.7.1.orig/gdb/symfile-mem.c	2007-08-23 20:08:39.000000000 +0200
-+++ gdb-6.7.1/gdb/symfile-mem.c	2007-11-02 15:24:19.000000000 +0100
+--- gdb-6.7.50.20080227.orig/gdb/symfile-mem.c	2008-01-01 23:53:13.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/symfile-mem.c	2008-02-27 08:57:31.000000000 +0100
 @@ -108,7 +108,7 @@ symbol_file_add_from_memory (struct bfd 
        }
  
@@ -155,11 +163,11 @@
  
    /* This might change our ideas about frames already looked at.  */
    reinit_frame_cache ();
-Index: gdb-6.7.1/gdb/infrun.c
+Index: gdb-6.7.50.20080227/gdb/infrun.c
 ===================================================================
---- gdb-6.7.1.orig/gdb/infrun.c	2007-11-02 15:21:57.000000000 +0100
-+++ gdb-6.7.1/gdb/infrun.c	2007-11-02 15:24:19.000000000 +0100
-@@ -2298,6 +2298,11 @@ process_event_stop_test:
+--- gdb-6.7.50.20080227.orig/gdb/infrun.c	2008-02-27 08:57:20.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/infrun.c	2008-02-27 08:57:31.000000000 +0100
+@@ -2277,6 +2277,11 @@ process_event_stop_test:
  #endif
  	  target_terminal_inferior ();
  
@@ -171,13 +179,13 @@
  	  /* If requested, stop when the dynamic linker notifies
  	     gdb of events.  This allows the user to get control
  	     and place breakpoints in initializer routines for
-Index: gdb-6.7.1/gdb/objfiles.c
+Index: gdb-6.7.50.20080227/gdb/objfiles.c
 ===================================================================
---- gdb-6.7.1.orig/gdb/objfiles.c	2007-08-23 20:08:36.000000000 +0200
-+++ gdb-6.7.1/gdb/objfiles.c	2007-11-02 15:24:19.000000000 +0100
-@@ -48,6 +48,9 @@
- #include "dictionary.h"
+--- gdb-6.7.50.20080227.orig/gdb/objfiles.c	2008-01-01 23:53:12.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/objfiles.c	2008-02-27 08:57:31.000000000 +0100
+@@ -49,6 +49,9 @@
  #include "source.h"
+ #include "addrmap.h"
  
 +#include "auxv.h"
 +#include "elf/common.h"
@@ -185,7 +193,7 @@
  /* Prototypes for local functions */
  
  static void objfile_alloc_data (struct objfile *objfile);
-@@ -259,7 +262,19 @@ init_entry_point_info (struct objfile *o
+@@ -260,7 +263,19 @@ init_entry_point_info (struct objfile *o
  CORE_ADDR
  entry_point_address (void)
  {
@@ -206,10 +214,10 @@
  }
  
  /* Create the terminating entry of OBJFILE's minimal symbol table.
-Index: gdb-6.7.1/gdb/solib-svr4.c
+Index: gdb-6.7.50.20080227/gdb/solib-svr4.c
 ===================================================================
---- gdb-6.7.1.orig/gdb/solib-svr4.c	2007-11-02 15:21:46.000000000 +0100
-+++ gdb-6.7.1/gdb/solib-svr4.c	2007-11-02 15:24:19.000000000 +0100
+--- gdb-6.7.50.20080227.orig/gdb/solib-svr4.c	2008-02-27 08:57:19.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/solib-svr4.c	2008-02-27 08:59:06.000000000 +0100
 @@ -31,6 +31,8 @@
  #include "gdbcore.h"
  #include "target.h"
@@ -219,7 +227,7 @@
  
  #include "gdb_assert.h"
  
-@@ -249,7 +251,9 @@ static char *debug_loader_name;
+@@ -246,7 +248,9 @@ static char *debug_loader_name;
  
  /* Local function prototypes */
  
@@ -229,7 +237,7 @@
  
  static CORE_ADDR bfd_lookup_symbol (bfd *, char *);
  
-@@ -352,10 +356,12 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
+@@ -349,10 +353,12 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
    int arch_size, step, sect_size;
    long dyn_tag;
    CORE_ADDR dyn_ptr, dyn_addr;
@@ -242,7 +250,7 @@
  
    if (abfd == NULL)
      return 0;
-@@ -363,19 +369,74 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
+@@ -360,19 +366,74 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
    if (arch_size == -1)
     return 0;
  
@@ -319,7 +327,7 @@
  
    /* Iterate over BUF and scan for DYNTAG.  If found, set PTR and return.  */
    step = (arch_size == 32) ? sizeof (Elf32_External_Dyn)
-@@ -408,9 +469,43 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
+@@ -405,9 +466,43 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
  	     CORE_ADDR ptr_addr;
  
  	     ptr_addr = dyn_addr + (buf - bufstart) + arch_size / 8;
@@ -365,7 +373,7 @@
  	     *ptr = dyn_ptr;
  	   }
  	 return 1;
-@@ -547,6 +642,10 @@ solib_svr4_r_map (void)
+@@ -544,6 +639,10 @@ solib_svr4_r_map (void)
  {
    struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
  
@@ -376,41 +384,40 @@
    return read_memory_typed_address (debug_base + lmo->r_map_offset,
  				    builtin_type_void_data_ptr);
  }
-@@ -704,6 +803,11 @@ svr4_current_sos (void)
+@@ -713,6 +812,11 @@ svr4_current_sos (void)
+   struct so_list *head = 0;
    struct so_list **link_ptr = &head;
    CORE_ADDR ldsomap = 0;
 +  const char *filename = exec_bfd ? exec_bfd->filename : "<none>";
- 
++
 +  if (debug_solib)
 +    fprintf_unfiltered (gdb_stdlog, 
 +                        "svr4_current_sos: exec_bfd %s\n", filename);
-+
-   /* Make sure we've looked up the inferior's dynamic linker's base
-      structure.  */
+ 
+   /* Always locate the debug struct, in case it has moved.  */
+   debug_base = 0;
+@@ -721,10 +825,19 @@ svr4_current_sos (void)
+   /* If we can't find the dynamic linker's base structure, this
+      must not be a dynamically linked executable.  Hmm.  */
    if (! debug_base)
-@@ -713,11 +817,20 @@ svr4_current_sos (void)
-       /* If we can't find the dynamic linker's base structure, this
- 	 must not be a dynamically linked executable.  Hmm.  */
-       if (! debug_base)
--	return svr4_default_sos ();
-+        {
-+	  if (debug_solib)
-+	    fprintf_unfiltered (gdb_stdlog, 
-+				"svr4_current_sos: no DT_DEBUG found in %s -- return now\n",
-+				filename);
-+	  return svr4_default_sos ();
-+        }
-     }
+-    return svr4_default_sos ();
++    {
++      if (debug_solib)
++	fprintf_unfiltered (gdb_stdlog, 
++			    "svr4_current_sos: no DT_DEBUG found in %s -- return now\n",
++			    filename);
++      return svr4_default_sos ();
++    }
  
    /* Walk the inferior's link map list, and build our list of
       `struct so_list' nodes.  */
 +  if (debug_solib)
 +    fprintf_unfiltered (gdb_stdlog, 
-+                        "svr4_current_sos: walk link map in %s\n", filename);
++			"svr4_current_sos: walk link map in %s\n", filename);
    lm = solib_svr4_r_map ();
  
    while (lm)
-@@ -733,23 +847,103 @@ svr4_current_sos (void)
+@@ -740,23 +853,103 @@ svr4_current_sos (void)
        new->lm_info->lm = xzalloc (lmo->link_map_size);
        make_cleanup (xfree, new->lm_info->lm);
  
@@ -516,7 +523,7 @@
  	  target_read_string (LM_NAME (new), &buffer,
  			      SO_NAME_MAX_PATH_SIZE - 1, &errcode);
  	  if (errcode != 0)
-@@ -757,23 +951,35 @@ svr4_current_sos (void)
+@@ -764,23 +957,35 @@ svr4_current_sos (void)
  		     safe_strerror (errcode));
  	  else
  	    {
@@ -568,7 +575,7 @@
  	}
  
        /* On Solaris, the dynamic linker is not in the normal list of
-@@ -789,6 +995,9 @@ svr4_current_sos (void)
+@@ -796,6 +1001,9 @@ svr4_current_sos (void)
    if (head == NULL)
      return svr4_default_sos ();
  
@@ -578,7 +585,7 @@
    return head;
  }
  
-@@ -868,7 +1079,7 @@ svr4_fetch_objfile_link_map (struct objf
+@@ -875,7 +1083,7 @@ svr4_fetch_objfile_link_map (struct objf
  /* On some systems, the only way to recognize the link map entry for
     the main executable file is by looking at its name.  Return
     non-zero iff SONAME matches one of the known main executable names.  */
@@ -587,7 +594,7 @@
  static int
  match_main (char *soname)
  {
-@@ -882,6 +1093,7 @@ match_main (char *soname)
+@@ -889,6 +1097,7 @@ match_main (char *soname)
  
    return (0);
  }
@@ -595,7 +602,7 @@
  
  /* Return 1 if PC lies in the dynamic symbol resolution code of the
     SVR4 run time loader.  */
-@@ -979,6 +1191,11 @@ enable_break (void)
+@@ -1040,6 +1249,11 @@ enable_break (void)
    /* Find the .interp section; if not found, warn the user and drop
       into the old breakpoint at symbol code.  */
    interp_sect = bfd_get_section_by_name (exec_bfd, ".interp");
@@ -607,7 +614,7 @@
    if (interp_sect)
      {
        unsigned int interp_sect_size;
-@@ -1018,6 +1235,9 @@ enable_break (void)
+@@ -1074,6 +1288,9 @@ enable_break (void)
        if (tmp_fd >= 0)
  	tmp_bfd = bfd_fopen (tmp_pathname, gnutarget, FOPEN_RB, tmp_fd);
  
@@ -617,7 +624,7 @@
        if (tmp_bfd == NULL)
  	goto bkpt_at_symbol;
  
-@@ -1115,6 +1335,9 @@ enable_break (void)
+@@ -1180,6 +1397,9 @@ enable_break (void)
        if (sym_addr != 0)
  	{
  	  create_solib_event_breakpoint (load_addr + sym_addr);
@@ -627,7 +634,7 @@
  	  return 1;
  	}
  
-@@ -1375,6 +1598,8 @@ svr4_solib_create_inferior_hook (void)
+@@ -1440,6 +1660,8 @@ svr4_solib_create_inferior_hook (void)
    while (stop_signal != TARGET_SIGNAL_TRAP);
    stop_soon = NO_STOP_QUIETLY;
  #endif /* defined(_SCO_DS) */
@@ -636,7 +643,7 @@
  }
  
  static void
-@@ -1551,6 +1776,75 @@ svr4_lp64_fetch_link_map_offsets (void)
+@@ -1620,6 +1842,75 @@ svr4_lp64_fetch_link_map_offsets (void)
  
    return lmp;
  }
@@ -712,20 +719,19 @@
  
  
  struct target_so_ops svr4_so_ops;
-@@ -1592,4 +1886,8 @@ _initialize_svr4_solib (void)
- 
-   /* FIXME: Don't do this here.  *_gdbarch_init() should set so_ops. */
-   current_target_so_ops = &svr4_so_ops;
+@@ -1678,4 +1969,7 @@ _initialize_svr4_solib (void)
+   svr4_so_ops.in_dynsym_resolve_code = svr4_in_dynsym_resolve_code;
+   svr4_so_ops.lookup_lib_global_symbol = elf_lookup_lib_symbol;
+   svr4_so_ops.same = svr4_same;
 +
 +  add_info ("linkmap", info_linkmap_command,
-+            "Display the inferior's linkmap.");
-+
++	    "Display the inferior's linkmap.");
  }
-Index: gdb-6.7.1/gdb/varobj.c
+Index: gdb-6.7.50.20080227/gdb/varobj.c
 ===================================================================
---- gdb-6.7.1.orig/gdb/varobj.c	2007-08-31 21:01:17.000000000 +0200
-+++ gdb-6.7.1/gdb/varobj.c	2007-11-02 15:24:19.000000000 +0100
-@@ -1116,6 +1116,62 @@ install_new_value (struct varobj *var, s
+--- gdb-6.7.50.20080227.orig/gdb/varobj.c	2008-02-04 08:49:04.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/varobj.c	2008-02-27 08:57:31.000000000 +0100
+@@ -1078,6 +1078,62 @@ install_new_value (struct varobj *var, s
    return changed;
  }
  
@@ -788,10 +794,10 @@
  /* Update the values for a variable and its children.  This is a
     two-pronged attack.  First, re-parse the value for the root's
     expression to see if it's changed.  Then go all the way
-Index: gdb-6.7.1/gdb/solist.h
+Index: gdb-6.7.50.20080227/gdb/solist.h
 ===================================================================
---- gdb-6.7.1.orig/gdb/solist.h	2007-08-23 20:08:38.000000000 +0200
-+++ gdb-6.7.1/gdb/solist.h	2007-11-02 15:24:19.000000000 +0100
+--- gdb-6.7.50.20080227.orig/gdb/solist.h	2008-01-07 16:19:58.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/solist.h	2008-02-27 08:57:31.000000000 +0100
 @@ -61,6 +61,8 @@ struct so_list
      bfd *abfd;
      char symbols_loaded;	/* flag: symbols read in yet? */
@@ -801,7 +807,7 @@
      struct objfile *objfile;	/* objfile for loaded lib */
      struct section_table *sections;
      struct section_table *sections_end;
-@@ -123,9 +125,15 @@ void free_so (struct so_list *so);
+@@ -127,9 +129,15 @@ void free_so (struct so_list *so);
  /* Return address of first so_list entry in master shared object list.  */
  struct so_list *master_so_list (void);
  
@@ -817,28 +823,28 @@
  /* FIXME: gdbarch needs to control this variable */
  extern struct target_so_ops *current_target_so_ops;
  
-@@ -143,4 +151,6 @@ struct symbol *solib_global_lookup (cons
+@@ -140,4 +148,6 @@ struct symbol *solib_global_lookup (cons
  				    const domain_enum domain,
  				    struct symtab **symtab);
  
 +/* Controls the printing of debugging output.  */
 +extern int debug_solib;
  #endif
-Index: gdb-6.7.1/gdb/varobj.h
+Index: gdb-6.7.50.20080227/gdb/varobj.h
 ===================================================================
---- gdb-6.7.1.orig/gdb/varobj.h	2007-08-31 20:52:05.000000000 +0200
-+++ gdb-6.7.1/gdb/varobj.h	2007-11-02 15:24:19.000000000 +0100
-@@ -114,4 +114,6 @@ extern int varobj_update (struct varobj 
+--- gdb-6.7.50.20080227.orig/gdb/varobj.h	2008-01-30 08:17:31.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/varobj.h	2008-02-27 08:57:31.000000000 +0100
+@@ -122,4 +122,6 @@ extern void varobj_invalidate (void);
  
- extern void varobj_invalidate (void);
+ extern int varobj_editable_p (struct varobj *var);
  
 +extern void varobj_refresh(void);
 +
  #endif /* VAROBJ_H */
-Index: gdb-6.7.1/gdb/symfile.c
+Index: gdb-6.7.50.20080227/gdb/symfile.c
 ===================================================================
---- gdb-6.7.1.orig/gdb/symfile.c	2007-09-24 23:48:05.000000000 +0200
-+++ gdb-6.7.1/gdb/symfile.c	2007-11-02 15:24:19.000000000 +0100
+--- gdb-6.7.50.20080227.orig/gdb/symfile.c	2008-01-29 23:47:20.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/symfile.c	2008-02-27 08:57:31.000000000 +0100
 @@ -47,6 +47,7 @@
  #include "readline/readline.h"
  #include "gdb_assert.h"
@@ -847,7 +853,7 @@
  #include "observer.h"
  #include "exec.h"
  #include "parser-defs.h"
-@@ -779,7 +780,7 @@ syms_from_objfile (struct objfile *objfi
+@@ -778,7 +779,7 @@ syms_from_objfile (struct objfile *objfi
  
    /* Now either addrs or offsets is non-zero.  */
  
@@ -856,7 +862,7 @@
      {
        /* We will modify the main symbol table, make sure that all its users
           will be cleaned up if an error occurs during symbol reading.  */
-@@ -807,7 +808,7 @@ syms_from_objfile (struct objfile *objfi
+@@ -806,7 +807,7 @@ syms_from_objfile (struct objfile *objfi
  
       We no longer warn if the lowest section is not a text segment (as
       happens for the PA64 port.  */
@@ -865,7 +871,7 @@
      {
        asection *lower_sect;
        asection *sect;
-@@ -976,17 +977,21 @@ new_symfile_objfile (struct objfile *obj
+@@ -975,17 +976,21 @@ new_symfile_objfile (struct objfile *obj
    /* If this is the main symbol file we have to clean up all users of the
       old main symbol file. Otherwise it is sufficient to fixup all the
       breakpoints that may have been redefined by this symbol file.  */
@@ -889,7 +895,7 @@
  
    /* We're done reading the symbol file; finish off complaints.  */
    clear_complaints (&symfile_complaints, 0, verbo);
-@@ -1029,7 +1034,7 @@ symbol_file_add_with_addrs_or_offsets (b
+@@ -1028,7 +1033,7 @@ symbol_file_add_with_addrs_or_offsets (b
       interactively wiping out any existing symbols.  */
  
    if ((have_full_symbols () || have_partial_symbols ())
@@ -898,7 +904,7 @@
        && from_tty
        && !query ("Load new symbol table from \"%s\"? ", name))
      error (_("Not confirmed."));
-@@ -1213,6 +1218,10 @@ symbol_file_clear (int from_tty)
+@@ -1212,6 +1217,10 @@ symbol_file_clear (int from_tty)
  		    symfile_objfile->name)
  	  : !query (_("Discard symbol table? "))))
      error (_("Not confirmed."));
@@ -909,7 +915,7 @@
      free_all_objfiles ();
  
      /* solib descriptors may have handles to objfiles.  Since their
-@@ -2470,6 +2479,8 @@ reread_symbols (void)
+@@ -2466,6 +2475,8 @@ reread_symbols (void)
  	      /* Discard cleanups as symbol reading was successful.  */
  	      discard_cleanups (old_cleanups);
  
@@ -918,7 +924,7 @@
  	      /* If the mtime has changed between the time we set new_modtime
  	         and now, we *want* this to be out of date, so don't call stat
  	         again now.  */
-@@ -2837,6 +2848,7 @@ clear_symtab_users (void)
+@@ -2834,6 +2845,7 @@ clear_symtab_users (void)
    breakpoint_re_set ();
    set_default_breakpoint (0, 0, 0, 0);
    clear_pc_function_cache ();
@@ -926,101 +932,20 @@
    observer_notify_new_objfile (NULL);
  
    /* Clear globals which might have pointed into a removed objfile.
-Index: gdb-6.7.1/gdb/breakpoint.c
+Index: gdb-6.7.50.20080227/gdb/breakpoint.c
 ===================================================================
---- gdb-6.7.1.orig/gdb/breakpoint.c	2007-11-02 15:24:10.000000000 +0100
-+++ gdb-6.7.1/gdb/breakpoint.c	2007-11-02 15:26:50.000000000 +0100
-@@ -847,15 +847,15 @@ insert_watchpoints_for_new_thread (ptid_
- 	  struct value *v = b->owner->val_chain;
- 
- 	  /* Look at each value on the value chain.  */
--	  for (; v; v = v->next)
-+	  for (; v; v = value_next (v))
- 	    {
- 	      /* If it's a memory location, and GDB actually needed
- 		 its contents to evaluate the expression, then we
- 		 must watch it.  */
- 	      if (VALUE_LVAL (v) == lval_memory
--		  && ! VALUE_LAZY (v))
-+		  && ! value_lazy (v))
- 		{
--		  struct type *vtype = check_typedef (VALUE_TYPE (v));
-+		  struct type *vtype = check_typedef (value_type (v));
- 		  
- 		  /* We only watch structs and arrays if user asked
- 		     for it explicitly, never if they just happen to
-@@ -867,8 +867,8 @@ insert_watchpoints_for_new_thread (ptid_
- 		      CORE_ADDR addr;
- 		      int len, type;
- 		      
--		      addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
--		      len = TYPE_LENGTH (VALUE_TYPE (v));
-+		      addr = VALUE_ADDRESS (v) + value_offset (v);
-+		      len = TYPE_LENGTH (value_type (v));
- 		      type = hw_write;
- 		      if (b->owner->type == bp_read_watchpoint)
- 			type = hw_read;
-@@ -2767,12 +2767,12 @@ mark_triggered_watchpoints (CORE_ADDR st
- 	|| b->type == bp_read_watchpoint
- 	|| b->type == bp_access_watchpoint)
-       {
--	for (v = b->val_chain; v; v = v->next)
-+	for (v = b->val_chain; v; v = value_next (v))
- 	  {
- 	    if (VALUE_LVAL (v) == lval_memory
--	        && ! VALUE_LAZY (v))
-+	        && ! value_lazy (v))
- 	      {
--	        struct type *vtype = check_typedef (VALUE_TYPE (v));
-+	        struct type *vtype = check_typedef (value_type (v));
- 		    
- 		if (v == b->val_chain
- 		    || (TYPE_CODE (vtype) != TYPE_CODE_STRUCT
-@@ -2780,11 +2780,11 @@ mark_triggered_watchpoints (CORE_ADDR st
- 		  {
- 		    CORE_ADDR vaddr;
- 			
--		    vaddr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
-+		    vaddr = VALUE_ADDRESS (v) + value_offset (v);
- 		    /* Exact match not required.  Within range is
- 		       sufficient.  */
- 		    if (addr >= vaddr &&
--		        addr < vaddr + TYPE_LENGTH (VALUE_TYPE (v)))
-+		        addr < vaddr + TYPE_LENGTH (value_type (v)))
- 		      b->watchpoint_triggered = 1;
- 		  }
- 	      }
-@@ -2957,12 +2957,12 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
- 		bs->stop = 0;
- 		continue;
- 	      }
--	    for (v = b->val_chain; v; v = v->next)
-+	    for (v = b->val_chain; v; v = value_next (v))
- 	      {
- 		if (VALUE_LVAL (v) == lval_memory
--		    && ! VALUE_LAZY (v))
-+		    && ! value_lazy (v))
- 		  {
--		    struct type *vtype = check_typedef (VALUE_TYPE (v));
-+		    struct type *vtype = check_typedef (value_type (v));
- 		    
- 		    if (v == b->val_chain
- 			|| (TYPE_CODE (vtype) != TYPE_CODE_STRUCT
-@@ -2970,11 +2970,11 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
- 		      {
- 			CORE_ADDR vaddr;
- 			
--			vaddr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
-+			vaddr = VALUE_ADDRESS (v) + value_offset (v);
- 			/* Exact match not required.  Within range is
- 			   sufficient.  */
- 			if (addr >= vaddr &&
--			    addr < vaddr + TYPE_LENGTH (VALUE_TYPE (v)))
-+			    addr < vaddr + TYPE_LENGTH (value_type (v)))
- 			  must_check_value = 1;
- 		      }
- 		  }
-@@ -4118,7 +4118,8 @@ describe_other_breakpoints (CORE_ADDR pc
+--- gdb-6.7.50.20080227.orig/gdb/breakpoint.c	2008-02-27 08:57:20.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/breakpoint.c	2008-02-27 08:57:31.000000000 +0100
+@@ -923,7 +923,7 @@ update_watchpoint (struct breakpoint *b,
+       value_release_to_mark (mark);
+ 
+       /* Look at each value on the value chain.  */
+-      for (; v; v = next)
++      for (; v; v = value_next (v))
+ 	{
+ 	  /* If it's a memory location, and GDB actually needed
+ 	     its contents to evaluate the expression, then we
+@@ -3882,7 +3882,8 @@ describe_other_breakpoints (CORE_ADDR pc
  	      printf_filtered (" (thread %d)", b->thread);
  	    printf_filtered ("%s%s ",
  			     ((b->enable_state == bp_disabled || 
@@ -1030,7 +955,7 @@
  			      ? " (disabled)"
  			      : b->enable_state == bp_permanent 
  			      ? " (permanent)"
-@@ -4773,6 +4774,62 @@ disable_breakpoints_in_unloaded_shlib (s
+@@ -4534,6 +4535,62 @@ disable_breakpoints_in_unloaded_shlib (s
    }
  }
  
@@ -1091,13 +1016,13 @@
 +
 +
  static void
- solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname,
- 		     char *cond_string, enum bptype bp_kind)
-Index: gdb-6.7.1/gdb/solib.c
+ create_fork_vfork_event_catchpoint (int tempflag, char *cond_string,
+ 				    enum bptype bp_kind)
+Index: gdb-6.7.50.20080227/gdb/solib.c
 ===================================================================
---- gdb-6.7.1.orig/gdb/solib.c	2007-08-23 20:08:38.000000000 +0200
-+++ gdb-6.7.1/gdb/solib.c	2007-11-02 15:24:19.000000000 +0100
-@@ -78,6 +78,8 @@ set_solib_ops (struct gdbarch *gdbarch, 
+--- gdb-6.7.50.20080227.orig/gdb/solib.c	2008-01-07 16:19:58.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/solib.c	2008-02-27 08:57:31.000000000 +0100
+@@ -79,6 +79,8 @@ set_solib_ops (struct gdbarch *gdbarch, 
  
  /* external data declarations */
  
@@ -1106,7 +1031,7 @@
  /* FIXME: gdbarch needs to control this variable, or else every
     configuration needs to call set_solib_ops.  */
  struct target_so_ops *current_target_so_ops;
-@@ -105,6 +107,8 @@ The search path for loading non-absolute
+@@ -102,6 +104,8 @@ The search path for loading non-absolute
  		    value);
  }
  
@@ -1115,7 +1040,7 @@
  /*
  
     GLOBAL FUNCTION
-@@ -394,7 +398,6 @@ free_so (struct so_list *so)
+@@ -391,7 +395,6 @@ free_so (struct so_list *so)
    xfree (so);
  }
  
@@ -1123,7 +1048,7 @@
  /* Return address of first so_list entry in master shared object list.  */
  struct so_list *
  master_so_list (void)
-@@ -402,7 +405,6 @@ master_so_list (void)
+@@ -399,7 +402,6 @@ master_so_list (void)
    return so_list_head;
  }
  
@@ -1131,7 +1056,7 @@
  /* A small stub to get us past the arg-passing pinhole of catch_errors.  */
  
  static int
-@@ -414,15 +416,40 @@ symbol_add_stub (void *arg)
+@@ -411,15 +413,40 @@ symbol_add_stub (void *arg)
    /* Have we already loaded this shared object?  */
    ALL_OBJFILES (so->objfile)
      {
@@ -1175,18 +1100,18 @@
    free_section_addr_info (sap);
  
    return (1);
-@@ -550,6 +577,10 @@ update_solib_list (int from_tty, struct 
- 	 the inferior's current list.  */
-       while (i)
- 	{
-+          if (debug_solib)
-+            fprintf_unfiltered (gdb_stdlog,
-+                                "update_solib_list: compare gdb:%s and inferior:%s\n",
-+                                gdb->so_original_name, i->so_original_name);
- 	  if (! strcmp (gdb->so_original_name, i->so_original_name))
- 	    break;
- 
-@@ -603,28 +634,7 @@ update_solib_list (int from_tty, struct 
+@@ -545,6 +572,10 @@ update_solib_list (int from_tty, struct 
+ 	    }
+ 	  else
+ 	    {
++	      if (debug_solib)
++		fprintf_unfiltered (gdb_stdlog,
++				    "update_solib_list: compare gdb:%s and inferior:%s\n",
++				    gdb->so_original_name, i->so_original_name);
+ 	      if (! strcmp (gdb->so_original_name, i->so_original_name))
+ 		break;	      
+ 	    }
+@@ -599,28 +630,7 @@ update_solib_list (int from_tty, struct 
        /* Fill in the rest of each of the `struct so_list' nodes.  */
        for (i = inferior; i; i = i->next)
  	{
@@ -1216,7 +1141,7 @@
  
  	  /* Notify any observer that the shared object has been
               loaded now that we've added it to GDB's tables.  */
-@@ -720,6 +730,41 @@ solib_add (char *pattern, int from_tty, 
+@@ -716,6 +726,41 @@ solib_add (char *pattern, int from_tty, 
    }
  }
  
@@ -1258,7 +1183,7 @@
  
  /*
  
-@@ -1045,4 +1090,12 @@ This takes precedence over the environme
+@@ -1035,4 +1080,12 @@ This takes precedence over the environme
  				     reload_shared_libraries,
  				     show_solib_search_path,
  				     &setlist, &showlist);
@@ -1271,11 +1196,11 @@
 +			   NULL, NULL,
 +			   &setdebuglist, &showdebuglist);
  }
-Index: gdb-6.7.1/gdb/elfread.c
+Index: gdb-6.7.50.20080227/gdb/elfread.c
 ===================================================================
---- gdb-6.7.1.orig/gdb/elfread.c	2007-08-23 20:08:28.000000000 +0200
-+++ gdb-6.7.1/gdb/elfread.c	2007-11-02 15:24:19.000000000 +0100
-@@ -611,7 +611,7 @@ elf_symfile_read (struct objfile *objfil
+--- gdb-6.7.50.20080227.orig/gdb/elfread.c	2008-01-01 23:53:09.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/elfread.c	2008-02-27 08:57:31.000000000 +0100
+@@ -644,7 +644,7 @@ elf_symfile_read (struct objfile *objfil
    /* If we are reinitializing, or if we have never loaded syms yet,
       set table to empty.  MAINLINE is cleared so that *_read_psymtab
       functions do not all also re-initialize the psymbol table. */
@@ -1284,11 +1209,11 @@
      {
        init_psymbol_list (objfile, 0);
        mainline = 0;
-Index: gdb-6.7.1/gdb/Makefile.in
+Index: gdb-6.7.50.20080227/gdb/Makefile.in
 ===================================================================
---- gdb-6.7.1.orig/gdb/Makefile.in	2007-11-02 15:24:10.000000000 +0100
-+++ gdb-6.7.1/gdb/Makefile.in	2007-11-02 15:24:19.000000000 +0100
-@@ -1819,7 +1819,7 @@ amd64-tdep.o: amd64-tdep.c $(defs_h) $(a
+--- gdb-6.7.50.20080227.orig/gdb/Makefile.in	2008-02-27 08:57:20.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/Makefile.in	2008-02-27 08:57:31.000000000 +0100
+@@ -1914,7 +1914,7 @@ amd64-tdep.o: amd64-tdep.c $(defs_h) $(a
  	$(dummy_frame_h) $(frame_h) $(frame_base_h) $(frame_unwind_h) \
  	$(inferior_h) $(gdbcmd_h) $(gdbcore_h) $(objfiles_h) $(regcache_h) \
  	$(regset_h) $(symfile_h) $(gdb_assert_h) $(amd64_tdep_h) \
@@ -1297,10 +1222,10 @@
  annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) \
  	$(gdbtypes_h) $(breakpoint_h)
  arch-utils.o: arch-utils.c $(defs_h) $(arch_utils_h) $(buildsym_h) \
-Index: gdb-6.7.1/gdb/amd64-tdep.c
+Index: gdb-6.7.50.20080227/gdb/amd64-tdep.c
 ===================================================================
---- gdb-6.7.1.orig/gdb/amd64-tdep.c	2007-11-02 15:21:46.000000000 +0100
-+++ gdb-6.7.1/gdb/amd64-tdep.c	2007-11-02 15:24:19.000000000 +0100
+--- gdb-6.7.50.20080227.orig/gdb/amd64-tdep.c	2008-02-27 08:57:19.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/amd64-tdep.c	2008-02-27 08:57:31.000000000 +0100
 @@ -36,6 +36,7 @@
  #include "symfile.h"
  #include "dwarf2-frame.h"
@@ -1309,7 +1234,7 @@
  
  #include "amd64-tdep.h"
  #include "i387-tdep.h"
-@@ -734,16 +735,28 @@ amd64_alloc_frame_cache (void)
+@@ -731,16 +732,28 @@ amd64_alloc_frame_cache (void)
     Any function that doesn't start with this sequence will be assumed
     to have no prologue and thus no valid frame pointer in %rbp.  */
  
@@ -1342,7 +1267,7 @@
  
    op = read_memory_unsigned_integer (pc, 1);
  
-@@ -756,18 +769,57 @@ amd64_analyze_prologue (CORE_ADDR pc, CO
+@@ -753,18 +766,57 @@ amd64_analyze_prologue (CORE_ADDR pc, CO
  
        /* If that's all, return now.  */
        if (current_pc <= pc + 1)

gdb-6.5-bz181390-memory-address-width.patch:

Index: gdb-6.5-bz181390-memory-address-width.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.5-bz181390-memory-address-width.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- gdb-6.5-bz181390-memory-address-width.patch	1 Nov 2007 20:24:20 -0000	1.2
+++ gdb-6.5-bz181390-memory-address-width.patch	3 Mar 2008 16:13:47 -0000	1.3
@@ -1,6 +1,5 @@
 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=181390
 
-
 2006-09-28  Jan Kratochvil  <jan.kratochvil at redhat.com>
 
 	* gdb/utils.c (paddress): Disable cutting of the printed addresses
@@ -9,15 +8,16 @@
 	(value_as_address): New `value_as_address' wrapper - cut memory address
 	to the target's address bit size, bugreport by John Reiser.
 
+2008-03-02  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
+	New testcase `gdb.arch/amd64-i386-address.exp'.
 
-Index: gdb-6.5/gdb/utils.c
+Index: gdb-6.7.50.20080227/gdb/utils.c
 ===================================================================
-RCS file: /cvs/src/src/gdb/utils.c,v
-retrieving revision 1.169
-diff -u -p -r1.169 utils.c
---- gdb-6.5.orig/gdb/utils.c	21 Sep 2006 13:50:51 -0000	1.169
-+++ gdb-6.5/gdb/utils.c	28 Sep 2006 17:06:03 -0000
-@@ -2596,6 +2596,14 @@ paddr_nz (CORE_ADDR addr)
+--- gdb-6.7.50.20080227.orig/gdb/utils.c	2008-03-02 14:28:44.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/utils.c	2008-03-02 14:35:09.000000000 +0100
+@@ -2540,6 +2540,14 @@ paddr_nz (CORE_ADDR addr)
  const char *
  paddress (CORE_ADDR addr)
  {
@@ -32,7 +32,7 @@
    /* Truncate address to the size of a target address, avoiding shifts
       larger or equal than the width of a CORE_ADDR.  The local
       variable ADDR_BIT stops the compiler reporting a shift overflow
-@@ -2609,6 +2617,8 @@ paddress (CORE_ADDR addr)
+@@ -2553,6 +2561,8 @@ paddress (CORE_ADDR addr)
  
    if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
      addr &= ((CORE_ADDR) 1 << addr_bit) - 1;
@@ -41,30 +41,26 @@
    return hex_string (addr);
  }
  
-Index: gdb-6.5/gdb/value.c
+Index: gdb-6.7.50.20080227/gdb/value.c
 ===================================================================
-RCS file: /cvs/src/src/gdb/value.c,v
-retrieving revision 1.36
-diff -u -p -r1.36 value.c
---- gdb-6.5.orig/gdb/value.c	31 Mar 2006 10:36:18 -0000	1.36
-+++ gdb-6.5/gdb/value.c	28 Sep 2006 17:06:03 -0000
-@@ -950,11 +950,10 @@ value_as_double (struct value *val)
-     error (_("Invalid floating value found in program."));
+--- gdb-6.7.50.20080227.orig/gdb/value.c	2008-01-18 18:07:40.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/value.c	2008-03-02 14:36:38.000000000 +0100
+@@ -983,11 +983,9 @@ value_as_double (struct value *val)
    return foo;
  }
+ 
 -/* Extract a value as a C pointer. Does not deallocate the value.  
 -   Note that val's type may not actually be a pointer; value_as_long
 -   handles all the cases.  */
 -CORE_ADDR
 -value_as_address (struct value *val)
-+
 +/* See `value_as_address' below - core of value to C pointer extraction.  */
 +static CORE_ADDR
 +value_as_address_core (struct value *val)
  {
    /* Assume a CORE_ADDR can fit in a LONGEST (for now).  Not sure
       whether we want this to be true eventually.  */
-@@ -1054,6 +1053,34 @@ value_as_address (struct value *val)
+@@ -1087,6 +1085,34 @@ value_as_address (struct value *val)
    return unpack_long (value_type (val), value_contents (val));
  #endif
  }
@@ -99,3 +95,103 @@
  
  /* Unpack raw data (copied from debugee, target byte order) at VALADDR
     as a long, or as a double, assuming the raw data is described
+--- /dev/null	2008-03-01 10:30:54.797374318 +0100
++++ gdb-6.7.50.20080227/gdb/testsuite/gdb.arch/amd64-i386-address.S	2008-03-02 12:47:06.000000000 +0100
+@@ -0,0 +1,32 @@
++/* Copyright 2008 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb at gnu.org
++
++   This file is part of the gdb testsuite.
++
++   Test UNsigned extension of the 32-bit inferior address on a 64-bit host.
++   This file is based on the work by John Reiser.
++   This file was created by Jan Kratochvil <jan.kratochvil at redhat.com>.
++   https://bugzilla.redhat.com/show_bug.cgi?id=181390  */
++
++_start:	.globl	_start
++	nop
++	int3
++	movl	%esp,%ebx
++	int3	# examining memory from $ebx fails, from $esp succeeds
++	nop
++	nop
+--- /dev/null	2008-03-01 10:30:54.797374318 +0100
++++ gdb-6.7.50.20080227/gdb/testsuite/gdb.arch/amd64-i386-address.exp	2008-03-02 12:57:11.000000000 +0100
+@@ -0,0 +1,62 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# Please email any bugs, comments, and/or additions to this file to:
++# bug-gdb at gnu.org
++
++# This file is part of the gdb testsuite.
++
++# Test UNsigned extension of the 32-bit inferior address on a 64-bit host.
++# This file is based on the work by John Reiser.
++# This file was created by Jan Kratochvil <jan.kratochvil at redhat.com>.
++# https://bugzilla.redhat.com/show_bug.cgi?id=181390
++
++if {![istarget "x86_64-*-*"]} then {
++    verbose "Skipping amd64->i386 adress test."
++    return
++}
++
++set testfile "amd64-i386-address"
++set srcfile ${testfile}.S
++set binfile ${objdir}/${subdir}/${testfile}
++
++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-m32 -nostdlib"]] != "" } {
++    untested amd64-i386-address.exp
++    return -1
++}
++
++# Get things started.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++gdb_run_cmd
++
++set test "trap stop"
++gdb_test_multiple "" $test {
++    -re "Program received signal SIGTRAP,.*_start .*$gdb_prompt $" {
++	pass $test
++    }
++}
++
++gdb_test "stepi" ".*_start .*int3.*"
++
++gdb_test "x/x \$esp" "0x\[0-9a-f\]*:\t0x0*1"
++
++# Failure case would be:
++# 	0xff8d7f00:     Cannot access memory at address 0xff8d7f00
++gdb_test "x/x \$ebx" "0x\[0-9a-f\]*:\t0x0*1"

gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch:

Index: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch	16 Nov 2007 02:15:40 -0000	1.4
+++ gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch	3 Mar 2008 16:13:47 -0000	1.5
@@ -1,5 +1,8 @@
 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337
 
+2008-02-24  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
 
 currently for trivial nonthreaded helloworld with no debug info up to -ggdb2 you
 will get:
@@ -27,9 +30,11 @@
   <81a2>     DW_AT_name        : (indirect string, offset: 0x280e): __errno_location
   <81a8>     DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location
 
---- ./gdb/dwarf2read.c	25 Oct 2007 20:54:27 -0000	1.236
-+++ ./gdb/dwarf2read.c	3 Nov 2007 21:03:43 -0000
-@@ -5550,8 +5550,8 @@ read_partial_die (struct partial_die_inf
+Index: gdb-6.8cvs20080219/gdb/dwarf2read.c
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/dwarf2read.c	2008-02-19 17:27:21.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/dwarf2read.c	2008-02-20 13:35:19.000000000 +0100
+@@ -5679,8 +5679,8 @@ read_partial_die (struct partial_die_inf
  	{
  	case DW_AT_name:
  
@@ -40,7 +45,7 @@
  	    part_die->name = DW_STRING (&attr);
  	  break;
  	case DW_AT_comp_dir:
-@@ -5559,7 +5559,9 @@ read_partial_die (struct partial_die_inf
+@@ -5688,7 +5688,9 @@ read_partial_die (struct partial_die_inf
  	    part_die->dirname = DW_STRING (&attr);
  	  break;
  	case DW_AT_MIPS_linkage_name:
@@ -51,7 +56,7 @@
  	  break;
  	case DW_AT_low_pc:
  	  has_low_pc_attr = 1;
-@@ -7871,9 +7873,13 @@ dwarf2_linkage_name (struct die_info *di
+@@ -7936,9 +7938,13 @@ dwarf2_linkage_name (struct die_info *di
  {
    struct attribute *attr;
  
@@ -68,22 +73,20 @@
    attr = dwarf2_attr (die, DW_AT_name, cu);
    if (attr && DW_STRING (attr))
      return DW_STRING (attr);
-
-
-
-diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/gdbtypes.c gdb-6.7.1-patched/gdb/gdbtypes.c
---- gdb-6.7.1/gdb/gdbtypes.c	2007-11-04 01:43:03.000000000 +0100
-+++ gdb-6.7.1-patched/gdb/gdbtypes.c	2007-11-04 01:09:31.000000000 +0100
-@@ -3465,6 +3465,8 @@ gdbtypes_post_init (struct gdbarch *gdba
+Index: gdb-6.8cvs20080219/gdb/gdbtypes.c
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/gdbtypes.c	2008-02-14 23:03:57.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/gdbtypes.c	2008-02-20 13:35:19.000000000 +0100
+@@ -3106,6 +3106,8 @@ gdbtypes_post_init (struct gdbarch *gdba
      init_type (TYPE_CODE_INT, 
- 	       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+ 	       gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
  	       0, "int", (struct objfile *) NULL);
 +  builtin_type->builtin_int_ptr =
 +    make_pointer_type (builtin_type->builtin_int, NULL);
    builtin_type->builtin_unsigned_int =
      init_type (TYPE_CODE_INT, 
- 	       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
-@@ -3559,6 +3561,11 @@ gdbtypes_post_init (struct gdbarch *gdba
+ 	       gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
+@@ -3215,6 +3217,11 @@ gdbtypes_post_init (struct gdbarch *gdba
  	       "<text variable, no debug info>", NULL);
    TYPE_TARGET_TYPE (builtin_type->nodebug_text_symbol) =
      builtin_type->builtin_int;
@@ -95,10 +98,11 @@
    builtin_type->nodebug_data_symbol =
      init_type (TYPE_CODE_INT, 
  	       gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT, 0,
-diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/gdbtypes.h gdb-6.7.1-patched/gdb/gdbtypes.h
---- gdb-6.7.1/gdb/gdbtypes.h	2007-11-04 01:43:03.000000000 +0100
-+++ gdb-6.7.1-patched/gdb/gdbtypes.h	2007-11-04 01:07:50.000000000 +0100
-@@ -1008,6 +1008,7 @@ struct builtin_type
+Index: gdb-6.8cvs20080219/gdb/gdbtypes.h
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/gdbtypes.h	2008-02-14 23:03:57.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/gdbtypes.h	2008-02-20 13:35:19.000000000 +0100
+@@ -942,6 +942,7 @@ struct builtin_type
  
    /* Types used for symbols with no debug information.  */
    struct type *nodebug_text_symbol;
@@ -106,7 +110,7 @@
    struct type *nodebug_data_symbol;
    struct type *nodebug_unknown_symbol;
    struct type *nodebug_tls_symbol;
-@@ -1026,6 +1027,7 @@ struct builtin_type
+@@ -960,6 +961,7 @@ struct builtin_type
    struct type *builtin_char;
    struct type *builtin_short;
    struct type *builtin_int;
@@ -114,10 +118,11 @@
    struct type *builtin_long;
    struct type *builtin_signed_char;
    struct type *builtin_unsigned_char;
-diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/parse.c gdb-6.7.1-patched/gdb/parse.c
---- gdb-6.7.1/gdb/parse.c	2007-08-23 20:08:36.000000000 +0200
-+++ gdb-6.7.1-patched/gdb/parse.c	2007-11-04 01:06:59.000000000 +0100
-@@ -424,7 +424,12 @@ write_exp_msymbol (struct minimal_symbol
+Index: gdb-6.8cvs20080219/gdb/parse.c
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/parse.c	2008-01-02 00:04:03.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/parse.c	2008-02-20 13:35:19.000000000 +0100
+@@ -437,7 +437,12 @@ write_exp_msymbol (struct minimal_symbol
      case mst_text:
      case mst_file_text:
      case mst_solib_trampoline:
@@ -131,10 +136,11 @@
        break;
  
      case mst_data:
-diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/target.c gdb-6.7.1-patched/gdb/target.c
---- gdb-6.7.1/gdb/target.c	2007-11-04 01:43:03.000000000 +0100
-+++ gdb-6.7.1-patched/gdb/target.c	2007-11-04 01:37:45.000000000 +0100
-@@ -819,6 +819,25 @@ pop_target (void)
+Index: gdb-6.8cvs20080219/gdb/target.c
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/target.c	2008-02-19 17:22:33.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/target.c	2008-02-20 13:36:17.000000000 +0100
+@@ -812,6 +812,25 @@ pop_target (void)
    internal_error (__FILE__, __LINE__, _("failed internal consistency check"));
  }
  
@@ -157,10 +163,10 @@
 +  return 1;
 +}
 +
- /* Using the objfile specified in BATON, find the address for the
+ /* Using the objfile specified in OBJFILE, find the address for the
     current thread's thread-local storage with offset OFFSET.  */
  CORE_ADDR
-@@ -904,7 +923,28 @@ target_translate_tls_address (struct obj
+@@ -893,7 +912,28 @@ target_translate_tls_address (struct obj
    /* It wouldn't be wrong here to try a gdbarch method, too; finding
       TLS is an ABI-specific thing.  But we don't do that yet.  */
    else
@@ -190,9 +196,10 @@
  
    return addr;
  }
-diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/testsuite/gdb.dwarf2/dw2-errno.c gdb-6.7.1-patched/gdb/testsuite/gdb.dwarf2/dw2-errno.c
---- gdb-6.7.1/gdb/testsuite/gdb.dwarf2/dw2-errno.c	2007-11-04 01:43:41.000000000 +0100
-+++ gdb-6.7.1-patched/gdb/testsuite/gdb.dwarf2/dw2-errno.c	2007-11-03 23:29:02.000000000 +0100
+Index: gdb-6.8cvs20080219/gdb/testsuite/gdb.dwarf2/dw2-errno.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8cvs20080219/gdb/testsuite/gdb.dwarf2/dw2-errno.c	2008-02-20 13:35:19.000000000 +0100
 @@ -0,0 +1,28 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
@@ -222,9 +229,10 @@
 +
 +  return 0;	/* breakpoint */
 +}
-diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1/gdb/testsuite/gdb.dwarf2/dw2-errno.exp gdb-6.7.1-patched/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
---- gdb-6.7.1/gdb/testsuite/gdb.dwarf2/dw2-errno.exp	2007-11-04 01:43:39.000000000 +0100
-+++ gdb-6.7.1-patched/gdb/testsuite/gdb.dwarf2/dw2-errno.exp	2007-11-04 01:41:46.000000000 +0100
+Index: gdb-6.8cvs20080219/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8cvs20080219/gdb/testsuite/gdb.dwarf2/dw2-errno.exp	2008-02-20 13:35:19.000000000 +0100
 @@ -0,0 +1,67 @@
 +# Copyright 2007 Free Software Foundation, Inc.
 +

gdb-6.5-gcore-i386-on-amd64.patch:

Index: gdb-6.5-gcore-i386-on-amd64.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.5-gcore-i386-on-amd64.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- gdb-6.5-gcore-i386-on-amd64.patch	1 Nov 2007 20:24:20 -0000	1.3
+++ gdb-6.5-gcore-i386-on-amd64.patch	3 Mar 2008 16:13:47 -0000	1.4
@@ -19,11 +19,15 @@
 
 	Port to GDB-6.7.
 
-Index: gdb-6.7/gdb/Makefile.in
+2008-02-24  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
+
+Index: gdb-6.8cvs20080219/gdb/Makefile.in
 ===================================================================
---- gdb-6.7.orig/gdb/Makefile.in	2007-10-14 23:57:38.000000000 +0200
-+++ gdb-6.7/gdb/Makefile.in	2007-10-16 15:46:48.000000000 +0200
-@@ -717,6 +717,7 @@ gdb_expat_h = gdb_expat.h
+--- gdb-6.8cvs20080219.orig/gdb/Makefile.in	2008-02-19 16:52:21.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/Makefile.in	2008-02-20 13:39:08.000000000 +0100
+@@ -785,6 +785,7 @@ gdb_expat_h = gdb_expat.h
  gdb_locale_h = gdb_locale.h
  gdb_obstack_h = gdb_obstack.h $(obstack_h)
  gdb_proc_service_h = gdb_proc_service.h $(gregset_h)
@@ -31,7 +35,7 @@
  gdb_ptrace_h = gdb_ptrace.h
  gdb_regex_h = gdb_regex.h $(xregex_h)
  gdb_select_h = gdb_select.h
-@@ -726,6 +727,7 @@ gdb_string_h = gdb_string.h
+@@ -794,6 +795,7 @@ gdb_string_h = gdb_string.h
  gdb_thread_db_h = gdb_thread_db.h
  gdbthread_h = gdbthread.h $(breakpoint_h) $(frame_h)
  gdbtypes_h = gdbtypes.h $(hashtab_h)
@@ -39,7 +43,7 @@
  gdb_vfork_h = gdb_vfork.h
  gdb_wait_h = gdb_wait.h
  glibc_tdep_h = glibc-tdep.h
-@@ -1793,7 +1795,8 @@ amd64fbsd-tdep.o: amd64fbsd-tdep.c $(def
+@@ -1888,7 +1890,8 @@ amd64fbsd-tdep.o: amd64fbsd-tdep.c $(def
  amd64-linux-nat.o: amd64-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
  	$(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \
  	$(gdb_proc_service_h) $(gregset_h) $(amd64_tdep_h) \
@@ -49,11 +53,11 @@
  amd64-linux-tdep.o: amd64-linux-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \
  	$(regcache_h) $(osabi_h) $(symtab_h) $(gdb_string_h) $(amd64_tdep_h) \
  	$(solib_svr4_h) $(gdbtypes_h) $(reggroups_h) $(amd64_linux_tdep_h)
-Index: gdb-6.7/gdb/amd64-linux-nat.c
+Index: gdb-6.8cvs20080219/gdb/amd64-linux-nat.c
 ===================================================================
---- gdb-6.7.orig/gdb/amd64-linux-nat.c	2007-10-14 23:39:04.000000000 +0200
-+++ gdb-6.7/gdb/amd64-linux-nat.c	2007-10-16 15:46:18.000000000 +0200
-@@ -51,6 +51,9 @@
+--- gdb-6.8cvs20080219.orig/gdb/amd64-linux-nat.c	2008-02-16 19:10:27.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/amd64-linux-nat.c	2008-02-20 13:39:08.000000000 +0100
+@@ -50,6 +50,9 @@
  #include "amd64-tdep.h"
  #include "i386-linux-tdep.h"
  #include "amd64-nat.h"
@@ -63,7 +67,7 @@
  
  /* Mapping between the general-purpose registers in GNU/Linux x86-64
     `struct user' format and GDB's register cache layout.  */
-@@ -85,6 +88,35 @@ static int amd64_linux_gregset64_reg_off
+@@ -84,6 +87,35 @@ static int amd64_linux_gregset64_reg_off
     GNU/Linux i386 registers are all 32-bit, but since we're
     little-endian we get away with that.  */
  
@@ -99,7 +103,7 @@
  /* From <sys/reg.h> on GNU/Linux i386.  */
  static int amd64_linux_gregset32_reg_offset[] =
  {
-@@ -103,6 +135,96 @@ static int amd64_linux_gregset32_reg_off
+@@ -102,6 +134,96 @@ static int amd64_linux_gregset32_reg_off
  };
  
  
@@ -196,7 +200,7 @@
  /* Transfering the general-purpose registers between GDB, inferiors
     and core files.  */
  
-@@ -529,6 +649,11 @@ _initialize_amd64_linux_nat (void)
+@@ -429,6 +551,11 @@ _initialize_amd64_linux_nat (void)
    t->to_fetch_registers = amd64_linux_fetch_inferior_registers;
    t->to_store_registers = amd64_linux_store_inferior_registers;
  
@@ -207,11 +211,11 @@
 +
    /* Register the target.  */
    linux_nat_add_target (t);
- 
-Index: gdb-6.7/gdb/config.in
+   linux_nat_set_new_thread (t, amd64_linux_new_thread);
+Index: gdb-6.8cvs20080219/gdb/config.in
 ===================================================================
---- gdb-6.7.orig/gdb/config.in	2007-06-18 17:46:37.000000000 +0200
-+++ gdb-6.7/gdb/config.in	2007-10-16 15:46:18.000000000 +0200
+--- gdb-6.8cvs20080219.orig/gdb/config.in	2008-01-10 19:17:06.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/config.in	2008-02-20 13:39:08.000000000 +0100
 @@ -385,6 +385,9 @@
  /* Define to 1 if you have the <sys/poll.h> header file. */
  #undef HAVE_SYS_POLL_H
@@ -232,11 +236,11 @@
  /* Define to 1 if you have the <sys/user.h> header file. */
  #undef HAVE_SYS_USER_H
  
-Index: gdb-6.7/gdb/configure
+Index: gdb-6.8cvs20080219/gdb/configure
 ===================================================================
---- gdb-6.7.orig/gdb/configure	2007-09-29 22:54:13.000000000 +0200
-+++ gdb-6.7/gdb/configure	2007-10-16 15:46:18.000000000 +0200
-@@ -10439,6 +10439,157 @@ done
+--- gdb-6.8cvs20080219.orig/gdb/configure	2008-02-14 23:03:56.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/configure	2008-02-20 13:39:08.000000000 +0100
+@@ -11140,6 +11140,157 @@ done
  
  
  
@@ -394,11 +398,11 @@
  for ac_header in sys/wait.h wait.h
  do
  as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-Index: gdb-6.7/gdb/configure.ac
+Index: gdb-6.8cvs20080219/gdb/configure.ac
 ===================================================================
---- gdb-6.7.orig/gdb/configure.ac	2007-09-29 22:54:13.000000000 +0200
-+++ gdb-6.7/gdb/configure.ac	2007-10-16 15:46:18.000000000 +0200
-@@ -424,6 +424,7 @@ AC_CHECK_HEADERS(sys/user.h, [], [],
+--- gdb-6.8cvs20080219.orig/gdb/configure.ac	2008-02-14 23:03:56.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/configure.ac	2008-02-20 13:39:08.000000000 +0100
+@@ -523,6 +523,7 @@ AC_CHECK_HEADERS(sys/user.h, [], [],
  # include <sys/param.h>
  #endif
  ])
@@ -406,10 +410,10 @@
  AC_CHECK_HEADERS(sys/wait.h wait.h)
  AC_CHECK_HEADERS(termios.h termio.h sgtty.h)
  AC_CHECK_HEADERS(unistd.h)
-Index: gdb-6.7/gdb/gcore.c
+Index: gdb-6.8cvs20080219/gdb/gcore.c
 ===================================================================
---- gdb-6.7.orig/gdb/gcore.c	2007-10-14 23:57:38.000000000 +0200
-+++ gdb-6.7/gdb/gcore.c	2007-10-16 15:46:18.000000000 +0200
+--- gdb-6.8cvs20080219.orig/gdb/gcore.c	2008-02-19 16:52:21.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/gcore.c	2008-02-20 13:39:08.000000000 +0100
 @@ -317,6 +317,11 @@ gcore_create_callback (CORE_ADDR vaddr, 
    asection *osec;
    flagword flags = SEC_ALLOC | SEC_HAS_CONTENTS | SEC_LOAD;
@@ -422,10 +426,10 @@
    /* If the memory segment has no permissions set, ignore it, otherwise
       when we later try to access it for read/write, we'll get an error
       or jam the kernel.  */
-Index: gdb-6.7/gdb/gdb_procfs32.h
+Index: gdb-6.8cvs20080219/gdb/gdb_procfs32.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.7/gdb/gdb_procfs32.h	2007-10-16 15:46:18.000000000 +0200
++++ gdb-6.8cvs20080219/gdb/gdb_procfs32.h	2008-02-20 13:39:08.000000000 +0100
 @@ -0,0 +1,128 @@
 +#ifdef HAVE_SYS_PROCFS32_H
 +#include <sys/procfs32.h>
@@ -555,10 +559,10 @@
 +#endif	/* _SYS_PROCFS32_H */
 +
 +#endif /* HAVE_SYS_PROCFS32_H */
-Index: gdb-6.7/gdb/gdb_user32.h
+Index: gdb-6.8cvs20080219/gdb/gdb_user32.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.7/gdb/gdb_user32.h	2007-10-16 15:46:18.000000000 +0200
++++ gdb-6.8cvs20080219/gdb/gdb_user32.h	2008-02-20 13:39:08.000000000 +0100
 @@ -0,0 +1,108 @@
 +#ifdef HAVE_SYS_USER32_H
 +#include <sys/user32.h>
@@ -668,11 +672,11 @@
 +#endif	/* _SYS_USER32_H */
 +
 +#endif /* HAVE_SYS_USER32_H */
-Index: gdb-6.7/gdb/linux-nat.c
+Index: gdb-6.8cvs20080219/gdb/linux-nat.c
 ===================================================================
---- gdb-6.7.orig/gdb/linux-nat.c	2007-10-15 21:42:26.000000000 +0200
-+++ gdb-6.7/gdb/linux-nat.c	2007-10-16 15:46:18.000000000 +0200
-@@ -98,6 +98,21 @@ static LONGEST (*super_xfer_partial) (st
+--- gdb-6.8cvs20080219.orig/gdb/linux-nat.c	2008-02-19 17:27:21.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/linux-nat.c	2008-02-20 13:39:08.000000000 +0100
+@@ -104,6 +104,21 @@ static LONGEST (*super_xfer_partial) (st
  				      const gdb_byte *,
  				      ULONGEST, LONGEST);
  
@@ -694,7 +698,7 @@
  static int debug_linux_nat;
  static void
  show_debug_linux_nat (struct ui_file *file, int from_tty,
-@@ -2687,11 +2696,11 @@ linux_nat_do_thread_registers (bfd *obfd
+@@ -2716,11 +2731,11 @@ linux_nat_do_thread_registers (bfd *obfd
    else
      fill_gregset (regcache, &gregs, -1);
  
@@ -711,7 +715,7 @@
  
    if (core_regset_p
        && (regset = gdbarch_regset_from_core_section (gdbarch, ".reg2",
-@@ -2702,10 +2711,11 @@ linux_nat_do_thread_registers (bfd *obfd
+@@ -2731,10 +2746,11 @@ linux_nat_do_thread_registers (bfd *obfd
    else
      fill_fpregset (regcache, &fpregs, -1);
  
@@ -727,7 +731,7 @@
  
  #ifdef FILL_FPXREGSET
    if (core_regset_p
-@@ -2799,9 +2808,9 @@ linux_nat_make_corefile_notes (bfd *obfd
+@@ -2828,9 +2844,9 @@ linux_nat_make_corefile_notes (bfd *obfd
  		       psargs_end - string_end);
  	    }
  	}
@@ -740,16 +744,16 @@
      }
  
    /* Dump information for threads.  */
-Index: gdb-6.7/gdb/linux-nat.h
+Index: gdb-6.8cvs20080219/gdb/linux-nat.h
 ===================================================================
---- gdb-6.7.orig/gdb/linux-nat.h	2007-10-13 05:09:50.000000000 +0200
-+++ gdb-6.7/gdb/linux-nat.h	2007-10-16 15:46:18.000000000 +0200
-@@ -110,3 +110,12 @@ void linux_nat_add_target (struct target
- /* Update linux-nat internal state when changing from one fork
-    to another.  */
- void linux_nat_switch_fork (ptid_t new_ptid);
+--- gdb-6.8cvs20080219.orig/gdb/linux-nat.h	2008-02-19 14:26:32.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/linux-nat.h	2008-02-20 13:39:37.000000000 +0100
+@@ -124,3 +124,12 @@ void linux_nat_switch_fork (ptid_t new_p
+ 
+ /* Return the saved siginfo associated with PTID.  */
+ struct siginfo *linux_nat_get_siginfo (ptid_t ptid);
 +
-+/* This functions make elfcore note sections.
++/* These functions make elfcore note sections.
 +   They may get overriden by code adjusting data for multi-target builds.  */
 +extern char *(*linux_elfcore_write_prpsinfo)
 +  (bfd *, char *, int *, const char *, const char *);

gdb-6.5-sharedlibrary-path.patch:

Index: gdb-6.5-sharedlibrary-path.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.5-sharedlibrary-path.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- gdb-6.5-sharedlibrary-path.patch	1 Nov 2007 20:24:20 -0000	1.2
+++ gdb-6.5-sharedlibrary-path.patch	3 Mar 2008 16:13:47 -0000	1.3
@@ -16,17 +16,21 @@
 
 	Port to GDB-6.7.
 
-Index: gdb-6.7/gdb/solib-svr4.c
+2008-02-27  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to gdb-6.7.50.20080227.
+
+Index: gdb-6.7.50.20080227/gdb/solib-svr4.c
 ===================================================================
---- gdb-6.7.orig/gdb/solib-svr4.c	2007-10-14 23:04:45.000000000 +0200
-+++ gdb-6.7/gdb/solib-svr4.c	2007-10-16 15:43:56.000000000 +0200
-@@ -1009,10 +1009,14 @@ CORE_ADDR
+--- gdb-6.7.50.20080227.orig/gdb/solib-svr4.c	2008-02-27 08:59:06.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/solib-svr4.c	2008-02-27 09:00:44.000000000 +0100
+@@ -1017,10 +1017,14 @@ CORE_ADDR
  svr4_fetch_objfile_link_map (struct objfile *objfile)
  {
    CORE_ADDR lm;
 +  int resolve;
  
-   if ((debug_base = locate_base ()) == 0)
+   if (locate_base () == 0)
      return 0;   /* failed somehow... */
  
 +for (resolve = 0; resolve <= 1; resolve++)
@@ -35,7 +39,7 @@
    /* Position ourselves on the first link map.  */
    lm = solib_svr4_r_map ();  
    while (lm)
-@@ -1051,6 +1055,21 @@ svr4_fetch_objfile_link_map (struct objf
+@@ -1059,6 +1063,21 @@ svr4_fetch_objfile_link_map (struct objf
  		 safe_strerror (errcode));
        else
    	{
@@ -57,7 +61,7 @@
  	  /* Is this the linkmap for the file we want?  */
  	  /* If the file is not a shared library and has no name,
  	     we are sure it is the main executable, so we return that.  */
-@@ -1069,6 +1088,9 @@ svr4_fetch_objfile_link_map (struct objf
+@@ -1077,6 +1096,9 @@ svr4_fetch_objfile_link_map (struct objf
  				  builtin_type_void_data_ptr);
        do_cleanups (old_chain);
      }
@@ -67,10 +71,10 @@
    return 0;
  }
  
-Index: gdb-6.7/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
+Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.7/gdb/testsuite/gdb.threads/tls-sepdebug-main.c	2007-10-16 15:40:01.000000000 +0200
++++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-main.c	2008-02-27 09:00:15.000000000 +0100
 @@ -0,0 +1,25 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
@@ -97,10 +101,10 @@
 +{
 +  return 0;
 +}
-Index: gdb-6.7/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
+Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.7/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c	2007-10-16 15:40:01.000000000 +0200
++++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c	2008-02-27 09:00:15.000000000 +0100
 @@ -0,0 +1,22 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
@@ -124,10 +128,10 @@
 +   bug-gdb at prep.ai.mit.edu  */
 +
 +__thread int var = 42;
-Index: gdb-6.7/gdb/testsuite/gdb.threads/tls-sepdebug.exp
+Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug.exp
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ gdb-6.7/gdb/testsuite/gdb.threads/tls-sepdebug.exp	2007-10-16 15:40:01.000000000 +0200
++++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug.exp	2008-02-27 09:00:15.000000000 +0100
 @@ -0,0 +1,81 @@
 +# Copyright 2006 Free Software Foundation, Inc.
 +

gdb-6.6-buildid-locate.patch:

Index: gdb-6.6-buildid-locate.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.6-buildid-locate.patch,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- gdb-6.6-buildid-locate.patch	21 Feb 2008 21:41:59 -0000	1.8
+++ gdb-6.6-buildid-locate.patch	3 Mar 2008 16:13:47 -0000	1.9
@@ -18,11 +18,16 @@
 	Provide its level 0 to disable the build-id messages.
 	Resolve the RH Bug 432164.
 
-diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1-unpatched/gdb/Makefile.in gdb-6.7.1-patched/gdb/Makefile.in
---- gdb-6.7.1-unpatched/gdb/Makefile.in	2008-02-21 05:01:55.000000000 +0100
-+++ gdb-6.7.1-patched/gdb/Makefile.in	2008-02-21 04:58:13.000000000 +0100
-@@ -387,7 +387,7 @@ INSTALLED_LIBS=-lbfd -lreadline -lopcode
- CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(INTL) $(LIBIBERTY) \
+2008-02-24  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
+
+Index: gdb-6.7.50.20080227/gdb/Makefile.in
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/Makefile.in	2008-03-01 10:30:49.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/Makefile.in	2008-03-01 10:38:01.000000000 +0100
+@@ -392,7 +392,7 @@ INSTALLED_LIBS=-lbfd -lreadline -lopcode
+ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(INTL) $(LIBIBERTY) $(LIBDECNUMBER) \
  	$(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \
  	$(LIBICONV) $(LIBEXPAT) \
 -	$(LIBIBERTY) $(WIN32LIBS)
@@ -30,33 +35,34 @@
  CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \
  	$(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS)
  
-@@ -1932,7 +1932,8 @@ corelow.o: corelow.c $(defs_h) $(arch_ut
+@@ -2029,7 +2029,8 @@ corelow.o: corelow.c $(defs_h) $(arch_ut
  	$(inferior_h) $(symtab_h) $(command_h) $(bfd_h) $(target_h) \
  	$(gdbcore_h) $(gdbthread_h) $(regcache_h) $(regset_h) $(symfile_h) \
  	$(exec_h) $(readline_h) $(gdb_assert_h) \
--	$(exceptions_h) $(solib_h)
-+	$(exceptions_h) $(solib_h) $(auxv_h) $(elf_common_h) $(objfiles_h) \
-+	$(gdbcmd_h)
+-	$(exceptions_h) $(solib_h) $(filenames_h)
++	$(exceptions_h) $(solib_h) $(filenames_h) $(auxv_h) $(elf_common_h) \
++	$(objfiles_h) $(gdbcmd_h)
  core-regset.o: core-regset.c $(defs_h) $(command_h) $(gdbcore_h) \
  	$(inferior_h) $(target_h) $(regcache_h) $(gdb_string_h) $(gregset_h)
  cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(command_h) $(gdbcmd_h) \
-@@ -2768,7 +2769,8 @@ symfile.o: symfile.c $(defs_h) $(bfdlink
+@@ -2884,7 +2885,8 @@ symfile.o: symfile.c $(defs_h) $(bfdlink
  	$(gdb_stabs_h) $(gdb_obstack_h) $(completer_h) $(bcache_h) \
  	$(hashtab_h) $(readline_h) $(gdb_assert_h) $(block_h) \
  	$(gdb_string_h) $(gdb_stat_h) $(observer_h) $(exec_h) \
--	$(parser_defs_h) $(varobj_h) $(elf_bfd_h)
-+	$(parser_defs_h) $(varobj_h) $(elf_bfd_h) $(gdb_stdint_h) $(libbfd_h) \
-+	$(elf_bfd_h) $(elf_external_h)
+-	$(parser_defs_h) $(varobj_h) $(elf_bfd_h) $(solib_h)
++	$(parser_defs_h) $(varobj_h) $(elf_bfd_h) $(solib_h) $(gdb_stdint_h) \
++	$(libbfd_h) $(elf_bfd_h) $(elf_external_h)
  symfile-mem.o: symfile-mem.c $(defs_h) $(symtab_h) $(gdbcore_h) \
  	$(objfiles_h) $(exceptions_h) $(gdbcmd_h) $(target_h) $(value_h) \
  	$(symfile_h) $(observer_h) $(auxv_h) $(elf_common_h)
-diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1-unpatched/gdb/corelow.c gdb-6.7.1-patched/gdb/corelow.c
---- gdb-6.7.1-unpatched/gdb/corelow.c	2008-02-21 05:01:55.000000000 +0100
-+++ gdb-6.7.1-patched/gdb/corelow.c	2008-02-21 04:58:13.000000000 +0100
-@@ -44,6 +44,10 @@
- #include "gdb_assert.h"
+Index: gdb-6.7.50.20080227/gdb/corelow.c
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/corelow.c	2008-02-09 14:45:33.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/corelow.c	2008-03-01 10:30:50.000000000 +0100
+@@ -45,6 +45,10 @@
  #include "exceptions.h"
  #include "solib.h"
+ #include "filenames.h"
 +#include "auxv.h"
 +#include "elf/common.h"
 +#include "objfiles.h"
@@ -64,7 +70,7 @@
  
  
  #ifndef O_LARGEFILE
-@@ -251,6 +255,56 @@ add_to_thread_list (bfd *abfd, asection 
+@@ -248,6 +252,56 @@ add_to_thread_list (bfd *abfd, asection 
      inferior_ptid = pid_to_ptid (thread_id);	/* Yes, make it current */
  }
  
@@ -121,7 +127,7 @@
  /* This routine opens and sets up the core file bfd.  */
  
  static void
-@@ -347,6 +401,15 @@ core_open (char *filename, int from_tty)
+@@ -344,6 +398,15 @@ core_open (char *filename, int from_tty)
    ontop = !push_target (&core_ops);
    discard_cleanups (old_chain);
  
@@ -137,7 +143,7 @@
    /* This is done first, before anything has a chance to query the
       inferior for information such as symbols.  */
    post_create_inferior (&core_ops, from_tty);
-@@ -678,4 +741,11 @@ _initialize_corelow (void)
+@@ -692,4 +755,11 @@ _initialize_corelow (void)
  
    if (!coreops_suppress_target)
      add_target (&core_ops);
@@ -149,10 +155,11 @@
 +			   NULL, NULL, NULL,
 +			   &setlist, &showlist);
  }
-diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1-unpatched/gdb/doc/gdb.texinfo gdb-6.7.1-patched/gdb/doc/gdb.texinfo
---- gdb-6.7.1-unpatched/gdb/doc/gdb.texinfo	2008-02-21 05:00:36.000000000 +0100
-+++ gdb-6.7.1-patched/gdb/doc/gdb.texinfo	2008-02-21 04:59:10.000000000 +0100
-@@ -12074,6 +12074,27 @@ information files.
+Index: gdb-6.7.50.20080227/gdb/doc/gdb.texinfo
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/doc/gdb.texinfo	2008-03-01 10:30:50.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/doc/gdb.texinfo	2008-03-01 10:38:02.000000000 +0100
+@@ -12208,6 +12208,27 @@ information files.
  
  @end table
  
@@ -180,10 +187,11 @@
  @cindex @code{.gnu_debuglink} sections
  @cindex debug link sections
  A debug link is a special section of the executable file named
-diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1-unpatched/gdb/solib-svr4.c gdb-6.7.1-patched/gdb/solib-svr4.c
---- gdb-6.7.1-unpatched/gdb/solib-svr4.c	2008-02-21 05:01:55.000000000 +0100
-+++ gdb-6.7.1-patched/gdb/solib-svr4.c	2008-02-21 04:58:13.000000000 +0100
-@@ -960,9 +960,34 @@ svr4_current_sos (void)
+Index: gdb-6.7.50.20080227/gdb/solib-svr4.c
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/solib-svr4.c	2008-03-01 10:30:48.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/solib-svr4.c	2008-03-01 10:30:50.000000000 +0100
+@@ -967,9 +967,34 @@ svr4_current_sos (void)
  		free_so (new);
  	      else
  		{
@@ -221,20 +229,21 @@
  		  if (debug_solib)
  		    {
  		      fprintf_unfiltered (gdb_stdlog, 
-diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1-unpatched/gdb/symfile.c gdb-6.7.1-patched/gdb/symfile.c
---- gdb-6.7.1-unpatched/gdb/symfile.c	2008-02-21 05:02:16.000000000 +0100
-+++ gdb-6.7.1-patched/gdb/symfile.c	2008-02-21 04:59:10.000000000 +0100
-@@ -53,6 +53,9 @@
- #include "parser-defs.h"
+Index: gdb-6.7.50.20080227/gdb/symfile.c
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/symfile.c	2008-03-01 10:30:48.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/symfile.c	2008-03-01 10:47:02.000000000 +0100
+@@ -54,6 +54,9 @@
  #include "varobj.h"
  #include "elf-bfd.h"
+ #include "solib.h"
 +#include "gdb_stdint.h"
 +#include "libbfd.h"
 +#include "elf/external.h"
  
  #include <sys/types.h>
  #include <fcntl.h>
-@@ -61,6 +64,7 @@
+@@ -62,6 +65,7 @@
  #include <ctype.h>
  #include <time.h>
  #include <sys/time.h>
@@ -242,7 +251,7 @@
  
  
  int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num);
-@@ -1262,16 +1266,65 @@ symbol_file_clear (int from_tty)
+@@ -1235,16 +1239,65 @@ symbol_file_clear (int from_tty)
        printf_unfiltered (_("No symbol file now.\n"));
  }
  
@@ -310,7 +319,7 @@
  {
    struct build_id *retval;
  
-@@ -1287,6 +1340,348 @@ build_id_bfd_get (bfd *abfd)
+@@ -1260,6 +1313,348 @@ build_id_bfd_get (bfd *abfd)
    return retval;
  }
  
@@ -659,7 +668,7 @@
  /* Return if FILENAME has NT_GNU_BUILD_ID matching the CHECK value.  */
  
  static int
-@@ -1301,7 +1696,7 @@ build_id_verify (const char *filename, s
+@@ -1274,7 +1669,7 @@ build_id_verify (const char *filename, s
    if (abfd == NULL)
      return 0;
  
@@ -668,7 +677,7 @@
  
    if (found == NULL)
      warning (_("File \"%s\" has no build-id, file skipped"), filename);
-@@ -1317,8 +1712,9 @@ build_id_verify (const char *filename, s
+@@ -1290,8 +1685,9 @@ build_id_verify (const char *filename, s
    return retval;
  }
  
@@ -680,7 +689,7 @@
  {
    char *link, *s, *retval = NULL;
    gdb_byte *data = build_id->data;
-@@ -1326,7 +1722,9 @@ build_id_to_debug_filename (struct build
+@@ -1299,7 +1695,9 @@ build_id_to_debug_filename (struct build
  
    /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */
    link = xmalloc (strlen (debug_file_directory) + (sizeof "/.build-id/" - 1) + 1
@@ -691,7 +700,7 @@
    s = link + sprintf (link, "%s/.build-id/", debug_file_directory);
    if (size > 0)
      {
-@@ -1337,12 +1735,14 @@ build_id_to_debug_filename (struct build
+@@ -1310,12 +1708,14 @@ build_id_to_debug_filename (struct build
      *s++ = '/';
    while (size-- > 0)
      s += sprintf (s, "%02x", (unsigned) *data++);
@@ -708,7 +717,7 @@
  
    if (retval != NULL && !build_id_verify (retval, build_id))
      {
-@@ -1350,9 +1750,202 @@ build_id_to_debug_filename (struct build
+@@ -1323,9 +1723,202 @@ build_id_to_debug_filename (struct build
        retval = NULL;
      }
  
@@ -911,7 +920,20 @@
  static char *
  get_debug_link_info (struct objfile *objfile, unsigned long *crc32_out)
  {
-@@ -1447,23 +2040,27 @@ find_separate_debug_file (struct objfile
+@@ -1411,32 +2004,36 @@ static char *
+ find_separate_debug_file (struct objfile *objfile)
+ {
+   asection *sect;
+-  char *basename;
+-  char *dir;
+-  char *debugfile;
++  char *basename = NULL;
++  char *dir = NULL;
++  char *debugfile = NULL;
+   char *name_copy;
+-  char *canon_name;
++  char *canon_name = NULL;
+   bfd_size_type debuglink_size;
    unsigned long crc32;
    int i;
    struct build_id *build_id;
@@ -944,64 +966,103 @@
      }
  
    basename = get_debug_link_info (objfile, &crc32);
-@@ -1471,7 +2068,10 @@ find_separate_debug_file (struct objfile
+@@ -1444,7 +2041,7 @@ find_separate_debug_file (struct objfile
    if (basename == NULL)
      /* There's no separate debug info, hence there's no way we could
         load it => no warning.  */
 -    return NULL;
-+    {
-+      xfree (build_id_filename);
-+      return NULL;
-+    }
++    goto cleanup_return_debugfile;
  
    dir = xstrdup (objfile->name);
  
-@@ -1500,6 +2100,7 @@ find_separate_debug_file (struct objfile
+@@ -1460,23 +2057,19 @@ find_separate_debug_file (struct objfile
+   gdb_assert (i >= 0 && IS_DIR_SEPARATOR (dir[i]));
+   dir[i+1] = '\0';
+ 
+-  debugfile = alloca (strlen (debug_file_directory) + 1
+-                      + strlen (dir)
+-                      + strlen (DEBUG_SUBDIRECTORY)
+-                      + strlen ("/")
+-                      + strlen (basename)
+-                      + 1);
++  debugfile = xmalloc (strlen (debug_file_directory) + 1
++		       + strlen (dir)
++		       + strlen (DEBUG_SUBDIRECTORY)
++		       + strlen ("/")
++		       + strlen (basename)
++		       + 1);
+ 
+   /* First try in the same directory as the original file.  */
+   strcpy (debugfile, dir);
+   strcat (debugfile, basename);
  
    if (separate_debug_file_exists (debugfile, crc32, objfile->name))
-     {
-+      xfree (build_id_filename);
-       xfree (basename);
-       xfree (dir);
-       return xstrdup (debugfile);
-@@ -1513,6 +2114,7 @@ find_separate_debug_file (struct objfile
+-    {
+-      xfree (basename);
+-      xfree (dir);
+-      return xstrdup (debugfile);
+-    }
++    goto cleanup_return_debugfile;
+ 
+   /* Then try in the subdirectory named DEBUG_SUBDIRECTORY.  */
+   strcpy (debugfile, dir);
+@@ -1485,11 +2078,7 @@ find_separate_debug_file (struct objfile
+   strcat (debugfile, basename);
  
    if (separate_debug_file_exists (debugfile, crc32, objfile->name))
-     {
-+      xfree (build_id_filename);
-       xfree (basename);
-       xfree (dir);
-       return xstrdup (debugfile);
-@@ -1526,6 +2128,7 @@ find_separate_debug_file (struct objfile
+-    {
+-      xfree (basename);
+-      xfree (dir);
+-      return xstrdup (debugfile);
+-    }
++    goto cleanup_return_debugfile;
+ 
+   /* Then try in the global debugfile directory.  */
+   strcpy (debugfile, debug_file_directory);
+@@ -1498,11 +2087,7 @@ find_separate_debug_file (struct objfile
+   strcat (debugfile, basename);
  
    if (separate_debug_file_exists (debugfile, crc32, objfile->name))
-     {
-+      xfree (build_id_filename);
-       xfree (basename);
-       xfree (dir);
-       return xstrdup (debugfile);
-@@ -1545,6 +2148,7 @@ find_separate_debug_file (struct objfile
+-    {
+-      xfree (basename);
+-      xfree (dir);
+-      return xstrdup (debugfile);
+-    }
++    goto cleanup_return_debugfile;
+ 
+   /* If the file is in the sysroot, try using its base path in the
+      global debugfile directory.  */
+@@ -1517,20 +2102,19 @@ find_separate_debug_file (struct objfile
+       strcat (debugfile, basename);
  
        if (separate_debug_file_exists (debugfile, crc32, objfile->name))
- 	{
-+	  xfree (build_id_filename);
- 	  xfree (canon_name);
- 	  xfree (basename);
- 	  xfree (dir);
-@@ -1552,6 +2156,12 @@ find_separate_debug_file (struct objfile
- 	}
+-	{
+-	  xfree (canon_name);
+-	  xfree (basename);
+-	  xfree (dir);
+-	  return xstrdup (debugfile);
+-	}
++        goto cleanup_return_debugfile;
      }
-   
+-  
+-  if (canon_name)
+-    xfree (canon_name);
+ 
++  debugfile = NULL;
 +  if (build_id_filename != NULL)
-+    {
-+      build_id_print_missing (objfile->name, build_id_filename);
-+      xfree (build_id_filename);
-+    }
++    build_id_print_missing (objfile->name, build_id_filename);
 +
-   if (canon_name)
-     xfree (canon_name);
++cleanup_return_debugfile:
++  xfree (build_id_filename);
++  xfree (canon_name);
+   xfree (basename);
+   xfree (dir);
+-  return NULL;
++  return debugfile;
+ }
+ 
  
-@@ -4275,4 +4885,16 @@ the global debug-file directory prepende
+@@ -4220,4 +4804,16 @@ the global debug-file directory prepende
  				     NULL,
  				     show_debug_file_directory,
  				     &setlist, &showlist);
@@ -1018,10 +1079,11 @@
 +
 +  observer_attach_inferior_created (missing_debuginfos_change_inferior_created);
  }
-diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7.1-unpatched/gdb/symfile.h gdb-6.7.1-patched/gdb/symfile.h
---- gdb-6.7.1-unpatched/gdb/symfile.h	2008-02-21 05:01:55.000000000 +0100
-+++ gdb-6.7.1-patched/gdb/symfile.h	2008-02-21 04:58:13.000000000 +0100
-@@ -353,6 +353,13 @@ extern int symfile_map_offsets_to_segmen
+Index: gdb-6.7.50.20080227/gdb/symfile.h
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/symfile.h	2008-02-03 23:13:29.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/symfile.h	2008-03-01 10:30:50.000000000 +0100
+@@ -358,6 +358,13 @@ extern int symfile_map_offsets_to_segmen
  struct symfile_segment_data *get_symfile_segment_data (bfd *abfd);
  void free_symfile_segment_data (struct symfile_segment_data *data);
  

gdb-6.6-bz235197-fork-detach-info.patch:

Index: gdb-6.6-bz235197-fork-detach-info.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.6-bz235197-fork-detach-info.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- gdb-6.6-bz235197-fork-detach-info.patch	7 Jan 2008 15:10:23 -0000	1.1
+++ gdb-6.6-bz235197-fork-detach-info.patch	3 Mar 2008 16:13:47 -0000	1.2
@@ -1,26 +1,25 @@
---- ./gdb/linux-nat.c	9 Feb 2007 20:52:16 -0000	1.56
-+++ ./gdb/linux-nat.c	22 Apr 2007 17:20:25 -0000
-@@ -378,9 +378,17 @@ child_follow_fork (struct target_ops *op
+2008-03-01  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
+	Remove the `[' character from the GDB-6.8 default message.
+
+Index: gdb-6.7.50.20080227/gdb/linux-nat.c
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/linux-nat.c	2008-03-01 10:30:48.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/linux-nat.c	2008-03-01 10:48:25.000000000 +0100
+@@ -415,7 +415,7 @@ linux_child_follow_fork (struct target_o
        /* Detach new forked process?  */
        if (detach_fork)
  	{
-+	  static int advice_printed = 0;
-+
-+	  target_terminal_ours ();
-+	  fprintf_filtered (gdb_stdlog,
-+			 _("[Detaching after fork from child process %d.%s]\n"),
-+			    child_pid, (advice_printed ? "" :
-+					_(" (Try `set detach-on-fork off'.)")));
-+	  advice_printed = 1;
-+
- 	  if (debug_linux_nat)
+-	  if (info_verbose || debug_linux_nat)
++	  if (1 /* Fedora Bug 235197 */ || info_verbose || debug_linux_nat)
  	    {
--	      target_terminal_ours ();
+ 	      target_terminal_ours ();
  	      fprintf_filtered (gdb_stdlog,
- 				"Detaching after fork from child process %d.\n",
- 				child_pid);
---- /dev/null	1 Jan 1970 00:00:00 -0000
-+++ ./gdb/testsuite/gdb.base/fork-detach.c	22 Apr 2007 17:20:25 -0000
+Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.base/fork-detach.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.7.50.20080227/gdb/testsuite/gdb.base/fork-detach.c	2008-03-01 10:30:49.000000000 +0100
 @@ -0,0 +1,57 @@
 +/* This testcase is part of GDB, the GNU debugger.
 +
@@ -79,8 +78,10 @@
 +    }
 +  return 0;
 +}
---- /dev/null	1 Jan 1970 00:00:00 -0000
-+++ ./gdb/testsuite/gdb.base/fork-detach.exp	22 Apr 2007 17:20:25 -0000
+Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.base/fork-detach.exp
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.7.50.20080227/gdb/testsuite/gdb.base/fork-detach.exp	2008-03-01 10:49:36.000000000 +0100
 @@ -0,0 +1,43 @@
 +# Copyright 2007 Free Software Foundation, Inc.
 +
@@ -96,7 +97,7 @@
 +# 
 +# You should have received a copy of the GNU General Public License
 +# along with this program; if not, write to the Free Software
-+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 +
 +if $tracelevel then {
 +    strace $tracelevel
@@ -123,5 +124,5 @@
 +gdb_run_cmd
 +# `Starting program: .*' prefix is available since gdb-6.7.
 +gdb_test "" \
-+         "\\\[Detaching after fork from child process.*Program exited normally\\..*" \
++         "Detaching after fork from child process.*Program exited normally\\..*" \
 +         "Info message caught"

gdb-6.6-bz247354-leader-exit-fix.patch:

Index: gdb-6.6-bz247354-leader-exit-fix.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.6-bz247354-leader-exit-fix.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- gdb-6.6-bz247354-leader-exit-fix.patch	8 Jul 2007 10:45:30 -0000	1.1
+++ gdb-6.6-bz247354-leader-exit-fix.patch	3 Mar 2008 16:13:47 -0000	1.2
@@ -6,9 +6,15 @@
 	(linux_xfer_partial_lwp): ... here.
 	(linux_xfer_partial): New function wrapping LINUX_XFER_PARTIAL_LWP.
 
---- ./gdb/linux-nat.c	3 Jul 2007 17:01:55 -0000	1.65
-+++ ./gdb/linux-nat.c	7 Jul 2007 15:21:57 -0000
-@@ -1343,6 +1343,31 @@ linux_handle_extended_wait (struct lwp_i
+2008-02-24  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
+
+Index: gdb-6.8cvs20080219/gdb/linux-nat.c
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/linux-nat.c	2008-02-21 12:03:38.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/linux-nat.c	2008-02-21 12:05:01.000000000 +0100
+@@ -1570,6 +1570,31 @@ linux_handle_extended_wait (struct lwp_i
  		  _("unknown ptrace event %d"), event);
  }
  
@@ -40,7 +46,7 @@
  /* Wait for LP to stop.  Returns the wait status, or 0 if the LWP has
     exited.  */
  
-@@ -1350,16 +1375,31 @@ static int
+@@ -1577,16 +1602,31 @@ static int
  wait_lwp (struct lwp_info *lp)
  {
    pid_t pid;
@@ -76,7 +82,7 @@
        if (pid == -1 && errno == ECHILD)
  	{
  	  /* The thread has previously exited.  We need to delete it
-@@ -3144,10 +3159,12 @@ linux_proc_pending_signals (int pid, sig
+@@ -3451,10 +3491,12 @@ linux_proc_pending_signals (int pid, sig
    fclose (procfile);
  }
  
@@ -92,7 +98,7 @@
  {
    LONGEST xfer;
  
-@@ -3164,6 +3181,45 @@ linux_xfer_partial (struct target_ops *o
+@@ -3495,6 +3537,45 @@ linux_xfer_partial (struct target_ops *o
  			     offset, len);
  }
  
@@ -135,6 +141,6 @@
 +  return xfer;
 +}
 +
- /* Create a prototype generic Linux target.  The client can override
+ /* Create a prototype generic GNU/Linux target.  The client can override
     it with local methods.  */
  

gdb-6.6-multifork-debugreg.patch:

Index: gdb-6.6-multifork-debugreg.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.6-multifork-debugreg.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- gdb-6.6-multifork-debugreg.patch	12 Jan 2008 16:28:31 -0000	1.3
+++ gdb-6.6-multifork-debugreg.patch	3 Mar 2008 16:13:47 -0000	1.4
@@ -14,38 +14,93 @@
 	* gdb.texinfo (Setting Watchpoints): New paragraph on the software
 	watchpoints safety wrt `set scheduler-locking'.
 
-diff -u -ruNp gdb-6.7.1-orig/gdb/amd64-linux-nat.c gdb-6.7.1/gdb/amd64-linux-nat.c
---- gdb-6.7.1-orig/gdb/amd64-linux-nat.c	2008-01-11 20:59:17.000000000 +0100
-+++ gdb-6.7.1/gdb/amd64-linux-nat.c	2008-01-11 20:49:42.000000000 +0100
-@@ -501,6 +501,12 @@ amd64_linux_insert_watchpoint (CORE_ADDR
-   return rc;
+2008-03-01  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
+
+Index: gdb-6.7.50.20080227/gdb/amd64-linux-nat.c
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/amd64-linux-nat.c	2008-03-01 10:38:02.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/amd64-linux-nat.c	2008-03-01 16:33:40.000000000 +0100
+@@ -408,25 +408,43 @@ amd64_linux_dr_set (ptid_t ptid, int reg
+ void
+ amd64_linux_dr_set_control (unsigned long control)
+ {
+-  struct lwp_info *lp;
+-  ptid_t ptid;
+-
+   amd64_linux_dr[DR_CONTROL] = control;
+-  ALL_LWPS (lp, ptid)
+-    amd64_linux_dr_set (ptid, DR_CONTROL, control);
++
++  /* I386_DETACH_BREAKPOINTS may need to reset the registers on single process
++     not listed for ALL_LWPS.  */
++
++  if (ptid_get_lwp (inferior_ptid) == 0)
++    amd64_linux_dr_set (inferior_ptid, DR_CONTROL, control);
++  else
++    {
++      struct lwp_info *lp;
++      ptid_t ptid;
++
++      ALL_LWPS (lp, ptid)
++	amd64_linux_dr_set (ptid, DR_CONTROL, control);
++    }
+ }
+ 
+ void
+ amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
+ {
+-  struct lwp_info *lp;
+-  ptid_t ptid;
+-
+   gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
+ 
+   amd64_linux_dr[DR_FIRSTADDR + regnum] = addr;
+-  ALL_LWPS (lp, ptid)
+-    amd64_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
++
++  /* I386_DETACH_BREAKPOINTS may need to reset the registers on single process
++     not listed for ALL_LWPS.  */
++
++  if (ptid_get_lwp (inferior_ptid) == 0)
++    amd64_linux_dr_set (inferior_ptid, DR_FIRSTADDR + regnum, addr);
++  else
++    {
++      struct lwp_info *lp;
++      ptid_t ptid;
++
++      ALL_LWPS (lp, ptid)
++	amd64_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
++    }
  }
  
+ void
+@@ -451,6 +469,41 @@ amd64_linux_new_thread (ptid_t ptid)
+ 
+   amd64_linux_dr_set (ptid, DR_CONTROL, amd64_linux_dr[DR_CONTROL]);
+ }
++
 +/* TO_FOLLOW_FORK stores here the PID under DETACH_BREAKPOINTS for the child
 +   process of traced FORK.  We must clear such watchpoints only once during
 +   DETACH_BREAKPOINTS.  */
 +
 +static int amd64_linux_detach_breakpoints_pid;
 +
- /* Remove a watchpoint that watched the memory region which starts at
-    address ADDR, whose length is LEN bytes, and for accesses of the
-    type TYPE.  Return 0 on success, -1 on failure.  */
-@@ -508,12 +514,33 @@ int
- amd64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type)
- {
-   int rc;
-+
++/* Remove a watchpoint that watched the memory region which starts at
++   address ADDR, whose length is LEN bytes, and for accesses of the
++   type TYPE.  Return 0 on success, -1 on failure.  */
++int
++amd64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type)
++{
 +  if (ptid_get_pid (inferior_ptid) == amd64_linux_detach_breakpoints_pid)
 +    return 0;
 +  /* FOLLOW-FORK-MODE CHILD runs later the CHILD with no restrictions.  */
 +  amd64_linux_detach_breakpoints_pid = 0;
 +
-   rc = i386_remove_watchpoint (addr, len, type);
-   if (!rc)
-     amd64_linux_sync_debug_registers_across_threads ();
-   return rc;
- }
- 
++  return i386_remove_watchpoint (addr, len, type);
++}
++
 +static void
 +amd64_linux_detach_breakpoints (int detached_pid)
 +{
@@ -60,24 +115,10 @@
 +
 +  do_cleanups (old_chain);
 +}
-+
- /* Insert a hardware-assisted breakpoint at address ADDR.  SHADOW is
-    unused.  Return 0 on success, EBUSY on failure.  */
- int
-@@ -532,6 +559,12 @@ int
- amd64_linux_remove_hw_breakpoint (struct bp_target_info *bp_tgt)
- {
-   int rc;
-+
-+  if (ptid_get_pid (inferior_ptid) == amd64_linux_detach_breakpoints_pid)
-+    return 0;
-+  /* FOLLOW-FORK-MODE CHILD runs later the CHILD with no restrictions.  */
-+  amd64_linux_detach_breakpoints_pid = 0;
-+
-   rc = i386_remove_hw_breakpoint (bp_tgt);
-   if (!rc)
-     amd64_linux_sync_debug_registers_across_threads ();
-@@ -620,6 +653,41 @@ amd64_linux_child_post_startup_inferior 
+ 
+ 
+ /* This function is called by libthread_db as part of its handling of
+@@ -520,6 +573,41 @@ amd64_linux_child_post_startup_inferior 
    i386_cleanup_dregs ();
    super_post_startup_inferior (ptid);
  }
@@ -119,7 +160,7 @@
  
  
  /* Provide a prototype to silence -Wmissing-prototypes.  */
-@@ -656,6 +724,9 @@ _initialize_amd64_linux_nat (void)
+@@ -556,6 +644,9 @@ _initialize_amd64_linux_nat (void)
    linux_elfcore_write_prstatus = amd64_linux_elfcore_write_prstatus;
    linux_elfcore_write_prfpreg = amd64_linux_elfcore_write_prfpreg;
  
@@ -128,51 +169,99 @@
 +
    /* Register the target.  */
    linux_nat_add_target (t);
- 
-diff -u -ruNp gdb-6.7.1-orig/gdb/config/i386/nm-i386.h gdb-6.7.1/gdb/config/i386/nm-i386.h
---- gdb-6.7.1-orig/gdb/config/i386/nm-i386.h	2007-08-23 20:08:48.000000000 +0200
-+++ gdb-6.7.1/gdb/config/i386/nm-i386.h	2008-01-11 20:47:42.000000000 +0100
-@@ -114,6 +114,8 @@ extern int i386_stopped_by_watchpoint (v
-    reset all debug registers by calling i386_cleanup_dregs ().  */ 
- #define CHILD_POST_STARTUP_INFERIOR
+   linux_nat_set_new_thread (t, amd64_linux_new_thread);
+Index: gdb-6.7.50.20080227/gdb/config/i386/nm-i386.h
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/config/i386/nm-i386.h	2008-03-01 10:38:02.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/config/i386/nm-i386.h	2008-03-01 10:50:39.000000000 +0100
+@@ -110,6 +110,8 @@ extern int i386_stopped_by_watchpoint (v
+ #define target_remove_hw_breakpoint(bp_tgt) \
+   i386_remove_hw_breakpoint (bp_tgt)
  
 +extern void i386_detach_breakpoints (int detached_pid);
 +
  #endif /* I386_USE_GENERIC_WATCHPOINTS */
  
  #endif /* NM_I386_H */
-diff -u -ruNp gdb-6.7.1-orig/gdb/i386-linux-nat.c gdb-6.7.1/gdb/i386-linux-nat.c
---- gdb-6.7.1-orig/gdb/i386-linux-nat.c	2008-01-11 20:59:17.000000000 +0100
-+++ gdb-6.7.1/gdb/i386-linux-nat.c	2008-01-11 20:49:52.000000000 +0100
-@@ -745,6 +745,12 @@ i386_linux_insert_watchpoint (CORE_ADDR 
-   return rc;
+Index: gdb-6.7.50.20080227/gdb/i386-linux-nat.c
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/i386-linux-nat.c	2008-03-01 10:38:02.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/i386-linux-nat.c	2008-03-01 16:33:40.000000000 +0100
+@@ -655,21 +655,42 @@ i386_linux_dr_set_control (unsigned long
+   ptid_t ptid;
+ 
+   i386_linux_dr[DR_CONTROL] = control;
+-  ALL_LWPS (lp, ptid)
+-    i386_linux_dr_set (ptid, DR_CONTROL, control);
++
++  /* I386_DETACH_BREAKPOINTS may need to reset the registers on single process
++     not listed for ALL_LWPS.  */
++
++  if (ptid_get_lwp (inferior_ptid) == 0)
++    i386_linux_dr_set (inferior_ptid, DR_CONTROL, control);
++  else
++    {
++      struct lwp_info *lp;
++      ptid_t ptid;
++
++      ALL_LWPS (lp, ptid)
++	i386_linux_dr_set (ptid, DR_CONTROL, control);
++    }
  }
  
+ void
+ i386_linux_dr_set_addr (int regnum, CORE_ADDR addr)
+ {
+-  struct lwp_info *lp;
+-  ptid_t ptid;
+-
+   gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
+ 
+   i386_linux_dr[DR_FIRSTADDR + regnum] = addr;
+-  ALL_LWPS (lp, ptid)
+-    i386_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
++
++  /* I386_DETACH_BREAKPOINTS may need to reset the registers on single process
++     not listed for ALL_LWPS.  */
++
++  if (ptid_get_lwp (inferior_ptid) == 0)
++    i386_linux_dr_set (inferior_ptid, DR_FIRSTADDR + regnum, addr);
++  else
++    {
++      struct lwp_info *lp;
++      ptid_t ptid;
++
++      ALL_LWPS (lp, ptid)
++	i386_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
++    }
+ }
+ 
+ void
+@@ -694,6 +715,41 @@ i386_linux_new_thread (ptid_t ptid)
+ 
+   i386_linux_dr_set (ptid, DR_CONTROL, i386_linux_dr[DR_CONTROL]);
+ }
++
 +/* TO_FOLLOW_FORK stores here the PID under DETACH_BREAKPOINTS for the child
 +   process of traced FORK.  We must clear such watchpoints only once during
 +   DETACH_BREAKPOINTS.  */
 +
 +static int i386_linux_detach_breakpoints_pid;
 +
- /* Remove a watchpoint that watched the memory region which starts at
-    address ADDR, whose length is LEN bytes, and for accesses of the
-    type TYPE.  Return 0 on success, -1 on failure.  */
-@@ -752,12 +758,33 @@ int
- i386_linux_remove_watchpoint (CORE_ADDR addr, int len, int type)
- {
-   int rc;
-+
++/* Remove a watchpoint that watched the memory region which starts at
++   address ADDR, whose length is LEN bytes, and for accesses of the
++   type TYPE.  Return 0 on success, -1 on failure.  */
++int
++i386_linux_remove_watchpoint (CORE_ADDR addr, int len, int type)
++{
 +  if (ptid_get_pid (inferior_ptid) == i386_linux_detach_breakpoints_pid)
 +    return 0;
 +  /* FOLLOW-FORK-MODE CHILD runs later the CHILD with no restrictions.  */
 +  i386_linux_detach_breakpoints_pid = 0;
 +
-   rc = i386_remove_watchpoint (addr, len, type);
-   if (!rc)
-     i386_linux_sync_debug_registers_across_threads ();
-   return rc;
- }
- 
++  return i386_remove_watchpoint (addr, len, type);
++}
++
 +static void
 +i386_linux_detach_breakpoints (int detached_pid)
 +{
@@ -187,11 +276,10 @@
 +
 +  do_cleanups (old_chain);
 +}
-+
- /* Insert a hardware-assisted breakpoint at address ADDR.  SHADOW is
-    unused.  Return 0 on success, EBUSY on failure.  */
- int
-@@ -940,6 +967,40 @@ i386_linux_child_post_startup_inferior (
+ 
+ 
+ /* Called by libthread_db.  Returns a pointer to the thread local
+@@ -833,6 +889,40 @@ i386_linux_child_post_startup_inferior (
    super_post_startup_inferior (ptid);
  }
  
@@ -232,7 +320,7 @@
  void
  _initialize_i386_linux_nat (void)
  {
-@@ -959,6 +1020,9 @@ _initialize_i386_linux_nat (void)
+@@ -852,6 +942,9 @@ _initialize_i386_linux_nat (void)
    t->to_fetch_registers = i386_linux_fetch_inferior_registers;
    t->to_store_registers = i386_linux_store_inferior_registers;
  
@@ -241,11 +329,12 @@
 +
    /* Register the target.  */
    linux_nat_add_target (t);
- 
-diff -u -ruNp gdb-6.7.1-orig/gdb/i386-nat.c gdb-6.7.1/gdb/i386-nat.c
---- gdb-6.7.1-orig/gdb/i386-nat.c	2008-01-11 20:59:17.000000000 +0100
-+++ gdb-6.7.1/gdb/i386-nat.c	2008-01-11 20:47:57.000000000 +0100
-@@ -545,6 +546,17 @@ i386_remove_watchpoint (CORE_ADDR addr, 
+   linux_nat_set_new_thread (t, i386_linux_new_thread);
+Index: gdb-6.7.50.20080227/gdb/i386-nat.c
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/i386-nat.c	2008-03-01 10:38:02.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/i386-nat.c	2008-03-01 10:50:39.000000000 +0100
+@@ -544,6 +544,17 @@ i386_remove_watchpoint (CORE_ADDR addr, 
    return retval;
  }
  
@@ -263,10 +352,12 @@
  /* Return non-zero if we can watch a memory region that starts at
     address ADDR and whose length is LEN bytes.  */
  
---- gdb-6.5/gdb/ia64-linux-nat.c.orig	2008-01-12 15:47:40.000000000 +0100
-+++ gdb-6.5/gdb/ia64-linux-nat.c	2008-01-12 15:57:58.000000000 +0100
-@@ -664,12 +664,23 @@ ia64_linux_remove_watchpoint_callback (s
- 		 		     	   args->len);
+Index: gdb-6.7.50.20080227/gdb/ia64-linux-nat.c
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/ia64-linux-nat.c	2008-03-01 10:38:02.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/ia64-linux-nat.c	2008-03-01 10:50:39.000000000 +0100
+@@ -583,6 +583,12 @@ ia64_linux_insert_watchpoint (CORE_ADDR 
+   return 0;
  }
  
 +/* TO_FOLLOW_FORK stores here the PID under DETACH_BREAKPOINTS for the child
@@ -275,23 +366,24 @@
 +
 +static int ia64_linux_detach_breakpoints_pid;
 +
- /* Remove a watchpoint for all threads.  */
  static int
- ia64_linux_remove_watchpoint (CORE_ADDR addr, int len)
+ ia64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type)
  {
-   struct linux_watchpoint args;
+@@ -590,6 +596,11 @@ ia64_linux_remove_watchpoint (CORE_ADDR 
+   long dbr_addr, dbr_mask;
+   int max_watchpoints = 4;
  
 +  if (ptid_get_pid (inferior_ptid) == ia64_linux_detach_breakpoints_pid)
 +    return 0;
 +  /* FOLLOW-FORK-MODE CHILD runs later the CHILD with no restrictions.  */
 +  ia64_linux_detach_breakpoints_pid = 0;
 +
-   args.addr = addr;
-   args.len = len;
+   if (len <= 0 || !is_power_of_2 (len))
+     return -1;
+ 
+@@ -617,6 +628,22 @@ ia64_linux_remove_watchpoint (CORE_ADDR 
+ }
  
-@@ -771,6 +782,22 @@ ia64_linux_xfer_partial (struct target_o
- /* Observer function for a new thread attach.  We need to insert
-    existing watchpoints on the new thread.  */
  static void
 +ia64_linux_detach_breakpoints (int detached_pid)
 +{
@@ -311,9 +403,9 @@
 +static void
  ia64_linux_new_thread (ptid_t ptid)
  {
-   insert_watchpoints_for_new_thread (ptid, 
-@@ -793,6 +820,40 @@ ia64_linux_save_sigtrap_info (void *queu
-           lp->saved_trap_data);
+   int i, any;
+@@ -805,6 +832,40 @@ ia64_linux_xfer_partial (struct target_o
+ 			     offset, len);
  }
  
 +static int (*ia64_linux_super_follow_fork) (struct target_ops *ops,
@@ -353,21 +445,22 @@
  void _initialize_ia64_linux_nat (void);
  
  /*
-@@ -865,6 +926,9 @@ _initialize_ia64_linux_nat (void)
-   super_xfer_partial = t->to_xfer_partial;
-   t->to_xfer_partial = ia64_linux_xfer_partial;
+@@ -899,6 +960,9 @@ _initialize_ia64_linux_nat (void)
+   t->to_insert_watchpoint = ia64_linux_insert_watchpoint;
+   t->to_remove_watchpoint = ia64_linux_remove_watchpoint;
  
 +  ia64_linux_super_follow_fork = t->to_follow_fork;
 +  t->to_follow_fork = ia64_linux_follow_fork;
 +
    /* Register the target.  */
    linux_nat_add_target (t);
- 
-diff -u -ruNp gdb-6.7.1-orig/gdb/ppc-linux-nat.c gdb-6.7.1/gdb/ppc-linux-nat.c
---- gdb-6.7.1-orig/gdb/ppc-linux-nat.c	2007-08-30 15:13:59.000000000 +0200
-+++ gdb-6.7.1/gdb/ppc-linux-nat.c	2008-01-11 20:43:12.000000000 +0100
-@@ -837,12 +837,23 @@ ppc_linux_insert_watchpoint (CORE_ADDR a
-   return ptrace (PTRACE_SET_DEBUGREG, tid, 0, dabr_value);
+   linux_nat_set_new_thread (t, ia64_linux_new_thread);
+Index: gdb-6.7.50.20080227/gdb/ppc-linux-nat.c
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/ppc-linux-nat.c	2008-03-01 10:38:02.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/ppc-linux-nat.c	2008-03-01 10:50:39.000000000 +0100
+@@ -847,6 +847,12 @@ ppc_linux_insert_watchpoint (CORE_ADDR a
+   return 0;
  }
  
 +/* TO_FOLLOW_FORK stores here the PID under DETACH_BREAKPOINTS for the child
@@ -379,19 +472,20 @@
  static int
  ppc_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw)
  {
-   int tid;
-   ptid_t ptid = inferior_ptid;
+@@ -854,6 +860,11 @@ ppc_linux_remove_watchpoint (CORE_ADDR a
+   ptid_t ptid;
+   long dabr_value = 0;
  
 +  if (ptid_get_pid (inferior_ptid) == ppc_linux_detach_breakpoints_pid)
 +    return 0;
 +  /* FOLLOW-FORK-MODE CHILD runs later the CHILD with no restrictions.  */
 +  ppc_linux_detach_breakpoints_pid = 0;
 +
-   tid = TIDGET (ptid);
-   if (tid == 0)
-     tid = PIDGET (ptid);
-@@ -850,6 +861,15 @@ ppc_linux_remove_watchpoint (CORE_ADDR a
-   return ptrace (PTRACE_SET_DEBUGREG, tid, 0, 0);
+   saved_dabr_value = 0;
+   ALL_LWPS (lp, ptid)
+     if (ptrace (PTRACE_SET_DEBUGREG, TIDGET (ptid), 0, saved_dabr_value) < 0)
+@@ -867,6 +878,15 @@ ppc_linux_new_thread (ptid_t ptid)
+   ptrace (PTRACE_SET_DEBUGREG, TIDGET (ptid), 0, saved_dabr_value);
  }
  
 +static void
@@ -406,8 +500,8 @@
  static int
  ppc_linux_stopped_data_address (struct target_ops *target, CORE_ADDR *addr_p)
  {
-@@ -945,6 +965,40 @@ fill_fpregset (const struct regcache *re
- 			fpregsetp, sizeof (*fpregsetp));
+@@ -976,6 +996,40 @@ ppc_linux_read_description (struct targe
+   return NULL;
  }
  
 +static int (*ppc_linux_super_follow_fork) (struct target_ops *ops,
@@ -447,26 +541,28 @@
  void _initialize_ppc_linux_nat (void);
  
  void
-@@ -967,6 +1021,9 @@ _initialize_ppc_linux_nat (void)
-   t->to_stopped_by_watchpoint = ppc_linux_stopped_by_watchpoint;
-   t->to_stopped_data_address = ppc_linux_stopped_data_address;
+@@ -1000,6 +1054,9 @@ _initialize_ppc_linux_nat (void)
+ 
+   t->to_read_description = ppc_linux_read_description;
  
 +  ppc_linux_super_follow_fork = t->to_follow_fork;
 +  t->to_follow_fork = ppc_linux_follow_fork;
 +
    /* Register the target.  */
    linux_nat_add_target (t);
- }
---- gdb-6.7.1-unpatched/gdb/s390-nat.c	2008-01-11 15:33:48.000000000 -0500
-+++ gdb-6.7.1/gdb/s390-nat.c	2008-01-11 15:35:50.000000000 -0500
-@@ -269,17 +269,15 @@ s390_stopped_by_watchpoint (void)
+   linux_nat_set_new_thread (t, ppc_linux_new_thread);
+Index: gdb-6.7.50.20080227/gdb/s390-nat.c
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/s390-nat.c	2008-03-01 10:38:02.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/s390-nat.c	2008-03-01 10:50:39.000000000 +0100
+@@ -283,21 +283,15 @@ s390_stopped_by_watchpoint (void)
  }
  
  static void
 -s390_fix_watch_points (ptid_t ptid)
-+s390_fix_watch_points_list (int tid, struct watch_area *area_list)
++s390_fix_watch_points (int tid, struct watch_area *area_list)
  {
--  int tid = s390_tid (ptid);
+-  int tid;
 -
    per_struct per_info;
    ptrace_area parea;
@@ -474,12 +570,16 @@
    CORE_ADDR watch_lo_addr = (CORE_ADDR)-1, watch_hi_addr = 0;
    struct watch_area *area;
  
+-  tid = TIDGET (ptid);
+-  if (tid == 0)
+-    tid = PIDGET (ptid);
+-
 -  for (area = watch_base; area; area = area->next)
 +  for (area = area_list; area; area = area->next)
      {
        watch_lo_addr = min (watch_lo_addr, area->lo_addr);
        watch_hi_addr = max (watch_hi_addr, area->hi_addr);
-@@ -291,7 +289,7 @@ s390_fix_watch_points (ptid_t ptid)
+@@ -309,7 +303,7 @@ s390_fix_watch_points (ptid_t ptid)
    if (ptrace (PTRACE_PEEKUSR_AREA, tid, &parea) < 0)
      perror_with_name (_("Couldn't retrieve watchpoint status"));
  
@@ -488,20 +588,26 @@
      {
        per_info.control_regs.bits.em_storage_alteration = 1;
        per_info.control_regs.bits.storage_alt_space_ctl = 1;
-@@ -308,6 +306,12 @@ s390_fix_watch_points (ptid_t ptid)
+@@ -326,6 +320,18 @@ s390_fix_watch_points (ptid_t ptid)
      perror_with_name (_("Couldn't modify watchpoint status"));
  }
  
 +static void
 +s390_fix_watch_points (ptid_t ptid)
 +{
-+  s390_fix_watch_points_list (s390_tid (ptid), watch_base);
++  int tid;
++
++  tid = TIDGET (ptid);
++  if (tid == 0)
++    tid = PIDGET (ptid);
++
++  s390_fix_watch_points_list (tid, watch_base);
 +}
 +
- /* Callback routine to use with iterate_over_lwps to insert a specified
-    watchpoint on all threads.  */
  static int
-@@ -348,12 +352,23 @@ s390_remove_watchpoint_callback (struct 
+ s390_insert_watchpoint (CORE_ADDR addr, int len, int type)
+ {
+@@ -347,6 +353,12 @@ s390_insert_watchpoint (CORE_ADDR addr, 
    return 0;
  }
  
@@ -511,10 +617,11 @@
 +
 +static int s390_detach_breakpoints_pid;
 +
- /* Remove a specified watchpoint from all threads.  */
  static int
  s390_remove_watchpoint (CORE_ADDR addr, int len, int type)
  {
+@@ -354,6 +366,11 @@ s390_remove_watchpoint (CORE_ADDR addr, 
+   ptid_t ptid;
    struct watch_area *area, **parea;
  
 +  if (ptid_get_pid (inferior_ptid) == s390_detach_breakpoints_pid)
@@ -525,7 +632,7 @@
    for (parea = &watch_base; *parea; parea = &(*parea)->next)
      if ((*parea)->lo_addr == addr
  	&& (*parea)->hi_addr == addr + len - 1)
-@@ -378,6 +393,15 @@ s390_remove_watchpoint (CORE_ADDR addr, 
+@@ -375,6 +392,15 @@ s390_remove_watchpoint (CORE_ADDR addr, 
    return 0;
  }
  
@@ -541,8 +648,8 @@
  static int
  s390_can_use_hw_breakpoint (int type, int cnt, int othertype)
  {
-@@ -399,6 +423,39 @@ s390_linux_new_thread (ptid_t ptid)
-   s390_fix_watch_points (ptid);
+@@ -387,6 +413,39 @@ s390_region_ok_for_hw_watchpoint (CORE_A
+   return 1;
  }
  
 +static int (*s390_super_follow_fork) (struct target_ops *ops, int follow_child);
@@ -581,7 +688,7 @@
  
  void _initialize_s390_nat (void);
  
-@@ -422,6 +479,9 @@ _initialize_s390_nat (void)
+@@ -410,6 +469,9 @@ _initialize_s390_nat (void)
    t->to_insert_watchpoint = s390_insert_watchpoint;
    t->to_remove_watchpoint = s390_remove_watchpoint;
  
@@ -590,10 +697,11 @@
 +
    /* Register the target.  */
    linux_nat_add_target (t);
- 
-diff -u -ruNp gdb-6.7.1-orig/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c gdb-6.7.1/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c
---- gdb-6.7.1-orig/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c	1970-01-01 01:00:00.000000000 +0100
-+++ gdb-6.7.1/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c	2008-01-11 20:28:48.000000000 +0100
+   linux_nat_set_new_thread (t, s390_fix_watch_points);
+Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c	2008-03-01 15:18:13.000000000 +0100
 @@ -0,0 +1,160 @@
 +/* Test case for forgotten hw-watchpoints after fork()-off of a process.
 +
@@ -755,9 +863,10 @@
 +#else
 +# error "!FOLLOW_PARENT && !FOLLOW_CHILD"
 +#endif
-diff -u -ruNp gdb-6.7.1-orig/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c gdb-6.7.1/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c
---- gdb-6.7.1-orig/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c	1970-01-01 01:00:00.000000000 +0100
-+++ gdb-6.7.1/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c	2008-01-11 20:28:48.000000000 +0100
+Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c	2008-03-01 10:50:39.000000000 +0100
 @@ -0,0 +1,154 @@
 +/* Test case for forgotten hw-watchpoints after fork()-off of a process.
 +
@@ -861,7 +970,7 @@
 +}
 +
 +int main (void)
-+{ 
++{
 +  int i;
 +  void *thread_result;
 +
@@ -913,9 +1022,10 @@
 +
 +  return 0;
 +}
-diff -u -ruNp gdb-6.7.1-orig/gdb/testsuite/gdb.threads/watchpoint-fork.c gdb-6.7.1/gdb/testsuite/gdb.threads/watchpoint-fork.c
---- gdb-6.7.1-orig/gdb/testsuite/gdb.threads/watchpoint-fork.c	1970-01-01 01:00:00.000000000 +0100
-+++ gdb-6.7.1/gdb/testsuite/gdb.threads/watchpoint-fork.c	2008-01-11 20:28:48.000000000 +0100
+Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork.c	2008-03-01 10:50:39.000000000 +0100
 @@ -0,0 +1,56 @@
 +/* Test case for forgotten hw-watchpoints after fork()-off of a process.
 +
@@ -973,9 +1083,10 @@
 +
 +  return 0;
 +}
-diff -u -ruNp gdb-6.7.1-orig/gdb/testsuite/gdb.threads/watchpoint-fork.exp gdb-6.7.1/gdb/testsuite/gdb.threads/watchpoint-fork.exp
---- gdb-6.7.1-orig/gdb/testsuite/gdb.threads/watchpoint-fork.exp	1970-01-01 01:00:00.000000000 +0100
-+++ gdb-6.7.1/gdb/testsuite/gdb.threads/watchpoint-fork.exp	2008-01-11 20:28:48.000000000 +0100
+Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork.exp
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork.exp	2008-03-01 10:50:39.000000000 +0100
 @@ -0,0 +1,140 @@
 +# Copyright 2008 Free Software Foundation, Inc.
 +
@@ -1117,47 +1228,16 @@
 +if {[istarget "*-*-linux*"]} {
 +    test child FOLLOW_CHILD
 +}
+Index: gdb-6.7.50.20080227/gdb/doc/gdb.texinfo
 ===================================================================
-RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
-retrieving revision 1.434
-retrieving revision 1.435
-diff -u -r1.434 -r1.435
---- src/gdb/doc/gdb.texinfo	2007/09/28 11:09:55	1.434
-+++ src/gdb/doc/gdb.texinfo	2007/10/01 00:17:58	1.435
-@@ -3346,20 +3346,13 @@
- way of doing that would be to set a code breakpoint at the entry to the
- @code{main} function and when it breaks, set all the watchpoints.
- 
-- at quotation
- @cindex watchpoints and threads
- @cindex threads and watchpoints
-- at emph{Warning:} In multi-thread programs, watchpoints have only limited
--usefulness.  With the current watchpoint implementation, @value{GDBN}
--can only watch the value of an expression @emph{in a single thread}.  If
--you are confident that the expression can only change due to the current
--thread's activity (and if you are also confident that no other thread
--can become current), then you can use watchpoints as usual.  However,
-- at value{GDBN} may not notice when a non-current thread's activity changes
--the expression.
-+In multi-threaded programs, watchpoints will detect changes to the
-+watched expression from every thread.
- 
-- at c FIXME: this is almost identical to the previous paragraph.
-- at emph{HP-UX Warning:} In multi-thread programs, software watchpoints
-+ at quotation
-+ at emph{Warning:} In multi-threaded programs, software watchpoints
- have only limited usefulness.  If @value{GDBN} creates a software
- watchpoint, it can only watch the value of an expression @emph{in a
- single thread}.  If you are confident that the expression can only
-
---- gdb-6.5/gdb/doc/gdb.texinfo-orig	2007-12-15 13:25:14.000000000 +0100
-+++ gdb-6.5/gdb/doc/gdb.texinfo	2007-12-15 13:45:25.000000000 +0100
-@@ -3261,6 +3261,14 @@
+--- gdb-6.7.50.20080227.orig/gdb/doc/gdb.texinfo	2008-03-01 10:50:39.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/doc/gdb.texinfo	2008-03-01 10:50:39.000000000 +0100
+@@ -3386,6 +3386,14 @@ confident that no other thread can becom
  software watchpoints as usual.  However, @value{GDBN} may not notice
  when a non-current thread's activity changes the expression.  (Hardware
  watchpoints, in contrast, watch an expression in all threads.)
 +
-+Software watchpoints single-step the current thread to track the changes.  
++Software watchpoints single-step the current thread to track the changes.
 +Other threads are left freely running on @code{continue}; therefore, their
 +changes cannot be caught.  To get more reliable software watchpoints, please
 +use @code{set scheduler-locking on}.  The default for Red Hat/Fedora
@@ -1167,3 +1247,45 @@
  @end quotation
  
  @xref{set remote hardware-watchpoint-limit}.
+Index: gdb-6.7.50.20080227/gdb/config/i386/nm-linux.h
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/config/i386/nm-linux.h	2008-03-01 10:38:02.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/config/i386/nm-linux.h	2008-03-01 10:50:39.000000000 +0100
+@@ -44,6 +44,17 @@ extern void i386_linux_dr_reset_addr (in
+ extern unsigned long i386_linux_dr_get_status (void);
+ #define I386_DR_LOW_GET_STATUS() \
+   i386_linux_dr_get_status ()
++
++/* Remove a watchpoint that watched the memory region which starts at
++ *    address ADDR, whose length is LEN bytes, and for accesses of the
++ *       type TYPE.  Return 0 on success, -1 on failure.  */
++extern int i386_linux_remove_watchpoint (CORE_ADDR addr, int len, int type);
++
++/* Override basic i386 macros for watchpoint and hardware breakpoint
++   insertion/removal to support threads.  */
++#undef target_remove_watchpoint
++#define target_remove_watchpoint(addr, len, type) \
++  i386_linux_remove_watchpoint (addr, len, type)
+ 
+ 
+ #ifdef HAVE_PTRACE_GETFPXREGS
+Index: gdb-6.7.50.20080227/gdb/config/i386/nm-linux64.h
+===================================================================
+--- gdb-6.7.50.20080227.orig/gdb/config/i386/nm-linux64.h	2008-03-01 10:38:02.000000000 +0100
++++ gdb-6.7.50.20080227/gdb/config/i386/nm-linux64.h	2008-03-01 10:50:39.000000000 +0100
+@@ -50,4 +50,15 @@ extern unsigned long amd64_linux_dr_get_
+ #define I386_DR_LOW_GET_STATUS() \
+   amd64_linux_dr_get_status ()
+ 
++/* Remove a watchpoint that watched the memory region which starts at
++ *    address ADDR, whose length is LEN bytes, and for accesses of the
++ *       type TYPE.  Return 0 on success, -1 on failure.  */
++extern int amd64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type);
++
++/* Override basic amd64 macros for watchpoint and hardware breakpoint
++   insertion/removal to support threads.  */
++#undef target_remove_watchpoint
++#define target_remove_watchpoint(addr, len, type) \
++  amd64_linux_remove_watchpoint (addr, len, type)
++
+ #endif /* nm-linux64.h */

gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch:

Index: gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch	19 Oct 2007 00:12:58 -0000	1.3
+++ gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch	3 Mar 2008 16:13:47 -0000	1.4
@@ -17,9 +17,15 @@
 	* infrun.c (proceed): RESUME_STEP initialized for non-stepping.
 	RESUME_STEP set according to STEP only at the end of the function.
 
---- ./gdb/inferior.h	15 Jun 2007 22:44:55 -0000	1.83
-+++ ./gdb/inferior.h	25 Jun 2007 20:33:02 -0000
-@@ -194,7 +194,15 @@ extern void reopen_exec_file (void);
+2008-02-24  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
+
+Index: gdb-6.8cvs20080219/gdb/inferior.h
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/inferior.h	2008-02-14 23:03:57.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/inferior.h	2008-02-19 14:15:01.000000000 +0100
+@@ -179,7 +179,15 @@ extern void reopen_exec_file (void);
  /* The `resume' routine should only be called in special circumstances.
     Normally, use `proceed', which handles a lot of bookkeeping.  */
  
@@ -36,9 +42,11 @@
  
  /* From misc files */
  
---- ./gdb/infrun.c	22 Jun 2007 12:47:48 -0000	1.243
-+++ ./gdb/infrun.c	25 Jun 2007 20:33:02 -0000
-@@ -76,7 +76,8 @@ static void set_schedlock_func (char *ar
+Index: gdb-6.8cvs20080219/gdb/infrun.c
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/infrun.c	2008-02-14 23:03:57.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/infrun.c	2008-02-19 14:24:37.000000000 +0100
+@@ -74,7 +74,8 @@ static void set_schedlock_func (char *ar
  
  struct execution_control_state;
  
@@ -48,7 +56,7 @@
  
  static void xdb_handle_command (char *args, int from_tty);
  
-@@ -496,15 +497,18 @@ set_schedlock_func (char *args, int from
+@@ -508,15 +509,18 @@ set_schedlock_func (char *args, int from
     STEP nonzero if we should step (zero to continue instead).
     SIG is the signal to give the inferior (zero for none).  */
  void
@@ -70,7 +78,7 @@
  
    /* FIXME: calling breakpoint_here_p (read_pc ()) three times! */
  
-@@ -593,9 +597,10 @@ a command like `return' or `jump' to con
+@@ -632,9 +636,10 @@ a command like `return' or `jump' to con
  	  resume_ptid = inferior_ptid;
  	}
  
@@ -83,7 +91,7 @@
  	{
  	  /* User-settable 'scheduler' mode requires solo thread resume. */
  	  resume_ptid = inferior_ptid;
-@@ -711,7 +716,7 @@ static CORE_ADDR prev_pc;
+@@ -742,7 +747,7 @@ static CORE_ADDR prev_pc;
  void
  proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
  {
@@ -92,7 +100,7 @@
  
    if (step > 0)
      step_start_function = find_pc_function (read_pc ());
-@@ -725,13 +731,13 @@ proceed (CORE_ADDR addr, enum target_sig
+@@ -756,13 +761,13 @@ proceed (CORE_ADDR addr, enum target_sig
  	   step one instruction before inserting breakpoints so that
  	   we do not stop right away (and report a second hit at this
  	   breakpoint).  */
@@ -108,10 +116,10 @@
      }
    else
      {
-@@ -755,9 +761,9 @@ proceed (CORE_ADDR addr, enum target_sig
+@@ -786,9 +791,9 @@ proceed (CORE_ADDR addr, enum target_sig
       that reported the most recent event.  If a step-over is required
       it returns TRUE and sets the current thread to the old thread. */
-   if (prepare_to_proceed () && breakpoint_here_p (read_pc ()))
+   if (prepare_to_proceed (step))
 -    oneproc = 1;
 +    resume_step = RESUME_STEP_USER;
  
@@ -119,8 +127,8 @@
 +  if (resume_step == RESUME_STEP_USER)
      /* We will get a trace trap after one instruction.
         Continue it automatically and insert breakpoints then.  */
-     trap_expected = 1;
-@@ -806,8 +812,13 @@ proceed (CORE_ADDR addr, enum target_sig
+     stepping_over_breakpoint = 1;
+@@ -832,8 +837,13 @@ proceed (CORE_ADDR addr, enum target_sig
       updated correctly when the inferior is stopped.  */
    prev_pc = read_pc ();
  
@@ -135,7 +143,7 @@
  
    /* Wait for it to stop (if not standalone)
       and in any case decode why it stopped, and act accordingly.  */
-@@ -2681,14 +2690,20 @@ process_event_stop_test:
+@@ -2723,14 +2733,21 @@ process_event_stop_test:
  
  /* Are we in the middle of stepping?  */
  
@@ -145,11 +153,12 @@
  {
 -  return ((!ecs->handling_longjmp
 -	   && ((step_range_end && step_resume_breakpoint == NULL)
--	       || trap_expected))
+-	       || stepping_over_breakpoint))
 -	  || ecs->stepping_through_solib_after_catch
 -	  || bpstat_should_step ());
 +  if (!ecs->handling_longjmp
-+      && ((step_range_end && step_resume_breakpoint == NULL) || trap_expected))
++      && ((step_range_end && step_resume_breakpoint == NULL)
++	  || stepping_over_breakpoint))
 +    return RESUME_STEP_USER;
 +
 +  if (ecs->stepping_through_solib_after_catch)
@@ -162,9 +171,11 @@
  }
  
  /* Subroutine call with source code we should not step over.  Do step
---- ./gdb/linux-nat.c	16 Jun 2007 17:16:25 -0000	1.64
-+++ ./gdb/linux-nat.c	25 Jun 2007 20:33:02 -0000
-@@ -1720,7 +1720,10 @@ count_events_callback (struct lwp_info *
+Index: gdb-6.8cvs20080219/gdb/linux-nat.c
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/linux-nat.c	2008-02-14 23:03:57.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/linux-nat.c	2008-02-19 14:15:01.000000000 +0100
+@@ -1751,7 +1751,10 @@ count_events_callback (struct lwp_info *
  static int
  select_singlestep_lwp_callback (struct lwp_info *lp, void *data)
  {
@@ -176,9 +187,11 @@
      return 1;
    else
      return 0;
---- ./gdb/linux-nat.h	10 May 2007 21:36:00 -0000	1.18
-+++ ./gdb/linux-nat.h	25 Jun 2007 20:33:02 -0000
-@@ -53,8 +53,8 @@ struct lwp_info
+Index: gdb-6.8cvs20080219/gdb/linux-nat.h
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/linux-nat.h	2008-02-14 23:03:58.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/linux-nat.h	2008-02-19 14:15:01.000000000 +0100
+@@ -55,8 +55,8 @@ struct lwp_info
    /* If non-zero, a pending wait status.  */
    int status;
  
@@ -187,5 +200,5 @@
 +  /* The kind of stepping of this LWP.  */
 +  enum resume_step step;
  
-   /* If WAITSTATUS->KIND != TARGET_WAITKIND_SPURIOUS, the waitstatus
-      for this LWP's last event.  This may correspond to STATUS above,
+   /* Non-zero si_signo if this LWP stopped with a trap.  si_addr may
+      be the address of a hardware watchpoint.  */

gdb-6.7-bz233852-attach-signalled-fix.patch:

Index: gdb-6.7-bz233852-attach-signalled-fix.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.7-bz233852-attach-signalled-fix.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- gdb-6.7-bz233852-attach-signalled-fix.patch	10 Jan 2008 17:17:49 -0000	1.1
+++ gdb-6.7-bz233852-attach-signalled-fix.patch	3 Mar 2008 16:13:47 -0000	1.2
@@ -18,10 +18,15 @@
 	* gdb.texinfo (Attach): Document the ATTACH and DETACH commands for
 	stopped processes.  Document the messages on the seen pending signals.
 
-diff -u -X /home/short/.diffi.list -ruNp gdb-6.5-unpatched/gdb/NEWS gdb-6.5/gdb/NEWS
---- gdb-6.5-unpatched/gdb/NEWS	2008-01-09 18:26:07.000000000 +0100
-+++ gdb-6.5/gdb/NEWS	2008-01-09 15:26:30.000000000 +0100
-@@ -9,6 +9,9 @@ Renesas M32C/M16C		m32c-elf
+2008-02-24  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
+
+Index: gdb-6.8cvs20080219/gdb/NEWS
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/NEWS	2008-02-24 19:35:37.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/NEWS	2008-02-24 19:36:26.000000000 +0100
+@@ -412,6 +412,9 @@ Renesas M32C/M16C		m32c-elf
  
  Morpho Technologies ms1		ms1-elf
  
@@ -31,30 +36,27 @@
  * New commands
  
  init-if-undefined		Initialize a convenience variable, but
---- gdb-6.7.1/gdb/linux-nat.c.orig	2008-01-09 23:54:42.000000000 +0100
-+++ gdb-6.7.1/gdb/linux-nat.c	2008-01-10 00:08:07.000000000 +0100
-@@ -85,11 +85,20 @@
- #define __WALL          0x40000000 /* Wait for any child.  */
+Index: gdb-6.8cvs20080219/gdb/linux-nat.c
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/linux-nat.c	2008-02-24 19:36:26.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/linux-nat.c	2008-02-24 19:45:01.000000000 +0100
+@@ -89,6 +89,15 @@
+ #define PTRACE_GETSIGINFO    0x4202
  #endif
  
 +#define STRINGIFY_ARG(x) #x
 +#define STRINGIFY(x) STRINGIFY_ARG (x)
 +
-+static int linux_ptrace_post_attach (struct lwp_info *lp);
++static int linux_ptrace_post_attach (ptid_t ptid, int *cloned_return);
 +static int kill_lwp (int lwpid, int signo);
 +
- /* The single-threaded native GNU/Linux target_ops.  We save a pointer for
-    the use of the multi-threaded target.  */
- static struct target_ops *linux_ops;
- static struct target_ops linux_ops_saved;
- 
 +/* PID of the inferior stopped by SIGSTOP before attaching (or zero).  */
 +static pid_t pid_was_stopped;
 +
- /* The saved to_xfer_partial method, inherited from inf-ptrace.c.
-    Called by our to_xfer_partial.  */
- static LONGEST (*super_xfer_partial) (struct target_ops *, 
-@@ -540,6 +549,11 @@ linux_child_follow_fork (struct target_o
+ /* The single-threaded native GNU/Linux target_ops.  We save a pointer for
+    the use of the multi-threaded target.  */
+ static struct target_ops *linux_ops;
+@@ -539,6 +548,11 @@ linux_child_follow_fork (struct target_o
  	}
        else
  	{
@@ -66,52 +68,75 @@
  	  target_detach (NULL, 0);
  	}
  
-@@ -940,7 +954,6 @@ lin_lwp_attach_lwp (ptid_t ptid, int ver
+@@ -942,9 +956,8 @@ lin_lwp_attach_lwp (ptid_t ptid)
       to happen.  */
    if (GET_LWP (ptid) != GET_PID (ptid) && lp == NULL)
      {
 -      pid_t pid;
        int status;
+-      int cloned = 0;
++      int cloned;
  
        if (ptrace (PTRACE_ATTACH, GET_LWP (ptid), 0, 0) < 0)
-@@ -958,10 +971,156 @@ lin_lwp_attach_lwp (ptid_t ptid, int ver
-       if (lp == NULL)
- 	lp = add_lwp (ptid);
+ 	{
+@@ -958,37 +971,20 @@ lin_lwp_attach_lwp (ptid_t ptid)
+ 	  return -1;
+ 	}
  
 -      if (debug_linux_nat)
 -	fprintf_unfiltered (gdb_stdlog,
 -			    "LLAL: PTRACE_ATTACH %s, 0, 0 (OK)\n",
 -			    target_pid_to_str (ptid));
-+      status = linux_ptrace_post_attach (lp);
+-
+-      pid = my_waitpid (GET_LWP (ptid), &status, 0);
+-      if (pid == -1 && errno == ECHILD)
+-	{
+-	  /* Try again with __WCLONE to check cloned processes.  */
+-	  pid = my_waitpid (GET_LWP (ptid), &status, __WCLONE);
+-	  cloned = 1;
++      status = linux_ptrace_post_attach (ptid, &cloned);
 +      if (status != 0)
 +        {
 +	  error (_("Thread %s exited: %s"), target_pid_to_str (ptid),
 +		 status_to_str (status));
-+	}
-+
+ 	}
+ 
+-      gdb_assert (pid == GET_LWP (ptid)
+-		  && WIFSTOPPED (status) && WSTOPSIG (status));
+-
+-      if (lp == NULL)
+-	lp = add_lwp (ptid);
++      /* ADD_LWP with TID only already after the WAITPID.  */
++      lp = add_lwp (ptid);
+       lp->cloned = cloned;
+ 
+-      target_post_attach (pid);
 +      target_post_attach (GET_LWP (ptid));
-+
-+      lp->stopped = 1;
-+    }
-+  else
-+    {
-+      /* We assume that the LWP representing the original process is
-+         already stopped.  Mark it as stopped in the data structure
-+         that the GNU/linux ptrace layer uses to keep track of
-+         threads.  Note that this won't have already been done since
-+         the main thread will have, we assume, been stopped by an
-+         attach from a different layer.  */
-+      if (lp == NULL)
-+	lp = add_lwp (ptid);
-+      lp->stopped = 1;
-+    }
-+
-+  if (verbose)
-+    printf_filtered (_("[New %s]\n"), target_pid_to_str (ptid));
-+
-+  return 0;
-+}
-+
+ 
+       lp->stopped = 1;
+-
+-      if (debug_linux_nat)
+-	{
+-	  fprintf_unfiltered (gdb_stdlog,
+-			      "LLAL: waitpid %s received %s\n",
+-			      target_pid_to_str (ptid),
+-			      status_to_str (status));
+-	}
+     }
+   else
+     {
+@@ -998,44 +994,202 @@ lin_lwp_attach_lwp (ptid_t ptid)
+          threads.  Note that this won't have already been done since
+          the main thread will have, we assume, been stopped by an
+          attach from a different layer.  */
+-      if (lp == NULL)
+-	lp = add_lwp (ptid);
+       lp->stopped = 1;
+     }
+ 
+   return 0;
+ }
+ 
 +/* Detect `T (stopped)' in `/proc/PID/status'.
 +   Other states including `T (tracing stop)' are reported as false.  */
 +
@@ -119,7 +144,7 @@
 +pid_is_stopped (pid_t pid)
 +{
 +  FILE *status_file;
-+  char buf[100]; 
++  char buf[100];
 +  int retval = 0;
 +
 +  snprintf (buf, sizeof (buf), "/proc/%d/status", (int) pid);
@@ -135,7 +160,7 @@
 +	      have_state = 1;
 +	      break;
 +	    }
-+	} 
++	}
 +      if (have_state && strstr (buf, "T (stopped)") != NULL)
 +	retval = 1;
 +      fclose (status_file);
@@ -206,11 +231,11 @@
 +   Similiar processing is being done in this file by WAIT_LWP.  */
 +
 +static int
-+linux_ptrace_post_attach (struct lwp_info *lp)
++linux_ptrace_post_attach (ptid_t ptid, int *cloned_return)
 +{
-+  ptid_t ptid = lp->ptid;
 +  unsigned long sig;
 +  int this_thread_was_stopped;
++  int cloned = 0;
 +
 +  if (debug_linux_nat)
 +    fprintf_unfiltered (gdb_stdlog,
@@ -232,52 +257,33 @@
 +    {
 +      pid_t pid;
 +      int status;
- 
-       pid = my_waitpid (GET_LWP (ptid), &status, 0);
-       if (pid == -1 && errno == ECHILD)
-@@ -974,13 +1133,7 @@ lin_lwp_attach_lwp (ptid_t ptid, int ver
- 		   target_pid_to_str (ptid), safe_strerror (errno));
- 	  lp->cloned = 1;
- 	}
--
--      gdb_assert (pid == GET_LWP (ptid)
--		  && WIFSTOPPED (status) && WSTOPSIG (status));
--
--      target_post_attach (pid);
--
--      lp->stopped = 1;
++
++      pid = my_waitpid (GET_LWP (ptid), &status, 0);
++      if (pid == -1 && errno == ECHILD)
++	{
++	  /* Try again with __WCLONE to check cloned processes.  */
++	  pid = my_waitpid (GET_LWP (ptid), &status, __WCLONE);
++	  cloned = 1;
++	}
++
 +      gdb_assert (pid == GET_LWP (ptid));
- 
-       if (debug_linux_nat)
- 	{
-@@ -989,22 +1142,32 @@ lin_lwp_attach_lwp (ptid_t ptid, int ver
- 			      target_pid_to_str (ptid),
- 			      status_to_str (status));
- 	}
--    }
--  else
--    {
--      /* We assume that the LWP representing the original process is
--         already stopped.  Mark it as stopped in the data structure
--         that the GNU/linux ptrace layer uses to keep track of
--         threads.  Note that this won't have already been done since
--         the main thread will have, we assume, been stopped by an
--         attach from a different layer.  */
--      if (lp == NULL)
--	lp = add_lwp (ptid);
--      lp->stopped = 1;
--    }
- 
--  if (verbose)
--    printf_filtered (_("[New %s]\n"), target_pid_to_str (ptid));
++
++      if (debug_linux_nat)
++	{
++	  fprintf_unfiltered (gdb_stdlog,
++			      "LLAL: waitpid %s received %s\n",
++			      target_pid_to_str (ptid),
++			      status_to_str (status));
++	}
++
 +      /* Check if the thread has exited.  */
 +      if (WIFEXITED (status) || WIFSIGNALED (status))
-+        return status;
++	return status;
 +      gdb_assert (WIFSTOPPED (status));
 +      sig = WSTOPSIG (status);
 +      gdb_assert (sig != 0);
 +      if (sig == SIGSTOP)
-+        break;
++	break;
 +
 +      /* As the second signal for stopped processes we send SIGSTOP.  */
 +      if (this_thread_was_stopped && sig == SIGCONT)
@@ -295,20 +301,22 @@
 +      if (ptrace (PTRACE_CONT, GET_LWP (ptid), NULL, (void *) sig) != 0)
 +	perror_with_name (("ptrace"));
 +    }
- 
-   return 0;
- }
-@@ -1013,7 +1176,6 @@ static void
++  *cloned_return = cloned;
++  return 0;
++}
++
+ static void
  linux_nat_attach (char *args, int from_tty)
  {
    struct lwp_info *lp;
 -  pid_t pid;
    int status;
+-  int cloned = 0;
++  int cloned;
  
    /* FIXME: We should probably accept a list of process id's, and
-@@ -1024,21 +1186,12 @@ linux_nat_attach (char *args, int from_t
-   inferior_ptid = BUILD_LWP (GET_PID (inferior_ptid), GET_PID (inferior_ptid));
-   lp = add_lwp (inferior_ptid);
+      attach all of them.  */
+   linux_ops->to_attach (args, from_tty);
  
 -  /* Make sure the initial process is stopped.  The user-level threads
 -     layer might want to poke around in the inferior, and that won't
@@ -320,21 +328,27 @@
 -
 -      /* Try again with __WCLONE to check cloned processes.  */
 -      pid = my_waitpid (GET_PID (inferior_ptid), &status, __WCLONE);
--      lp->cloned = 1;
+-      cloned = 1;
 -    }
 -
 -  gdb_assert (pid == GET_PID (inferior_ptid)
 -	      && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP);
-+  status = linux_ptrace_post_attach (lp);
+-
+   /* Add the initial process as the first LWP to the list.  */
+   inferior_ptid = BUILD_LWP (GET_PID (inferior_ptid), GET_PID (inferior_ptid));
++
++  status = linux_ptrace_post_attach (inferior_ptid, &cloned);
 +  if (status != 0)
 +    error (_("Program %s exited: %s\n"), target_pid_to_str (inferior_ptid),
 +	   status_to_str (status));
-+  if (lp->cloned)
++  if (cloned)
 +    warning (_("%s is a cloned process"), target_pid_to_str (inferior_ptid));
++
++  /* ADD_LWP with TID only already after the WAITPID.  */
+   lp = add_lwp (inferior_ptid);
+   lp->cloned = cloned;
  
-   lp->stopped = 1;
- 
-@@ -1047,8 +1200,8 @@ linux_nat_attach (char *args, int from_t
+@@ -1046,8 +1200,8 @@ linux_nat_attach (char *args, int from_t
    lp->resumed = 1;
    if (debug_linux_nat)
      {
@@ -345,7 +359,7 @@
      }
  }
  
-@@ -1093,6 +1246,9 @@ detach_callback (struct lwp_info *lp, vo
+@@ -1092,6 +1246,9 @@ detach_callback (struct lwp_info *lp, vo
       overall process id just yet.  */
    if (GET_LWP (lp->ptid) != GET_PID (lp->ptid))
      {
@@ -355,7 +369,7 @@
        errno = 0;
        if (ptrace (PTRACE_DETACH, GET_LWP (lp->ptid), 0,
  		  WSTOPSIG (lp->status)) < 0)
-@@ -1121,6 +1277,9 @@ linux_nat_detach (char *args, int from_t
+@@ -1120,6 +1277,9 @@ linux_nat_detach (char *args, int from_t
  
    trap_ptid = null_ptid;
  
@@ -365,9 +379,9 @@
    /* Destroy LWP info; it's no longer valid.  */
    init_lwp_list ();
  
-@@ -1258,6 +1417,14 @@ linux_nat_resume (ptid_t ptid, int step_
-       lp->stopped = 0;
-     }
+@@ -1255,6 +1415,14 @@ linux_nat_resume (ptid_t ptid, int step_
+      resume_callback.  */
+   lp->stopped = 0;
  
 +  /* At this point, we are going to resume the inferior and if we
 +     have attached to a stopped process, we no longer should leave
@@ -380,10 +394,11 @@
    if (resume_all)
      iterate_over_lwps (resume_callback, NULL);
  
-diff -u -X /home/short/.diffi.list -ruNp gdb-6.5-unpatched/gdb/doc/gdb.texinfo gdb-6.5/gdb/doc/gdb.texinfo
---- gdb-6.5-unpatched/gdb/doc/gdb.texinfo	2008-01-09 18:26:07.000000000 +0100
-+++ gdb-6.5/gdb/doc/gdb.texinfo	2008-01-09 15:26:30.000000000 +0100
-@@ -2190,16 +2190,29 @@ can step and continue; you can modify st
+Index: gdb-6.8cvs20080219/gdb/doc/gdb.texinfo
+===================================================================
+--- gdb-6.8cvs20080219.orig/gdb/doc/gdb.texinfo	2008-02-24 19:36:24.000000000 +0100
++++ gdb-6.8cvs20080219/gdb/doc/gdb.texinfo	2008-02-24 19:36:26.000000000 +0100
+@@ -2176,16 +2176,29 @@ can step and continue; you can modify st
  process continue running, you may use the @code{continue} command after
  attaching @value{GDBN} to the process.
  
@@ -418,4 +433,4 @@
 + at key{RET} again after executing the command.
  @end table
  
- If you exit @value{GDBN} or use the @code{run} command while you have an
+ If you exit @value{GDBN} while you have an attached process, you detach

gdb-6.7-bz426600-DW_TAG_interface_type-fix.patch:

Index: gdb-6.7-bz426600-DW_TAG_interface_type-fix.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.7-bz426600-DW_TAG_interface_type-fix.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- gdb-6.7-bz426600-DW_TAG_interface_type-fix.patch	7 Jan 2008 15:10:23 -0000	1.1
+++ gdb-6.7-bz426600-DW_TAG_interface_type-fix.patch	3 Mar 2008 16:13:47 -0000	1.2
@@ -1,13 +1,8 @@
+Original patch was:
 http://sourceware.org/ml/gdb-patches/2007-12/msg00397.html
 http://sourceware.org/ml/gdb-cvs/2007-12/msg00123.html
 
-2007-12-22  Jan Kratochvil  <jan.kratochvil at redhat.com>
-
-	* dwarf2read.c (scan_partial_symbols partial_die_parent_scope)
-	(add_partial_symbol, pdi_needs_namespace, process_die)
-	(is_type_tag_for_partial, load_partial_dies, new_symbol)
-	(read_type_die, determine_prefix): Extend the current code of
-	`DW_TAG_class_type' also for `DW_TAG_interface_type'.
+extended for the RHEL safety:
 
 2007-12-28  Jan Kratochvil  <jan.kratochvil at redhat.com>
 
@@ -15,93 +10,10 @@
 	`DW_TAG_class_type'-type backing for `DW_TAG_interface_type', even for
 	namespaces which should not apply for Java `DW_TAG_interface_type'.
 
-===================================================================
-RCS file: /cvs/src/src/gdb/dwarf2read.c,v
-retrieving revision 1.242
-retrieving revision 1.243
-diff -u -r1.242 -r1.243
---- src/gdb/dwarf2read.c	2007/12/17 18:38:30	1.242
-+++ src/gdb/dwarf2read.c	2007/12/22 20:58:30	1.243
-@@ -1747,6 +1747,7 @@
- 		}
- 	      break;
- 	    case DW_TAG_class_type:
-+	    case DW_TAG_interface_type:
- 	    case DW_TAG_structure_type:
- 	      if (!pdi->is_declaration)
- 		{
-@@ -1829,6 +1830,7 @@
-   if (parent->tag == DW_TAG_namespace
-       || parent->tag == DW_TAG_structure_type
-       || parent->tag == DW_TAG_class_type
-+      || parent->tag == DW_TAG_interface_type
-       || parent->tag == DW_TAG_union_type)
-     {
-       if (grandparent_scope == NULL)
-@@ -1976,6 +1978,7 @@
- 			   0, (CORE_ADDR) 0, cu->language, objfile);
-       break;
-     case DW_TAG_class_type:
-+    case DW_TAG_interface_type:
-     case DW_TAG_structure_type:
-     case DW_TAG_union_type:
-     case DW_TAG_enumeration_type:
-@@ -2057,6 +2060,7 @@
-     case DW_TAG_namespace:
-     case DW_TAG_typedef:
-     case DW_TAG_class_type:
-+    case DW_TAG_interface_type:
-     case DW_TAG_structure_type:
-     case DW_TAG_union_type:
-     case DW_TAG_enumeration_type:
-@@ -2676,6 +2680,7 @@
-       read_lexical_block_scope (die, cu);
-       break;
-     case DW_TAG_class_type:
-+    case DW_TAG_interface_type:
-     case DW_TAG_structure_type:
-     case DW_TAG_union_type:
-       read_structure_type (die, cu);
-@@ -5403,6 +5408,7 @@
- #endif
-     case DW_TAG_base_type:
-     case DW_TAG_class_type:
-+    case DW_TAG_interface_type:
-     case DW_TAG_enumeration_type:
-     case DW_TAG_structure_type:
-     case DW_TAG_subrange_type:
-@@ -5608,6 +5614,7 @@
- 	      || last_die->tag == DW_TAG_enumeration_type
- 	      || (cu->language != language_c
- 		  && (last_die->tag == DW_TAG_class_type
-+		      || last_die->tag == DW_TAG_interface_type
- 		      || last_die->tag == DW_TAG_structure_type
- 		      || last_die->tag == DW_TAG_union_type))))
- 	{
-@@ -7358,6 +7365,7 @@
- 	     (FIXME?) */
- 	  break;
- 	case DW_TAG_class_type:
-+	case DW_TAG_interface_type:
- 	case DW_TAG_structure_type:
- 	case DW_TAG_union_type:
- 	case DW_TAG_set_type:
-@@ -7677,6 +7685,7 @@
-   switch (die->tag)
-     {
-     case DW_TAG_class_type:
-+    case DW_TAG_interface_type:
-     case DW_TAG_structure_type:
-     case DW_TAG_union_type:
-       read_structure_type (die, cu);
-@@ -7781,6 +7790,7 @@
- 	}
- 	break;
-       case DW_TAG_class_type:
-+      case DW_TAG_interface_type:
-       case DW_TAG_structure_type:
- 	{
- 	  if (parent->type != NULL && TYPE_TAG_NAME (parent->type) != NULL)
+2008-02-24  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	Port to GDB-6.8pre.
+
 Index: ./gdb/dwarf2read.c
 ===================================================================
 RCS file: /cvs/src/src/gdb/dwarf2read.c,v

gdb-6.7-bz426600-DW_TAG_interface_type-test.patch:

Index: gdb-6.7-bz426600-DW_TAG_interface_type-test.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb-6.7-bz426600-DW_TAG_interface_type-test.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- gdb-6.7-bz426600-DW_TAG_interface_type-test.patch	7 Jan 2008 15:10:23 -0000	1.1
+++ gdb-6.7-bz426600-DW_TAG_interface_type-test.patch	3 Mar 2008 16:13:47 -0000	1.2
@@ -4,6 +4,10 @@
 
 	* gdb.arch/i386-interface.S, gdb.arch/i386-interface.exp: New files.
 
+2008-03-02  Jan Kratochvil  <jan.kratochvil at redhat.com>
+
+	* gdb.arch/i386-interface.exp: Fix a testcase race.
+
 --- /dev/null	1 Jan 1970 00:00:00 -0000
 +++ ./gdb/testsuite/gdb.arch/i386-interface.S	22 Dec 2007 19:07:28 -0000
 @@ -0,0 +1,628 @@
@@ -693,14 +697,14 @@
 +
 +set test "ptype Interface"
 +gdb_test_multiple $test $test {
-+    -re "type = class Interface  *extends java.lang.Object \{" {
++    -re "type = class Interface  *extends java.lang.Object \{.*$gdb_prompt $" {
 +	pass $test
 +    }
 +}
 +
 +set test "ptype Class"
 +gdb_test_multiple $test $test {
-+    -re "type = class Class  *extends java.lang.Object implements Interface \{" {
++    -re "type = class Class  *extends java.lang.Object implements Interface \{.*$gdb_prompt $" {
 +	pass $test
 +    }
 +}


Index: gdb.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/gdb.spec,v
retrieving revision 1.271
retrieving revision 1.272
diff -u -r1.271 -r1.272
--- gdb.spec	1 Mar 2008 08:03:38 -0000	1.271
+++ gdb.spec	3 Mar 2008 16:13:47 -0000	1.272
@@ -8,14 +8,14 @@
 # Set version to contents of gdb/version.in.
 # NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3 
 # and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch).
-Version: 6.7.1
+Version: 6.7.50.20080227
 
 # The release always contains a leading reserved number, start it at 1.
-Release: 16%{?dist}
+Release: 1%{?dist}
 
 License: GPL
 Group: Development/Debuggers
-Source: ftp://ftp.gnu.org/gnu/gdb/gdb-6.7.1.tar.bz2
+Source: ftp://sourceware.org/pub/gdb/snapshots/current/gdb-6.7.50.20080227.tar.bz2
 Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 URL: http://gnu.org/software/gdb/
 
@@ -82,10 +82,6 @@
 # Stop a backtrace when a zero PC is encountered.
 Patch106: gdb-6.3-framepczero-20040927.patch
 
-# Pass the pc's section into the symbol search code; stops the lookup
-# finding a symbol from the wrong section.
-Patch108: gdb-6.3-ppc64section-20041026.patch
-
 # Include the pc's section when doing a symbol lookup so that the
 # correct symbol is found.
 Patch111: gdb-6.3-ppc64displaysymbol-20041124.patch
@@ -95,9 +91,6 @@
 # Make upstream `set scheduler-locking step' as default.
 Patch260: gdb-6.6-scheduler_locking-step-is-default.patch
 
-# Threaded watchpoint support
-Patch113: gdb-6.3-threaded-watchpoints-20041213.patch
-
 # Continue removing breakpoints even when failure occurs.
 Patch117: gdb-6.3-removebp-20041130.patch
 
@@ -112,7 +105,6 @@
 Patch120: gdb-6.3-type-fix-20041213.patch
 
 # VSYSCALL and PIE
-Patch122: gdb-6.3-test-pie-20050107.patch
 Patch124: gdb-6.3-pie-20050110.patch
 
 # Get selftest working with sep-debug-info
@@ -140,9 +132,6 @@
 # Prevent gdb from being pushed into background
 Patch142: gdb-6.3-terminal-fix-20050214.patch
 
-# Allow sibling threads to set threaded watchpoints for x86 and x86-64
-Patch145: gdb-6.3-threaded-watchpoints2-20050225.patch
-
 # Fix unexpected compiler warning messages.
 Patch147: gdb-6.3-warnings-20050317.patch
 
@@ -162,9 +151,6 @@
 # IA64 sigtramp prev register patch
 Patch158: gdb-6.3-ia64-sigtramp-frame-20050708.patch
 
-# IA64 sigaltstack patch
-Patch159: gdb-6.3-ia64-sigaltstack-20050711.patch
-
 # IA64 gcore speed-up patch
 Patch160: gdb-6.3-ia64-gcore-speedup-20050714.patch
 
@@ -263,7 +249,7 @@
 Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch
 
 # Backported post gdb-6.7 release fixups.
-Patch232: gdb-6.7.1-upstream.patch
+#Patch232: gdb-6.7.1-upstream.patch
 
 # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
 Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch
@@ -271,9 +257,6 @@
 # Temporary support for shared libraries >2GB on 64bit hosts. (BZ 231832)
 Patch235: gdb-6.3-bz231832-obstack-2gb.patch
 
-# Suggest SELinux permissions problem; no assertion failure anymore (BZ 232371).
-Patch236: gdb-6.6-bz232371-selinux-thread-error.patch
-
 # Fix prelink(8) testcase for non-root $PATH missing `/usr/sbin' (BZ 225783).
 Patch240: gdb-6.6-bz225783-prelink-path.patch
 
@@ -283,18 +266,12 @@
 # Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517).
 Patch245: gdb-6.6-bz229517-gcore-without-terminal.patch
 
-# Fix testcase for watchpoints in threads (for BZ 237096).
-Patch246: gdb-6.6-bz237096-watchthreads-testcasefix.patch
-
 # Notify user of a child forked process being detached (BZ 235197).
 Patch247: gdb-6.6-bz235197-fork-detach-info.patch
 
 # New testcase for gcore of 32bit inferiors on 64bit hosts.
 Patch249: gdb-6.6-gcore32-test.patch
 
-# Enable PowerPC to print 128-bit long double variables (BZ 237872).
-Patch251: gdb-6.5-bz237872-ppc-long-double.patch
-
 # Avoid too long timeouts on failing cases of "annota1.exp annota3.exp".
 Patch254: gdb-6.6-testsuite-timeouts.patch
 
@@ -325,9 +302,6 @@
 # Fixed the kernel i386-on-x86_64 VDSO loading (producing `Lowest section in').
 Patch277: gdb-6.6-vdso-i386-on-amd64-warning.patch
 
-# Fix debug load for sparse assembler files (such as vDSO32 for i386-on-x86_64).
-Patch278: gdb-6.6-cu-ranges.patch
-
 # Fix hardware watchpoints after inferior forks-off some process.
 # Threaded `set follow-fork-mode child' still not fixed there, glibc fixes reqd.
 # `set detach-on-fork off' not fixed there in general - it already assert-fails.
@@ -362,12 +336,15 @@
 # Fix false `(no debugging symbols found)' on `-readnever' runs.
 Patch301: gdb-6.6-buildid-readnever-silent.patch
 
-# ia64 build fixes from Doug Chapman (BZ 428882).
-Patch303: gdb-6.7-bz428882-ia64-fix.patch
-
 # Fix #include <asm/ptrace.h> on kernel-headers-2.6.25-0.40.rc1.git2.fc9.x86_64.
 Patch304: gdb-6.7-kernel-headers-compat.patch
 
+# Fix/implement the Fortran dynamic arrays support (BZ 377541).
+Patch305: gdb-6.8-bz377541-fortran-dynamic-arrays.patch
+
+# Backport fix of a segfault + PIE regression since 6.7.1 on PIE executables.
+Patch306: gdb-6.8-watchpoint-inaccessible-memory.patch
+
 BuildRequires: ncurses-devel glibc-devel gcc make gzip texinfo dejagnu gettext
 BuildRequires: flex bison sharutils expat-devel
 Requires: readline
@@ -378,7 +355,7 @@
 # BuildRequires are set here only for the complete testsuite run.
 %if 0%{?_with_testsuite:1}
 # gcc-objc++ is not covered by the GDB testsuite.
-BuildRequires: gcc gcc-c++ gcc-gfortran gcc-java gcc-objc
+BuildRequires: gcc gcc-c++ gcc-gfortran gcc-java gcc-objc fpc
 # Copied from gcc-4.1.2-32
 %ifarch %{ix86} x86_64 ia64 ppc alpha
 BuildRequires: gcc-gnat
@@ -429,7 +406,7 @@
 
 # Apply patches defined above.
 
-%patch232 -p1
+#%patch232 -p1
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
@@ -440,15 +417,12 @@
 %patch104 -p1
 %patch105 -p1
 %patch106 -p1
-%patch108 -p1
 %patch111 -p1
 %patch112 -p1
-%patch113 -p1
 %patch117 -p1
 %patch118 -p1
 %patch119 -p1
 %patch120 -p1
-%patch122 -p1
 %patch124 -p1
 %patch125 -p1
 %patch128 -p1
@@ -458,7 +432,6 @@
 %patch141 -p1
 %patch259 -p1
 %patch142 -p1
-%patch145 -p1
 %patch147 -p1
 %patch148 -p1
 %patch150 -p1
@@ -466,7 +439,6 @@
 %patch153 -p1
 %patch157 -p1
 %patch158 -p1
-%patch159 -p1
 %patch160 -p1
 %patch161 -p1
 %patch162 -p1
@@ -501,14 +473,11 @@
 %patch231 -p1
 %patch234 -p1
 %patch235 -p1
-%patch236 -p1
 %patch240 -p1
 %patch241 -p1
 %patch245 -p1
-%patch246 -p1
 %patch247 -p1
 %patch249 -p1
-%patch251 -p1
 %patch254 -p1
 %patch256 -p1
 %patch258 -p1
@@ -521,7 +490,6 @@
 %patch275 -p1
 %patch276 -p1
 %patch277 -p1
-%patch278 -p1
 %patch280 -p1
 %patch282 -p1
 %patch283 -p1
@@ -533,17 +501,22 @@
 %patch296 -p1
 %patch298 -p1
 %patch301 -p1
-%patch303 -p1
 %patch304 -p1
+%patch305 -p1
+%patch306 -p1
+
+find -name "*.orig" | xargs rm -f
+! find -name "*.rej"	# Should not happen.
 
-# Change the version that gets printed at GDB startup, so it is RedHat
+# Change the version that gets printed at GDB startup, so it is Fedora
 # specific.
 cat > gdb/version.in << _FOO
-Red Hat Linux (%{version}-%{release}rh)
+Fedora (%{version}-%{release})
 _FOO
 
 # Remove the info and other generated files added by the FSF release
 # process.
+rm -f libdecnumber/gstdint.h
 rm -f bfd/doc/*.info
 rm -f bfd/doc/*.info-*
 rm -f gdb/doc/*.info
@@ -591,6 +564,7 @@
 	--disable-sim					\
 	--disable-rpath					\
 	--with-system-readline				\
+	--with-expat					\
 %ifarch ia64
 	--with-libunwind				\
 %else
@@ -763,6 +737,14 @@
 %{_mandir}/*/gdbserver.1*
 
 %changelog
+* Mon Mar  3 2008 Jan Kratochvil <jan.kratochvil at redhat.com> - 6.7.50.20080227-1
+- Upgrade to the upstream gdb-6.8 prerelease.
+- Cleanup the leftover `.orig' files during %%prep.
+- Add expat-devel check by the configure script (for the other-arch builds).
+- `--with testsuite' now also BuildRequires: fpc
+- Backport fix of a segfault + PIE regression since 6.7.1 on PIE executables.
+- Update the printed GDB version string to be Fedora specific.
+
 * Sat Mar  1 2008 Jan Kratochvil <jan.kratochvil at redhat.com> - 6.7.1-16
 - Run the full testsuite also in the `-fPIE -pie' mode.
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/devel/sources,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- sources	1 Nov 2007 22:28:37 -0000	1.23
+++ sources	3 Mar 2008 16:13:47 -0000	1.24
@@ -1 +1 @@
-30a6bf36eded4ae5a152d7d71b86dc14  gdb-6.7.1.tar.bz2
+79c01091740eda9b2ecf4981b603c477  gdb-6.7.50.20080227.tar.bz2


--- gdb-6.3-ia64-sigaltstack-20050711.patch DELETED ---


--- gdb-6.3-ppc64section-20041026.patch DELETED ---


--- gdb-6.3-test-pie-20050107.patch DELETED ---


--- gdb-6.3-threaded-watchpoints-20041213.patch DELETED ---


--- gdb-6.3-threaded-watchpoints2-20050225.patch DELETED ---


--- gdb-6.5-bz237872-ppc-long-double.patch DELETED ---


--- gdb-6.6-bz232371-selinux-thread-error.patch DELETED ---


--- gdb-6.6-bz237096-watchthreads-testcasefix.patch DELETED ---


--- gdb-6.6-cu-ranges.patch DELETED ---


--- gdb-6.7-bz428882-ia64-fix.patch DELETED ---


--- gdb-6.7.1-upstream.patch DELETED ---




More information about the fedora-extras-commits mailing list