From ad4fdd5fb5d5e693dd8169c87add558fe13b2e5d Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Thu, 22 May 2008 20:37:43 +0000 Subject: [PATCH] - Fix memory trashing on binaries from GNAT/Ada (workaround GCC PR 35998). --- gdb-6.7-testsuite-stable-results.patch | 23 ----------------------- gdb-6.8-gcc35998-ada-memory-trash.patch | 18 ++++++++++++++++++ gdb.spec | 9 ++++++++- 3 files changed, 26 insertions(+), 24 deletions(-) create mode 100644 gdb-6.8-gcc35998-ada-memory-trash.patch diff --git a/gdb-6.7-testsuite-stable-results.patch b/gdb-6.7-testsuite-stable-results.patch index f8d5199..1ce8a2e 100644 --- a/gdb-6.7-testsuite-stable-results.patch +++ b/gdb-6.7-testsuite-stable-results.patch @@ -121,26 +121,3 @@ if (args == NULL) error_no_arg (_("one or more choice numbers")); - - - -2008-04-21 Jan Kratochvil - - Workaround GCC PR ada/35998. - * ada-lang.c (to_fixed_record_type): Error out on invalid length of the - type TYPE0. - ---- ./gdb/ada-lang.c 6 Apr 2008 08:56:36 -0000 1.137 -+++ ./gdb/ada-lang.c 20 Apr 2008 21:47:05 -0000 -@@ -7313,6 +7313,11 @@ to_fixed_record_type (struct type *type0 - { - struct type *templ_type; - -+ /* GCC PR ada/35998 workaround. */ -+ if (TYPE_LENGTH (type0) == 0xffffffff) -+ error (_("Type %s has invalid length -1, check your GCC"), -+ TYPE_NAME (type0)); -+ - if (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE) - return type0; - diff --git a/gdb-6.8-gcc35998-ada-memory-trash.patch b/gdb-6.8-gcc35998-ada-memory-trash.patch new file mode 100644 index 0000000..1142cc9 --- /dev/null +++ b/gdb-6.8-gcc35998-ada-memory-trash.patch @@ -0,0 +1,18 @@ +--- ./gdb/dwarf2read.c 4 May 2008 17:27:01 -0000 1.260 ++++ ./gdb/dwarf2read.c 4 May 2008 18:26:20 -0000 +@@ -6754,7 +6754,14 @@ dwarf2_attr (struct die_info *die, unsig + for (i = 0; i < die->num_attrs; ++i) + { + if (die->attrs[i].name == name) +- return &die->attrs[i]; ++ { ++ /* GCC PR ada/35998 workaround. */ ++ if (name == DW_AT_byte_size ++ && DW_UNSND (&die->attrs[i]) == 0xffffffff) ++ return NULL; ++ ++ return &die->attrs[i]; ++ } + if (die->attrs[i].name == DW_AT_specification + || die->attrs[i].name == DW_AT_abstract_origin) + spec = &die->attrs[i]; diff --git a/gdb.spec b/gdb.spec index 02a4e47..d327741 100644 --- a/gdb.spec +++ b/gdb.spec @@ -13,7 +13,7 @@ Version: 6.8 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 8%{?_with_upstream:.upstream}%{?dist} +Release: 9%{?_with_upstream:.upstream}%{?dist} License: GPLv3+ Group: Development/Debuggers @@ -355,6 +355,9 @@ Patch316: gdb-6.8-sparc-fix.patch # Silence memcpy check which returns false positive (sparc64) Patch317: gdb-6.8-sparc64-silence-memcpy-check.patch +# Fix memory trashing on binaries from GCC Ada (workaround GCC PR 35998). +Patch318: gdb-6.8-gcc35998-ada-memory-trash.patch + BuildRequires: ncurses-devel glibc-devel gcc make gzip texinfo dejagnu gettext BuildRequires: flex bison sharutils expat-devel Requires: readline @@ -532,6 +535,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch315 -p1 %patch316 -p1 %patch317 -p1 +%patch318 -p1 %patch124 -p1 find -name "*.orig" | xargs rm -f @@ -781,6 +785,9 @@ fi %endif %changelog +* Thu May 22 2008 Jan Kratochvil - 6.8-9 +- Fix memory trashing on binaries from GNAT/Ada (workaround GCC PR 35998). + * Thu May 15 2008 Tom "spot" Callaway - 6.8-8 - Silence memcpy check which returns false positive (sparc64)