diff --git a/bnc329420-1.patch b/bnc329420-1.patch deleted file mode 100644 index b05c301..0000000 --- a/bnc329420-1.patch +++ /dev/null @@ -1,49 +0,0 @@ -On Wed, 13 May 2009, Sami Wagiaalla wrote: - -> This problem is due to the fact that in Archer we are using -> dwarf2_full_name instead of dwarf2_linkage_name. -> -> I am trying your patch but it does not seem to have solved the problem -> for me. Are you testing against the Archer fedora branch ( -> archer-jankratochvil-fedora-merge ) ? - -Meh, wrong patch, sorry. I must have had traces of my other approach -still in dwarf2read.c that this worked when I checked before sending. It -actually fixes only the partial DIEs and I'm not even sure if that's -necessary. It certainly does not fix the problem for reading full DIEs. -As it's a rather generic tree reader (read_die_and_children_1 and friends) -it seems a bit clumsy to special case bogus namespace dies there, which -brings me back to my other option (that's the one I started and tested -with), hacking determine_prefix, like below. That fixes the problem. -Really :-) - - -Ciao, -Michael. -Index: gdb-6.8.50.20090302/gdb/dwarf2read.c -=================================================================== ---- gdb-6.8.50.20090302.orig/gdb/dwarf2read.c 2009-05-13 15:53:22.000000000 +0200 -+++ gdb-6.8.50.20090302/gdb/dwarf2read.c 2009-05-13 23:48:52.000000000 +0200 -@@ -8885,9 +8894,18 @@ determine_prefix (struct die_info *die, - switch (parent->tag) - { - case DW_TAG_namespace: -- parent_type = read_type_die (parent, cu); -- /* We give a name to even anonymous namespaces. */ -- return TYPE_TAG_NAME (parent_type); -+ { -+ char *prefix; -+ parent_type = read_type_die (parent, cu); -+ /* We give a name to even anonymous namespaces. */ -+ prefix = TYPE_TAG_NAME (parent_type); -+ /* Special hack for bogus global namespace that is emitted as an -+ explicit namespace with the name '::' in g++ 4.1, for -+ some decls. */ -+ if (prefix[0] == ':' && prefix[1] == ':' && prefix[2] == 0) -+ return ""; -+ return prefix; -+ } - case DW_TAG_class_type: - case DW_TAG_interface_type: - case DW_TAG_structure_type: - diff --git a/bnc329420-2.patch b/bnc329420-2.patch deleted file mode 100644 index 346f965..0000000 --- a/bnc329420-2.patch +++ /dev/null @@ -1,128 +0,0 @@ -On Fri, 15 May 2009 21:44:43 +0200, Richard Guenther wrote: -> One more issue is that with g++ 4.1 -> -> #include -> const char foo_c[] = "here is foo_c"; -> int main() -> { -> puts(foo_c); -> return 0; -> } -> -> foo_c at main is printed as -> -> (gdb) p foo_c -> $1 = '\0' -> (gdb) ptype foo_c -> type = char [14] -> -> it works if I remove the puts call. It also works with g++ 4.2 and -> newer. I wonder if gdb is confused by g++ 4.1 using DW_AT_const_value -> for the string ... - -Yes, it looks so. But this issue is unrelated to the Archer patches, it is -a normal FSF GDB bug. - -Cross-posting and requesting commit approval. - -Regression tested on x86_64-unknown-linux-gnu. - - -Thanks, -Jan - - -gdb/ -2009-05-15 Jan Kratochvil - - Fix parsing DW_AT_const_value using DW_FORM_string. - * dwarf2read.c (dwarf2_const_value ): New. - -gdb/testsuite/ -2009-05-15 Jan Kratochvil - - * gdb.dwarf2/dw2-strp.exp (p a_string2, ptype a_string2): New. - * gdb.dwarf2/dw2-strp.S (a_string2): New. - ---- gdb/dwarf2read.c 1 May 2009 14:43:20 -0000 1.302 -+++ gdb/dwarf2read.c 15 May 2009 20:44:44 -0000 -@@ -7957,6 +7957,7 @@ dwarf2_const_value (struct attribute *at - DW_ADDR (attr)); - SYMBOL_CLASS (sym) = LOC_CONST_BYTES; - break; -+ case DW_FORM_string: - case DW_FORM_strp: - /* DW_STRING is already allocated on the obstack, point directly - to it. */ ---- gdb/testsuite/gdb.dwarf2/dw2-strp.S 31 Mar 2009 20:21:08 -0000 1.4 -+++ gdb/testsuite/gdb.dwarf2/dw2-strp.S 15 May 2009 20:44:44 -0000 -@@ -52,17 +52,23 @@ - .byte 1 /* DW_AT_byte_size */ - .byte 6 /* DW_AT_encoding */ - -- .uleb128 5 /* Abbrev: DW_TAG_variable */ -+ .uleb128 5 /* Abbrev: DW_TAG_variable DW_FORM_strp */ - .4byte .Lvarname /* DW_AT_name */ - .4byte .Lconst_type-.Lcu1_begin/* DW_AT_type */ - .4byte .Lvarcontents /* DW_AT_const_value */ - .byte 1 /* DW_AT_external */ - -+ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */ -+ .string "a_string2" /* DW_AT_name */ -+ .4byte .Lconst_type-.Lcu1_begin/* DW_AT_type */ -+ .string "hello world2\n" /* DW_AT_const_value */ -+ .byte 1 /* DW_AT_external */ -+ - .Lconst_type: -- .uleb128 6 /* Abbrev: DW_TAG_const_type */ -+ .uleb128 7 /* Abbrev: DW_TAG_const_type */ - .4byte .Larray_type-.Lcu1_begin/* DW_AT_type */ - -- .uleb128 7 /* Abbrev: DW_TAG_variable (name "") */ -+ .uleb128 8 /* Abbrev: DW_TAG_variable (name "") */ - .4byte .Lemptyname /* DW_AT_name */ - - .byte 0 /* End of children of CU */ -@@ -125,6 +131,20 @@ - .byte 0x0 /* Terminator */ - - .uleb128 6 /* Abbrev code */ -+ .uleb128 0x34 /* DW_TAG_variable */ -+ .byte 0x0 /* no_children */ -+ .uleb128 0x3 /* DW_AT_name */ -+ .uleb128 0x8 /* DW_FORM_string */ -+ .uleb128 0x49 /* DW_AT_type */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .uleb128 0x1c /* DW_AT_const_value */ -+ .uleb128 0x8 /* DW_FORM_string */ -+ .uleb128 0x3f /* DW_AT_external */ -+ .uleb128 0xc /* DW_FORM_flag */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 7 /* Abbrev code */ - .uleb128 0x26 /* DW_TAG_const_type */ - .byte 0x0 /* DW_children_no */ - .uleb128 0x49 /* DW_AT_type */ -@@ -132,7 +152,7 @@ - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ - -- .uleb128 7 /* Abbrev code */ -+ .uleb128 8 /* Abbrev code */ - .uleb128 0x34 /* DW_TAG_variable */ - .byte 0x0 /* DW_children_no */ - .uleb128 0x3 /* DW_AT_name */ ---- gdb/testsuite/gdb.dwarf2/dw2-strp.exp 3 Jan 2009 05:58:04 -0000 1.2 -+++ gdb/testsuite/gdb.dwarf2/dw2-strp.exp 15 May 2009 20:44:44 -0000 -@@ -48,5 +48,8 @@ gdb_start - gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${binfile} - --gdb_test "p a_string" "\\\$1 = \"hello world!\\\\n\"" -+gdb_test "p a_string" " = \"hello world!\\\\n\"" - gdb_test "ptype a_string" "type = char \\\[14\\\]" -+ -+gdb_test "p a_string2" " = \"hello world2\\\\n\"" -+gdb_test "ptype a_string2" "type = char \\\[14\\\]" - diff --git a/fix-symread-crash.diff b/fix-symread-crash.diff new file mode 100644 index 0000000..ac8a043 --- /dev/null +++ b/fix-symread-crash.diff @@ -0,0 +1,28 @@ +Index: gdb-6.8.50.20090302/gdb/symfile.c +=================================================================== +--- gdb-6.8.50.20090302.orig/gdb/symfile.c 2009-07-28 12:49:19.000000000 +0200 ++++ gdb-6.8.50.20090302/gdb/symfile.c 2009-07-28 13:44:06.000000000 +0200 +@@ -2342,8 +2342,14 @@ find_separate_debug_file (struct objfile + gdb_assert (i >= 0 && IS_DIR_SEPARATOR (dir[i])); + dir[i+1] = '\0'; + ++ canon_name = lrealpath (dir); ++ i = strlen (dir); ++ if (canon_name ++ && strlen (canon_name) > i) ++ i = strlen (canon_name); ++ + debugfile = xmalloc (strlen (debug_file_directory) + 1 +- + strlen (dir) ++ + i /* MAX (strlen (canon_name), strlen (dir)) */ + + strlen (DEBUG_SUBDIRECTORY) + + strlen ("/") + + strlen (basename) +@@ -2376,7 +2382,6 @@ find_separate_debug_file (struct objfile + + /* If the file is in the sysroot, try using its base path in the + global debugfile directory. */ +- canon_name = lrealpath (dir); + if (canon_name + && strncmp (canon_name, gdb_sysroot, strlen (gdb_sysroot)) == 0 + && IS_DIR_SEPARATOR (canon_name[strlen (gdb_sysroot)])) diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index 8715abb..f075661 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -67,7 +67,7 @@ Index: gdb-6.8.50.20090226/gdb/gstack.sh =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ gdb-6.8.50.20090226/gdb/gstack.sh 2009-02-26 22:10:05.000000000 +0100 -@@ -0,0 +1,45 @@ +@@ -0,0 +1,48 @@ +#!/bin/sh + +if test $# -ne 1; then @@ -107,6 +107,9 @@ Index: gdb-6.8.50.20090226/gdb/gstack.sh + +# Run GDB, strip out unwanted noise. +$GDB --quiet $readnever -nx /proc/$1/exe $1 <&1 | ++set width 0 ++set height 0 ++set pagination no +$backtrace +EOF +sed -n \ diff --git a/gdb-6.3-gstack-without-path-20060414.patch b/gdb-6.3-gstack-without-path-20060414.patch index b39300f..d4ab141 100644 --- a/gdb-6.3-gstack-without-path-20060414.patch +++ b/gdb-6.3-gstack-without-path-20060414.patch @@ -24,7 +24,7 @@ Index: gdb-6.3/gdb/gstack.sh if $GDB -nx --quiet --batch --readnever > /dev/null 2>&1; then readnever=--readnever @@ -39,7 +39,7 @@ fi - $GDB --quiet $readnever -nx /proc/$1/exe $1 <&1 | + set pagination no $backtrace EOF -sed -n \ diff --git a/gdb-6.3-mapping-zero-inode-test.patch b/gdb-6.3-mapping-zero-inode-test.patch index 4537985..5393ab3 100644 --- a/gdb-6.3-mapping-zero-inode-test.patch +++ b/gdb-6.3-mapping-zero-inode-test.patch @@ -1,7 +1,9 @@ ---- /dev/null 2008-05-02 23:36:22.370004160 +0200 -+++ gdb-6.8/gdb/testsuite/gdb.base/gcore-shmid0.exp 2008-05-03 22:36:56.000000000 +0200 -@@ -0,0 +1,120 @@ -+# Copyright 2007 Free Software Foundation, Inc. +Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.exp 2009-06-29 16:24:36.000000000 +0200 +@@ -0,0 +1,96 @@ ++# Copyright 2007, 2009 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 @@ -17,43 +19,22 @@ +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + -+# Please email any bugs, comments, and/or additions to this file to: -+# bug-gdb@prep.ai.mit.edu -+ +# Test GDB's handling of gcore for mapping with a name but zero inode. + -+set testfile "gcore-shmid0" -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ untested gcore.exp -+ return -1 ++if { [prepare_for_testing gcore-shmid0.exp gcore-shmid0] } { ++ return -1 +} + -+# Start with a fresh gdb. -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ +# Does this gdb support gcore? -+send_gdb "help gcore\n" -+gdb_expect { ++set test "help gcore" ++gdb_test_multiple $test $test { + -re "Undefined command: .gcore.*$gdb_prompt $" { + # gcore command not supported -- nothing to test here. + unsupported "gdb does not support gcore on this target" + return -1; + } + -re "Save a core file .*$gdb_prompt $" { -+ pass "help gcore" -+ } -+ -re ".*$gdb_prompt $" { -+ fail "help gcore" -+ } -+ timeout { -+ fail "help gcore (timeout)" ++ pass $test + } +} + @@ -86,9 +67,6 @@ + -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" { + unsupported $test + } -+ eof { -+ fail $test -+ } +} + +# Be sure to remove the handle first. @@ -121,10 +99,12 @@ + fail $test + } +} ---- /dev/null 2008-05-02 23:36:22.370004160 +0200 -+++ gdb-6.8/gdb/testsuite/gdb.base/gcore-shmid0.c 2008-05-03 22:39:10.000000000 +0200 -@@ -0,0 +1,95 @@ -+/* Copyright 2007 Free Software Foundation, Inc. +Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.c 2009-06-29 16:22:49.000000000 +0200 +@@ -0,0 +1,123 @@ ++/* Copyright 2007, 2009 Free Software Foundation, Inc. + + This file is part of GDB. + @@ -155,7 +135,10 @@ +#include +#include + -+/* We need a backtrace through the stack. */ ++/* The same test running in a parallel testsuite may steal us the zero SID, ++ even if we never get any EEXIST. Just try a while. */ ++ ++#define TIMEOUT_SEC 10 + +static void +initialized (void) @@ -172,19 +155,41 @@ +{ + int sid; + unsigned int *addr = (void *) -1L; -+ int try; ++ int attempt, round = 0; ++ time_t ts_start, ts; + -+ /* The generated SID will cycle with an increment of 32768, try until it ++ if (time (&ts_start) == (time_t) -1) ++ { ++ printf ("time (): %m\n"); ++ exit (1); ++ } ++ ++ /* The generated SID will cycle with an increment of 32768, attempt until it + * wraps to 0. */ + -+ for (try = 0; addr == (void *) -1L; try++) ++ for (attempt = 0; addr == (void *) -1L; attempt++) + { -+ /* At least kernel-2.6.25-8.fc9.x86_64 just never returns the value 0 by -+ shmget(2). */ -+ if (try > 0x10000) ++ /* kernel-2.6.25-8.fc9.x86_64 just never returns the value 0 by ++ shmget(2). shmget returns SID range 0..1<<31 in steps of 32768, ++ 0x1000 should be enough but wrap the range it to be sure. */ ++ ++ if (attempt > 0x21000) + { -+ printf ("Problem no longer reproducible on this kernel (try %d)\n", -+ try); ++ if (time (&ts) == (time_t) -1) ++ { ++ printf ("time (): %m\n"); ++ exit (1); ++ } ++ ++ if (ts >= ts_start && ts < ts_start + TIMEOUT_SEC) ++ { ++ attempt = 0; ++ round++; ++ continue; ++ } ++ ++ printf ("Problem is not reproducible on this kernel (attempt %d, " ++ "round %d))\n", attempt, round); + unresolved (); + exit (1); + } @@ -192,6 +197,9 @@ + sid = shmget ((key_t) rand (), 0x1000, IPC_CREAT | IPC_EXCL | 0777); + if (sid == -1) + { ++ if (errno == EEXIST) ++ continue; ++ + printf ("shmget (%d, 0x1000, IPC_CREAT): errno %d\n", 0, errno); + exit (1); + } diff --git a/gdb-6.3-pie-20050110.patch b/gdb-6.3-pie-20050110.patch index 4434ae5..7e10179 100644 --- a/gdb-6.3-pie-20050110.patch +++ b/gdb-6.3-pie-20050110.patch @@ -276,7 +276,7 @@ Index: gdb-6.8.50.20090302/gdb/breakpoint.c + if (((b->type == bp_breakpoint) || + (b->type == bp_hardware_breakpoint)) && + b->enable_state == bp_enabled && -+ !b->loc->duplicate) ++ b->loc != NULL && !b->loc->duplicate) + { + b->enable_state = bp_startup_disabled; + if (!silent) diff --git a/gdb-6.3-rh-testlibunwind-20041202.patch b/gdb-6.3-rh-testlibunwind-20041202.patch index 2abfd68..6830557 100644 --- a/gdb-6.3-rh-testlibunwind-20041202.patch +++ b/gdb-6.3-rh-testlibunwind-20041202.patch @@ -3,11 +3,53 @@ From Jeff Johnston * gdb.arch/ia64-libunwind.exp: New file. * gdb.arch/ia64-libunwind.c: New file. + +2004-08-03 Jeff Johnston + + * gdb.arch/ia64-libunwind.exp: Fix test string to match + current code base. + + [ acquire_unwind_info -> ia64_find_proc_info_x ] + +2009-04-30 Jan Kratochvil + + Remove a race from send_gdb "COMMAND\n". + Cleanup. + Merge in: Patch4: gdb-6.3-rh-testlibunwind1fix-20041202.patch ---- /dev/null Thu Apr 11 10:25:15 2002 -+++ gdb+dejagnu-20040223/gdb/testsuite/gdb.arch/ia64-libunwind.exp Mon Nov 17 15:57:04 2003 -@@ -0,0 +1,55 @@ -+# Copyright 2003 Free Software Foundation, Inc. +--- /dev/null 2009-04-19 08:52:54.499000000 +0200 ++++ gdb-6.8/gdb/testsuite/gdb.arch/ia64-libunwind.c 2009-04-30 19:15:16.000000000 +0200 +@@ -0,0 +1,26 @@ ++/* Copyright 2003, 2009 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 . */ ++ ++#include ++ ++int ++main () ++{ ++ printf ("hello world\n"); ++ ++ return 0; ++} +--- /dev/null 2009-04-19 08:52:54.499000000 +0200 ++++ gdb-6.8/gdb/testsuite/gdb.arch/ia64-libunwind.exp 2009-04-30 19:19:22.000000000 +0200 +@@ -0,0 +1,52 @@ ++# Copyright 2003, 2009 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 @@ -28,16 +70,6 @@ + +# This file was written by Jeff Johnston (jjohnstn@redhat.com) + -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+# -+# test running programs -+# -+set prms_id 0 -+set bug_id 0 -+ +if ![istarget "ia64-*-*"] then { + return +} @@ -58,19 +90,14 @@ +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} -+send_gdb "set debug arch 1\n" -+send_gdb "break main\n" -+gdb_test "run" ".*acquire_unwind_info.*" -+ ---- /dev/null Thu Apr 11 10:25:15 2002 -+++ gdb+dejagnu-20040223/gdb/testsuite/gdb.arch/ia64-libunwind.c Mon Nov 17 15:58:27 2003 -@@ -0,0 +1,9 @@ -+#include + -+int main() -+{ -+ printf ("hello world\n"); -+ -+ return 0; ++gdb_test "set debug arch 1" ++gdb_breakpoint "main" ++gdb_run_cmd ++ ++set test "libunwind message" ++gdb_test_multiple "" $test { ++ -re "ia64_find_proc_info_x.*$gdb_prompt $" { ++ pass $test ++ } +} -+ diff --git a/gdb-6.3-rh-testlibunwind1fix-20041202.patch b/gdb-6.3-rh-testlibunwind1fix-20041202.patch deleted file mode 100644 index 8a4f6ab..0000000 --- a/gdb-6.3-rh-testlibunwind1fix-20041202.patch +++ /dev/null @@ -1,14 +0,0 @@ -2004-08-03 Jeff Johnston - - * gdb.arch/ia64-libunwind.exp: Fix test string to match - current code base. - ---- gdb+dejagnu-20040607/gdb/testsuite/gdb.arch/ia64-libunwind.exp.fix Tue Aug 3 18:29:22 2004 -+++ gdb+dejagnu-20040607/gdb/testsuite/gdb.arch/ia64-libunwind.exp Tue Aug 3 18:41:01 2004 -@@ -51,5 +51,5 @@ gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${binfile} - send_gdb "set debug arch 1\n" - send_gdb "break main\n" --gdb_test "run" ".*acquire_unwind_info.*" -+gdb_test "run" ".*ia64_find_proc_info_x.*" - diff --git a/gdb-6.3-test-pie-20050107.patch b/gdb-6.3-test-pie-20050107.patch index d6d6b46..70c27d4 100644 --- a/gdb-6.3-test-pie-20050107.patch +++ b/gdb-6.3-test-pie-20050107.patch @@ -873,7 +873,7 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp 2008-12-09 17:24:34.000000000 +0100 -@@ -0,0 +1,973 @@ +@@ -0,0 +1,977 @@ +# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2002, 2003, 2004 +# Free Software Foundation, Inc. @@ -1055,6 +1055,9 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp +set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1] +set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1] + ++# Test a pending breakpoint in PIE executable does not crash later GDB. ++gdb_breakpoint "non_existent_function" allow-pending ++ +gdb_test "info break" \ + "Num\[ \]+Type\[ \]+Disp Enb Address\[ \]+What.* +\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.* @@ -1064,7 +1067,8 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp +\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.* +\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location2.* +\[0-9\]+\[\t \]+breakpoint keep y.* in multi_line_if_conditional at .*$srcfile:$bp_location3.* -+\[0-9\]+\[\t \]+breakpoint keep y.* in multi_line_while_conditional at .*$srcfile:$bp_location4" \ ++\[0-9\]+\[\t \]+breakpoint keep y.* in multi_line_while_conditional at .*$srcfile:$bp_location4.* ++\[0-9\]+\[\t \]+breakpoint keep y.* *non_existent_function" \ + "breakpoint info" + +# FIXME: The rest of this test doesn't work with anything that can't @@ -1490,7 +1494,7 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp +} +send_gdb "print marker2(99)\n" +gdb_expect { -+ -re "The program being debugged stopped while in a function called from GDB.\r\nWhen the function .marker2$proto. is done executing, GDB will silently\r\nstop .instead of continuing to evaluate the expression containing\r\nthe function call...*$gdb_prompt $"\ ++ -re "The program being debugged stopped while in a function called from GDB.\r\nEvaluation of the expression containing the function\r\n.marker2$proto. will be abandoned.\r\nWhen the function is done executing, GDB will silently stop.\r\n$gdb_prompt $"\ + {pass "hit breakpoint on called function"} + -re "$gdb_prompt $"\ + {fail "hit breakpoint on called function"} diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index 6a90616..15edcb7 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -421,7 +421,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c } @@ -1802,14 +2154,33 @@ debug_print_missing (const char *binary, - } + *slot = missing_filepair; - /* We do not collect and flush these messages as each such message diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 146f787..511b4a7 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -13,7 +13,7 @@ Index: gdb-6.8.50.20090302/gdb/corelow.c #ifndef O_LARGEFILE -@@ -267,6 +271,56 @@ add_to_thread_list (bfd *abfd, asection +@@ -267,6 +271,50 @@ add_to_thread_list (bfd *abfd, asection inferior_ptid = ptid; /* Yes, make it current */ } @@ -26,6 +26,7 @@ Index: gdb-6.8.50.20090302/gdb/corelow.c + struct build_id *build_id; + char *exec_filename, *debug_filename; + char *build_id_filename; ++ struct cleanup *back_to; + + if (exec_bfd != NULL) + return; @@ -37,32 +38,25 @@ Index: gdb-6.8.50.20090302/gdb/corelow.c + if (build_id == NULL) + return; + ++ /* SYMFILE_OBJFILE should refer to the main executable (not only to its ++ separate debug info file). gcc44+ keeps .eh_frame only in the main ++ executable without its duplicate .debug_frame in the separate debug info ++ file - such .eh_frame would not be found if SYMFILE_OBJFILE would refer ++ directly to the separate debug info file. */ ++ + exec_filename = build_id_to_filename (build_id, &build_id_filename, 0); ++ back_to = make_cleanup (xfree, build_id_filename); ++ + if (exec_filename != NULL) -+ exec_file_attach (exec_filename, from_tty); ++ { ++ make_cleanup (xfree, exec_filename); ++ exec_file_attach (exec_filename, from_tty); ++ symbol_file_add_main (exec_filename, from_tty); ++ } + else + debug_print_missing (_("the main executable file"), build_id_filename); -+ xfree (build_id_filename); + -+ /* `.note.gnu.build-id' section exists even for files without a separate -+ debuginfo. */ -+ debug_filename = build_id_to_filename (build_id, &build_id_filename, 1); -+ if (debug_filename != NULL) -+ { -+ symbol_file_add_main (debug_filename, from_tty); -+ xfree (debug_filename); -+ } -+ else -+ { -+ if (exec_filename != NULL) -+ symbol_file_add_main (exec_filename, from_tty); -+ /* For EXEC_FILENAME NULL we were already complaining above. */ -+ if (symfile_objfile == NULL && exec_filename != NULL) -+ debug_print_missing (exec_filename, build_id_filename); -+ } -+ xfree (build_id_filename); -+ -+ xfree (exec_filename); ++ do_cleanups (back_to); + + /* No automatic SOLIB_ADD as the libraries would get read twice. */ +} @@ -646,7 +640,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c if (retval != NULL && !build_id_verify (retval, build_id)) { -@@ -1279,9 +1676,142 @@ build_id_to_debug_filename (struct build +@@ -1279,9 +1676,150 @@ build_id_to_debug_filename (struct build retval = NULL; } @@ -700,8 +694,8 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c + const struct missing_filepair *elem2) +{ + return strcmp (elem1->binary, elem2->binary) == 0 -+ && ((elem1->debug == NULL && elem2->debug == NULL) -+ || strcmp (elem1->debug, elem2->debug) == 0); ++ && ((elem1->debug == NULL) == (elem2->debug == NULL)) ++ && (elem1->debug == NULL || strcmp (elem1->debug, elem2->debug) == 0); +} + +static void @@ -732,6 +726,7 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c +{ + size_t binary_len0 = strlen (binary) + 1; + size_t debug_len0 = debug ? strlen (debug) + 1 : 0; ++ struct missing_filepair missing_filepair_find; + struct missing_filepair *missing_filepair; + struct missing_filepair **slot; + @@ -747,6 +742,27 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c + missing_filepair_xcalloc, NULL); + } + ++ /* Use MISSING_FILEPAIR_FIND first instead of calling obstack_alloc with ++ obstack_free in the case of a (rare) match. The problem is ALLOC_F for ++ MISSING_FILEPAIR_HASH allocates from MISSING_FILEPAIR_OBSTACK maintenance ++ structures for MISSING_FILEPAIR_HASH. Calling obstack_free would possibly ++ not to free only MISSING_FILEPAIR but also some such structures (allocated ++ during the htab_find_slot call). */ ++ ++ missing_filepair_find.binary = (char *) binary; ++ missing_filepair_find.debug = (char *) debug; ++ slot = (struct missing_filepair **) htab_find_slot (missing_filepair_hash, ++ &missing_filepair_find, ++ INSERT); ++ ++ /* While it may be still printed duplicitely with the missing debuginfo file ++ * it is due to once printing about the binary file build-id link and once ++ * about the .debug file build-id link as both the build-id symlinks are ++ * located in the debuginfo package. */ ++ ++ if (*slot != NULL) ++ return; ++ + missing_filepair = obstack_alloc (&missing_filepair_obstack, + sizeof (*missing_filepair) - 1 + + binary_len0 + debug_len0); @@ -760,20 +776,6 @@ Index: gdb-6.8.50.20090302/gdb/symfile.c + else + missing_filepair->debug = NULL; + -+ slot = (struct missing_filepair **) htab_find_slot (missing_filepair_hash, -+ missing_filepair, -+ INSERT); -+ -+ /* While it may be still printed duplicitely with the missing debuginfo file -+ * it is due to once printing about the binary file build-id link and once -+ * about the .debug file build-id link as both the build-id symlinks are -+ * located in the debuginfo package. */ -+ -+ if (*slot != NULL) -+ { -+ obstack_free (&missing_filepair_obstack, missing_filepair); -+ return; -+ } + *slot = missing_filepair; + + /* We do not collect and flush these messages as each such message diff --git a/gdb-6.8-bz457187-largefile-test.patch b/gdb-6.8-bz457187-largefile-test.patch new file mode 100644 index 0000000..287013c --- /dev/null +++ b/gdb-6.8-bz457187-largefile-test.patch @@ -0,0 +1,105 @@ +--- /dev/null 2009-04-19 14:49:00.974648389 +0200 ++++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.exp 2009-04-19 16:30:12.000000000 +0200 +@@ -0,0 +1,61 @@ ++# This testcase is part of GDB, the GNU debugger. ++ ++# Copyright 2009 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. ++ ++# Test ability to load an elf64-i386 core file. The provided core file was ++# elf64-x8664 one but it got binary patched to i386: ++# Elf32_Ehdr.e_machine @0x12..0x13 ++# Elf64_Ehdr.e_machine @0x12..0x13 ++# #define EM_386 3 /* Intel 80386 */ ++# #define EM_X86_64 62 /* AMD x86-64 architecture */ ++# patch @0x12: 0x3E -> 0x03 ++ ++if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then { ++ verbose "Skipping i386-biarch-core test." ++ return ++} ++ ++set testfile "i386-biarch-core" ++set corebz2uufile ${srcdir}/${subdir}/${testfile}.core.bz2.uu ++set corefile ${objdir}/${subdir}/${testfile}.core ++# Entry point of the original executable. ++set address 0x400078 ++ ++if {[catch "system \"uudecode -o - ${corebz2uufile} | bzip2 -dc >${corefile}\""] != 0} { ++ untested "failed uudecode or bzip2" ++ return -1 ++} ++file stat ${corefile} corestat ++if {$corestat(size) != 102400} { ++ untested "uudecode or bzip2 produce invalid result" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++ ++# Wrongly built GDB complains by: ++# "..." is not a core dump: File format not recognized ++# As the provided test core has 64bit PRSTATUS i386 built GDB cannot parse it. ++# This is just a problem of the test care, real-world elf64-i386 file will have ++# 32bit PRSTATUS. One cannot prepare elf64-i386 core file from elf32-i386 by ++# objcopy as it corrupts the core file beyond all recognition. ++# "\r\nCore was generated by `\[^\r\n\]*'\\.\r\nProgram terminated with signal 11, Segmentation fault\\.\r\n.*" ++gdb_test "core-file ${corefile}" ++ ++gdb_test "x/i $address" "\r\n$address:\[ \t\]*hlt\[ \t\]*" ".text is readable" +--- /dev/null 2009-04-19 14:49:00.974648389 +0200 ++++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.S 2009-04-19 14:52:28.000000000 +0200 +@@ -0,0 +1,22 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2009 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. ++ */ ++ ++ .globl _start ++_start: ++ hlt +--- /dev/null 2009-04-19 14:49:00.974648389 +0200 ++++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.core.bz2.uu 2009-04-19 15:02:12.000000000 +0200 +@@ -0,0 +1,13 @@ ++begin 600 i386-biarch-core.core.bz2 ++M0EIH.3%!629361`P1\P`!)?_____\9'@"8Q)6P380'9@'&#`0D@``"``%(`` ++M@`#`"!<(L`%F"(:$GH13::F-)M&D&U,AD:`--#)M0&FT0XR9--,)D9`P(Q-& ++M",(-&F``02)%38HT]0T`&AH```'H@``T^>9T*(,("&)SE`>`9@+GP=[,N)KB ++M'I8BL(L]N5TCY\%V]/?DB.BN*UZ'U@]TN7-]UJ5\_%0QTT<*086#%MHT7XVJ ++M9D"+C!"2*L:8D1XPD!`--M@*XT1H5RFYN&)(!0P0#:`I:;2;$5M&\*9"0@%: ++MK@X[T()M)9N7`D$VA!^63)%,;@8LT`(7\K&[7G;U:"B6'!GG+46ALOZF.2F- ++M!@>C*%86X$-]C2`KE;HG)UL(913VR2G]0BD:J=Z_`G@S,`W%.8RMS-#5P:J0 ++MAJ2\8&X?@DE;UF68QHM<,D`('::J65/S:PAG*R-09["8DBI)'V]Y.[(/AM*L ++M"X_O^V;%FY.S6Q]FM=D37>5F,%4-F1ZF#,CFJVU;H*^IT<(% + + * infcall.c (show_unwind_on_terminating_exception_p): New + function. + (call_function_by_hand): Create breakpoint and clean-up call for + std::terminate.breakpoint. Add unwind_on_terminating_exception_p + gate. Pop frame on breakpoint hit. + (_initialize_infcall): Add add_setshow_boolean_cmd for + unwind-on-terminating-exception. + +gdb/doc/ +2009-06-15 Phil Muldoon + + * doc/gdb.texinfo (Calling): Document + set-unwind-on-terminating-exception usage. + +gdb/testsuite/ +2009-06-15 Phil Muldoon + + * gdb.cp/gdb2495.cc: New file. + * gdb.cp/gdb2495.exp: New file. + +--- src/gdb/infcall.c 2009/05/28 00:53:51 1.114 ++++ src/gdb/infcall.c 2009/06/15 12:11:36 1.115 +@@ -98,6 +98,30 @@ + value); + } + ++/* This boolean tells what gdb should do if a std::terminate call is ++ made while in a function called from gdb (call dummy). ++ As the confines of a single dummy stack prohibit out-of-frame ++ handlers from handling a raised exception, and as out-of-frame ++ handlers are common in C++, this can lead to no handler being found ++ by the unwinder, and a std::terminate call. This is a false positive. ++ If set, gdb unwinds the stack and restores the context to what it ++ was before the call. ++ ++ The default is to unwind the frame if a std::terminate call is ++ made. */ ++ ++static int unwind_on_terminating_exception_p = 1; ++ ++static void ++show_unwind_on_terminating_exception_p (struct ui_file *file, int from_tty, ++ struct cmd_list_element *c, ++ const char *value) ++ ++{ ++ fprintf_filtered (file, _("\ ++Unwind stack if a C++ exception is unhandled while in a call dummy is %s.\n"), ++ value); ++} + + /* Perform the standard coercions that are specified + for arguments to be passed to C or Ada functions. +@@ -416,6 +440,8 @@ + struct cleanup *args_cleanup; + struct frame_info *frame; + struct gdbarch *gdbarch; ++ struct breakpoint *terminate_bp = NULL; ++ struct minimal_symbol *tm; + ptid_t call_thread_ptid; + struct gdb_exception e; + const char *name; +@@ -716,6 +742,27 @@ + bpt->disposition = disp_del; + } + ++ /* Create a breakpoint in std::terminate. ++ If a C++ exception is raised in the dummy-frame, and the ++ exception handler is (normally, and expected to be) out-of-frame, ++ the default C++ handler will (wrongly) be called in an inferior ++ function call. This is wrong, as an exception can be normally ++ and legally handled out-of-frame. The confines of the dummy frame ++ prevent the unwinder from finding the correct handler (or any ++ handler, unless it is in-frame). The default handler calls ++ std::terminate. This will kill the inferior. Assert that ++ terminate should never be called in an inferior function ++ call. Place a momentary breakpoint in the std::terminate function ++ and if triggered in the call, rewind. */ ++ if (unwind_on_terminating_exception_p) ++ { ++ struct minimal_symbol *tm = lookup_minimal_symbol ("std::terminate()", ++ NULL, NULL); ++ if (tm != NULL) ++ terminate_bp = set_momentary_breakpoint_at_pc ++ (SYMBOL_VALUE_ADDRESS (tm), bp_breakpoint); ++ } ++ + /* Everything's ready, push all the info needed to restore the + caller (and identify the dummy-frame) onto the dummy-frame + stack. */ +@@ -726,6 +773,10 @@ + or discard it. */ + discard_cleanups (inf_status_cleanup); + ++ /* Register a clean-up for unwind_on_terminating_exception_breakpoint. */ ++ if (terminate_bp) ++ make_cleanup_delete_breakpoint (terminate_bp); ++ + /* - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - + If you're looking to implement asynchronous dummy-frames, then + just below is the place to chop this function in two.. */ +@@ -881,6 +932,38 @@ + + if (!stop_stack_dummy) + { ++ ++ /* Check if unwind on terminating exception behaviour is on. */ ++ if (unwind_on_terminating_exception_p) ++ { ++ /* Check that the breakpoint is our special std::terminate ++ breakpoint. If it is, we do not want to kill the inferior ++ in an inferior function call. Rewind, and warn the ++ user. */ ++ ++ if (terminate_bp != NULL ++ && (inferior_thread()->stop_bpstat->breakpoint_at->address ++ == terminate_bp->loc->address)) ++ { ++ /* We must get back to the frame we were before the ++ dummy call. */ ++ dummy_frame_pop (dummy_id); ++ ++ /* We also need to restore inferior status to that before the ++ dummy call. */ ++ restore_inferior_status (inf_status); ++ ++ error (_("\ ++The program being debugged entered a std::terminate call, most likely\n\ ++caused by an unhandled C++ exception. GDB blocked this call in order\n\ ++to prevent the program from being terminated, and has restored the\n\ ++context to its original state before the call.\n\ ++To change this behaviour use \"set unwind-on-terminating-exception off\".\n\ ++Evaluation of the expression containing the function (%s)\n\ ++will be abandoned."), ++ name); ++ } ++ } + /* We hit a breakpoint inside the FUNCTION. + Keep the dummy frame, the user may want to examine its state. + Discard inferior status, we're not at the same point +@@ -989,4 +1072,19 @@ + NULL, + show_unwind_on_signal_p, + &setlist, &showlist); ++ ++ add_setshow_boolean_cmd ("unwind-on-terminating-exception", no_class, ++ &unwind_on_terminating_exception_p, _("\ ++Set unwinding of stack if std::terminate is called while in call dummy."), _("\ ++Show unwinding of stack if std::terminate() is called while in a call dummy."), _("\ ++The unwind on terminating exception flag lets the user determine\n\ ++what gdb should do if a std::terminate() call is made from the\n\ ++default exception handler. If set, gdb unwinds the stack and restores\n\ ++the context to what it was before the call. If unset, gdb allows the\n\ ++std::terminate call to proceed.\n\ ++The default is to unwind the frame."), ++ NULL, ++ show_unwind_on_terminating_exception_p, ++ &setlist, &showlist); ++ + } +--- src/gdb/doc/gdb.texinfo 2009/06/11 11:57:46 1.599 ++++ src/gdb/doc/gdb.texinfo 2009/06/15 12:11:36 1.600 +@@ -12895,6 +12895,16 @@ + the function, or if you passed it incorrect arguments). What happens + in that case is controlled by the @code{set unwindonsignal} command. + ++Similarly, with a C@t{++} program it is possible for the function you ++call via the @code{print} or @code{call} command to generate an ++exception that is not handled due to the constraints of the dummy ++frame. In this case, any exception that is raised in the frame, but has ++an out-of-frame exception handler will not be found. GDB builds a ++dummy-frame for the inferior function call, and the unwinder cannot ++seek for exception handlers outside of this dummy-frame. What happens ++in that case is controlled by the ++@code{set unwind-on-terminating-exception} command. ++ + @table @code + @item set unwindonsignal + @kindex set unwindonsignal +@@ -12911,6 +12921,23 @@ + @kindex show unwindonsignal + Show the current setting of stack unwinding in the functions called by + @value{GDBN}. ++ ++@item set unwind-on-terminating-exception ++@kindex set unwind-on-terminating-exception ++@cindex unwind stack in called functions with unhandled exceptions ++@cindex call dummy stack unwinding on unhandled exception. ++Set unwinding of the stack if a C@t{++} exception is raised, but left ++unhandled while in a function that @value{GDBN} called in the program being ++debugged. If set to on (the default), @value{GDBN} unwinds the stack ++it created for the call and restores the context to what it was before ++the call. If set to off, @value{GDBN} the exception is delivered to ++the default C@t{++} exception handler and the inferior terminated. ++ ++@item show unwind-on-terminating-exception ++@kindex show unwind-on-terminating-exception ++Show the current setting of stack unwinding in the functions called by ++@value{GDBN}. ++ + @end table + + @cindex weak alias functions +--- src/gdb/testsuite/gdb.cp/gdb2495.cc ++++ src/gdb/testsuite/gdb.cp/gdb2495.cc 2009-06-16 12:49:45.874202000 +0000 +@@ -0,0 +1,89 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2009 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 . ++ */ ++ ++#include ++#include ++ ++using namespace std; ++ ++class SimpleException ++{ ++ ++public: ++ ++ void raise_signal (int dummy) ++ { ++ if (dummy > 0) ++ raise(SIGABRT); ++ } ++ ++ int no_throw_function () ++ { ++ return 1; ++ } ++ ++ void throw_function () ++ { ++ throw 1; ++ } ++ ++ int throw_function_with_handler () ++ { ++ try ++ { ++ throw 1; ++ } ++ catch (...) ++ { ++ cout << "Handled" << endl; ++ } ++ ++ return 2; ++ } ++ ++ void call_throw_function_no_handler () ++ { ++ throw_function (); ++ } ++ ++ void call_throw_function_handler () ++ { ++ throw_function_with_handler (); ++ } ++}; ++SimpleException exceptions; ++ ++int ++main() ++{ ++ /* Have to call these functions so GCC does not optimize them ++ away. */ ++ exceptions.raise_signal (-1); ++ exceptions.no_throw_function (); ++ exceptions.throw_function_with_handler (); ++ exceptions.call_throw_function_handler (); ++ try ++ { ++ exceptions.throw_function (); ++ exceptions.call_throw_function_no_handler (); ++ } ++ catch (...) ++ { ++ } ++ return 0; ++} +--- src/gdb/testsuite/gdb.cp/gdb2495.exp ++++ src/gdb/testsuite/gdb.cp/gdb2495.exp 2009-06-16 12:49:46.889492000 +0000 +@@ -0,0 +1,157 @@ ++# Copyright 2009 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 . ++ ++ ++# In gdb inferior function calls, if a C++ exception is raised in the ++# dummy-frame, and the exception handler is (normally, and expected to ++# be) out-of-frame, the default C++ handler will (wrongly) be called ++# in an inferior function call. ++# This is incorrect as an exception can normally and legally be handled ++# out-of-frame. The confines of the dummy frame prevent the unwinder ++# from finding the correct handler (or any handler, unless it is ++# in-frame). The default handler calls std::terminate. This will kill ++# the inferior. Assert that terminate should never be called in an ++# inferior function call. These tests test the functionality around ++# unwinding that sequence and also tests the flag behaviour gating this ++# functionality. ++ ++# This test is largely based of gdb.base/callfuncs.exp. ++ ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++if { [skip_cplus_tests] } { continue } ++ ++set prms_id 2495 ++set bug_id 0 ++ ++set testfile "gdb2495" ++set srcfile ${testfile}.cc ++set binfile $objdir/$subdir/$testfile ++ ++# Create and source the file that provides information about the compiler ++# used to compile the test case. ++if [get_compiler_info ${binfile} "c++"] { ++ return -1 ++} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { ++ untested gdb2495.exp ++ return -1 ++} ++ ++# Some targets can't do function calls, so don't even bother with this ++# test. ++if [target_info exists gdb,cannot_call_functions] { ++ setup_xfail "*-*-*" 2416 ++ fail "This target can not call functions" ++ continue ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if ![runto_main] then { ++ perror "couldn't run to main" ++ continue ++} ++ ++# See http://sourceware.org/gdb/bugs/2495 ++ ++# Test normal baseline behaviour. Call a function that ++# does not raise an exception. ++gdb_test "p exceptions.no_throw_function()" " = 1" ++# And one that does but handles it in-frame. ++gdb_test "p exceptions.throw_function_with_handler()" " = 2" ++# Both should return normally. ++ ++# Test basic unwind. Call a function that raises an exception but ++# does not handle it. It should be rewound. ++gdb_test "p exceptions.throw_function()" \ ++ "The program being debugged entered a std::terminate call, .*" \ ++ "Call a function that raises an exception without a handler." ++ ++# Make sure that after rewinding we are back at the call parent. ++gdb_test "bt" \ ++ "#0 main.*" \ ++ "bt after returning from a popped frame" ++ ++# Make sure the only breakpoint is the one set via the runto_main ++# call and that the std::terminate breakpoint has evaporated and ++# cleaned-up. ++gdb_test "info breakpoints" \ ++ "gdb.cp/gdb2495\.cc.*" ++ ++# Turn off this new behaviour. ++gdb_test_multiple "set unwind-on-terminating-exception off" \ ++ "Turn unwind-on-terminating-exception off" { ++ -re "$gdb_prompt $" {pass "set unwinn-on-terminating-exception off"} ++ timeout {fail "(timeout) set unwind-on-terminating-exception off"} ++} ++ ++# Check that it is turned off. ++gdb_test "show unwind-on-terminating-exception" \ ++ "exception is unhandled while in a call dummy is off.*" \ ++ "Turn off unwind on terminating exception flag" ++ ++# Check that the old behaviour is restored. ++gdb_test "p exceptions.throw_function()" \ ++ "The program being debugged was signaled while in a function called .*" \ ++ "Call a function that raises an exception with unwinding off.." ++ ++# Restart the inferior back at main. ++if ![runto_main] then { ++ perror "couldn't run to main" ++ continue ++} ++ ++ ++# Check to see if the new behaviour alters the unwind signal ++# behaviour; it should not. Test both on and off states. ++ ++# Turn on unwind on signal behaviour. ++gdb_test_multiple "set unwindonsignal on" "Turn unwindonsignal on" { ++ -re "$gdb_prompt $" {pass "set unwindonsignal on"} ++ timeout {fail "(timeout) set unwindonsignal on"} ++} ++ ++# Check that it is turned on. ++gdb_test "show unwindonsignal" \ ++ "signal is received while in a call dummy is on.*" \ ++ "Turn on unwind on signal" ++ ++# Check to see if new behaviour interferes with ++# normal signal handling in inferior function calls. ++gdb_test "p exceptions.raise_signal(1)" \ ++ "To change this behavior use \"set unwindonsignal off\".*" ++ ++# And reverse - turn off again. ++gdb_test_multiple "set unwindonsignal off" "Turn unwindonsignal off" { ++ -re "$gdb_prompt $" {pass "set unwindonsignal off"} ++ timeout {fail "(timeout) set unwindonsignal off"} ++} ++ ++# Check that it is actually turned off. ++gdb_test "show unwindonsignal" \ ++ "signal is received while in a call dummy is off.*" \ ++ "Turn off unwind on signal" ++ ++# Check to see if new behaviour interferes with ++# normal signal handling in inferior function calls. ++gdb_test "p exceptions.raise_signal(1)" \ ++ "To change this behavior use \"set unwindonsignal on\".*" +--- src/gdb/testsuite/gdb.cp/Makefile.in 2009/02/03 01:09:01 1.5 ++++ src/gdb/testsuite/gdb.cp/Makefile.in 2009/06/15 12:11:37 1.6 +@@ -4,7 +4,7 @@ + EXECUTABLES = ambiguous annota2 anon-union cplusfuncs cttiadd \ + derivation inherit local member-ptr method misc \ + overload ovldbreak ref-typ ref-typ2 templates userdef virtfunc namespace \ +- ref-types ref-params method2 pr9594 ++ ref-types ref-params method2 pr9594 gdb2495 + + all info install-info dvi install uninstall installcheck check: + @echo "Nothing to be done for $@..." + + + +https://bugzilla.redhat.com/show_bug.cgi?id=471819 + +http://sourceware.org/ml/gdb-patches/2009-06/msg00837.html +http://sourceware.org/ml/gdb-cvs/2009-06/msg00194.html + +gdb/ +2009-06-29 Pedro Alves + + * infrun.c (handle_inferior_event): Context switch to the new + thread when resuming for a new_thread_event. + +http://sourceware.org/ml/gdb-patches/2009-06/msg00841.html +http://sourceware.org/ml/gdb-cvs/2009-06/msg00195.html + +gdb/testsuite/ +2009-06-29 Jan Kratochvil + + * gdb.threads/current-lwp-dead.exp, gdb.threads/current-lwp-dead.c: New. + +--- src/gdb/infrun.c 2009/06/28 00:20:22 1.396 ++++ src/gdb/infrun.c 2009/06/29 18:27:23 1.397 +@@ -2746,6 +2746,8 @@ + in either the OS or the native code). Therefore we need to + continue all threads in order to make progress. */ + ++ if (!ptid_equal (ecs->ptid, inferior_ptid)) ++ context_switch (ecs->ptid); + target_resume (RESUME_ALL, 0, TARGET_SIGNAL_0); + prepare_to_wait (ecs); + return; +--- src/gdb/testsuite/gdb.threads/current-lwp-dead.c ++++ src/gdb/testsuite/gdb.threads/current-lwp-dead.c 2009-06-29 18:59:59.860807000 +0000 +@@ -0,0 +1,75 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2009 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 . ++ ++ Do not use threads as we need to exploit a bug in LWP code masked by the ++ threads code otherwise. ++ ++ INFERIOR_PTID must point to exited LWP. Here we use the initial LWP as it ++ is automatically INFERIOR_PTID for GDB. ++ ++ Finally we need to call target_resume (RESUME_ALL, ...) which we invoke by ++ NEW_THREAD_EVENT (called from the new LWP as initial LWP is exited now). */ ++ ++#define _GNU_SOURCE ++#include ++#include ++#include ++#include ++ ++#define STACK_SIZE 0x1000 ++ ++static int ++fn_return (void *unused) ++{ ++ return 0; /* at-fn_return */ ++} ++ ++static int ++fn (void *unused) ++{ ++ int i; ++ unsigned char *stack; ++ int new_pid; ++ ++ i = sleep (1); ++ assert (i == 0); ++ ++ stack = malloc (STACK_SIZE); ++ assert (stack != NULL); ++ ++ new_pid = clone (fn_return, stack + STACK_SIZE, CLONE_FILES | CLONE_VM, NULL, ++ NULL, NULL, NULL); ++ assert (new_pid > 0); ++ ++ return 0; ++} ++ ++int ++main (int argc, char **argv) ++{ ++ unsigned char *stack; ++ int new_pid; ++ ++ stack = malloc (STACK_SIZE); ++ assert (stack != NULL); ++ ++ new_pid = clone (fn, stack + STACK_SIZE, CLONE_FILES | CLONE_VM, NULL, NULL, ++ NULL, NULL); ++ assert (new_pid > 0); ++ ++ return 0; ++} +--- src/gdb/testsuite/gdb.threads/current-lwp-dead.exp ++++ src/gdb/testsuite/gdb.threads/current-lwp-dead.exp 2009-06-29 19:00:01.014652000 +0000 +@@ -0,0 +1,31 @@ ++# This testcase is part of GDB, the GNU debugger. ++ ++# Copyright 2009 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 . ++ ++# Please email any bugs, comments, and/or additions to this file to: ++# bug-gdb@gnu.org ++ ++if { [prepare_for_testing current-lwp-dead.exp current-lwp-dead] } { ++ return -1 ++} ++ ++if {[runto_main] <= 0} { ++ untested current-lwp-dead.exp ++ return -1 ++} ++ ++gdb_breakpoint "fn_return" ++gdb_continue_to_breakpoint "fn_return" ".*at-fn_return.*" + + + +[patch] testsuite: Fix multiple runs in parallel on a single host + +http://sourceware.org/ml/gdb-patches/2009-07/msg00008.html +http://sourceware.org/ml/gdb-cvs/2009-07/msg00051.html + +2009-07-06 Jan Kratochvil + + * lib/gdbserver-support.exp (gdbserver_start): Loop spawning + gdbserver increasing $portnum if "Can't bind address" has been seen. + +--- src/gdb/testsuite/lib/gdbserver-support.exp 2009/01/03 05:58:08 1.14 ++++ src/gdb/testsuite/lib/gdbserver-support.exp 2009/07/06 18:51:10 1.15 +@@ -209,26 +209,39 @@ + + set gdbserver [find_gdbserver] + +- # Export the host:port pair. +- set gdbport $debughost$portnum +- +- # Fire off the debug agent. +- set gdbserver_command "$gdbserver" +- if { $options != "" } { +- append gdbserver_command " $options" +- } +- append gdbserver_command " :$portnum" +- if { $arguments != "" } { +- append gdbserver_command " $arguments" +- } ++ # Loop till we find a free port. ++ while 1 { ++ # Export the host:port pair. ++ set gdbport $debughost$portnum ++ ++ # Fire off the debug agent. ++ set gdbserver_command "$gdbserver" ++ if { $options != "" } { ++ append gdbserver_command " $options" ++ } ++ append gdbserver_command " :$portnum" ++ if { $arguments != "" } { ++ append gdbserver_command " $arguments" ++ } + +- set server_spawn_id [remote_spawn target $gdbserver_command] ++ set server_spawn_id [remote_spawn target $gdbserver_command] + +- # Wait for the server to open its TCP socket, so that GDB can connect. +- expect { +- -i $server_spawn_id +- -notransfer +- -re "Listening on" { } ++ # Wait for the server to open its TCP socket, so that GDB can connect. ++ expect { ++ -i $server_spawn_id ++ -notransfer ++ -re "Listening on" { } ++ -re "Can't bind address: Address already in use\\.\r\n" { ++ verbose -log "Port $portnum is already in use." ++ if ![target_info exists gdb,socketport] { ++ # Bump the port number to avoid the conflict. ++ wait -i $expect_out(spawn_id) ++ incr portnum ++ continue ++ } ++ } ++ } ++ break + } + + # We can't just call close, because if gdbserver is local then that means + + + +http://sourceware.org/ml/gdb-cvs/2009-06/msg00203.html + +2009-06-30 Jan Kratochvil + + Remove racy FAILs relying just on the timeouts. + * gdb.base/setshow.exp (set annotate 2, show annotate (2)) + (annotation_level 2): Remove racy FAILs. + +--- src/gdb/testsuite/gdb.base/setshow.exp 2009/01/03 05:58:03 1.10 ++++ src/gdb/testsuite/gdb.base/setshow.exp 2009/06/30 18:28:12 1.11 +@@ -60,7 +60,6 @@ + gdb_expect { + -re ".*\032\032pre-prompt.*$gdb_prompt .*\032\032prompt.*$" \ + { pass "set annotate 2" } +- -re ".*$gdb_prompt $" { fail "set annotate 2" } + timeout { fail "(timeout) set annotate 2" } + } + +@@ -68,7 +67,6 @@ + gdb_expect { + -re ".*\032\032post-prompt.*Annotation_level is 2..*\032\032pre-prompt.*$gdb_prompt .*\032\032prompt.*$" \ + { pass "show annotate (2)" } +- -re ".*$gdb_prompt $" { fail "show annotate (2)" } + timeout { fail "(timeout) show annotate (2)" } + } + +@@ -77,7 +75,6 @@ + gdb_expect { + -re ".*\032\032post-prompt.*Line 1 of .* is at address .* but contains no code.*:1:0:beg:0x.*\032\032pre-prompt.*$gdb_prompt .*\032\032prompt.*$" \ + { pass "annotation_level 2" } +- -re ".*$gdb_prompt $" { fail "annotation_level 2" } + timeout { fail "(timeout) annotation_level 2" } + } + + + + +http://sourceware.org/ml/gdb-cvs/2009-06/msg00204.html + +2009-06-30 Jan Kratochvil + + * lib/mi-support.exp (mi_check_thread_states): Permit any output before + the expected result record. + +--- src/gdb/testsuite/lib/mi-support.exp 2009/05/28 01:09:20 1.84 ++++ src/gdb/testsuite/lib/mi-support.exp 2009/06/30 20:23:05 1.85 +@@ -1808,7 +1808,7 @@ + proc mi_check_thread_states { xstates test } { + global expect_out + set states [mi_reverse_list $xstates] +- set pattern "\\^done,threads=\\\[" ++ set pattern ".*\\^done,threads=\\\[" + foreach s $states { + set pattern "${pattern}(.*)state=\"$s\"" + } diff --git a/gdb-DW_OP_call_frame_cfa.patch b/gdb-DW_OP_call_frame_cfa.patch new file mode 100644 index 0000000..5df2679 --- /dev/null +++ b/gdb-DW_OP_call_frame_cfa.patch @@ -0,0 +1,167 @@ +http://sourceware.org/ml/gdb-patches/2009-06/msg00191.html + +GCC developers would like to change GCC to emit DW_OP_call_frame_cfa, +as this would reduce the size of the generated debuginfo. + +A prerequisite to this is that GDB understand this. So, this patch +implements this feature. This is PR 10224. + +I'm interested in feedback on this. I am not sure whether the +implementation of dwarf2_frame_cfa is ok. + +No test case since at some point GCC will start generating this +(perhaps optionally -- but I feel certain we'll do it by default in +Fedora), and since it therefore seemed like a lot of work for little +payoff. + +Tom + +2009-06-08 Tom Tromey + + PR gdb/10224: + * dwarf2loc.c: Include dwarf2-frame.h. + (dwarf_expr_frame_cfa): New function. + (dwarf2_evaluate_loc_desc): Initialize new field. + (needs_frame_frame_cfa): New function. + (dwarf2_loc_desc_needs_frame): Initialize new field. + * dwarf2expr.h (struct dwarf_expr_context) : New + field. + * dwarf2expr.c (execute_stack_op) : New + case. + * dwarf2-frame.h (dwarf2_frame_cfa): Declare. + * dwarf2-frame.c (no_get_frame_cfa): New function. + (execute_stack_op): Initialize new field. + (dwarf2_frame_cfa): New function. + +[ Backported for Fedora Rawhide. ] + +--- ./gdb/dwarf2-frame.c 2009-06-12 11:12:51.000000000 +0200 ++++ ./gdb/dwarf2-frame.c 2009-06-12 11:13:30.000000000 +0200 +@@ -306,6 +306,13 @@ no_get_frame_base (void *baton, gdb_byte + } + + static CORE_ADDR ++no_get_frame_cfa (void *baton) ++{ ++ internal_error (__FILE__, __LINE__, ++ _("Support for DW_OP_call_frame_cfa is unimplemented")); ++} ++ ++static CORE_ADDR + no_get_tls_address (void *baton, CORE_ADDR offset) + { + internal_error (__FILE__, __LINE__, +@@ -356,6 +363,7 @@ execute_stack_op (gdb_byte *exp, ULONGES + ctx->read_reg = read_reg; + ctx->read_mem = read_mem; + ctx->get_frame_base = no_get_frame_base; ++ ctx->get_frame_cfa = no_get_frame_cfa; + ctx->get_tls_address = no_get_tls_address; + + dwarf_expr_push (ctx, initial); +@@ -1221,6 +1229,13 @@ dwarf2_frame_base_address (struct frame_ + return cache->cfa; + } + ++CORE_ADDR ++dwarf2_frame_cfa (struct frame_info *this_frame) ++{ ++ void *cache = NULL; ++ return dwarf2_frame_base_address (this_frame, &cache); ++} ++ + static const struct frame_base dwarf2_frame_base = + { + &dwarf2_frame_unwind, +--- ./gdb/dwarf2-frame.h 2009-01-03 06:57:51.000000000 +0100 ++++ ./gdb/dwarf2-frame.h 2009-06-12 11:13:30.000000000 +0200 +@@ -118,4 +118,8 @@ extern const struct frame_base * + + void dwarf2_frame_build_info (struct objfile *objfile); + ++/* Compute the DWARF CFA for a frame. */ ++ ++CORE_ADDR dwarf2_frame_cfa (struct frame_info *this_frame); ++ + #endif /* dwarf2-frame.h */ +--- ./gdb/dwarf2expr.c 2009-06-12 11:12:51.000000000 +0200 ++++ ./gdb/dwarf2expr.c 2009-06-12 11:13:44.000000000 +0200 +@@ -697,6 +697,10 @@ execute_stack_op (struct dwarf_expr_cont + } + break; + ++ case DW_OP_call_frame_cfa: ++ result = (ctx->get_frame_cfa) (ctx->baton); ++ break; ++ + case DW_OP_GNU_push_tls_address: + /* Variable is at a constant offset in the thread-local + storage block into the objfile for the current thread and +--- ./gdb/dwarf2expr.h 2009-06-12 11:12:51.000000000 +0200 ++++ ./gdb/dwarf2expr.h 2009-06-12 11:15:36.000000000 +0200 +@@ -55,6 +55,9 @@ struct dwarf_expr_context + expression evaluation is complete. */ + void (*get_frame_base) (void *baton, gdb_byte **start, size_t *length); + ++ /* Return the CFA for the frame. */ ++ CORE_ADDR (*get_frame_cfa) (void *baton); ++ + /* Return the thread-local storage address for + DW_OP_GNU_push_tls_address. */ + CORE_ADDR (*get_tls_address) (void *baton, CORE_ADDR offset); +--- ./gdb/dwarf2loc.c 2009-06-12 11:12:55.000000000 +0200 ++++ ./gdb/dwarf2loc.c 2009-06-12 11:15:07.000000000 +0200 +@@ -32,6 +32,7 @@ + #include "objfiles.h" + #include "exceptions.h" + #include "block.h" ++#include "dwarf2-frame.h" + + #include "elf/dwarf2.h" + #include "dwarf2expr.h" +@@ -200,6 +201,13 @@ dwarf_expr_frame_base (void *baton, gdb_ + SYMBOL_PRINT_NAME (framefunc)); + } + ++static CORE_ADDR ++dwarf_expr_frame_cfa (void *baton) ++{ ++ struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton; ++ return dwarf2_frame_cfa (debaton->frame); ++} ++ + /* Using the objfile specified in BATON, find the address for the + current thread's thread-local storage with offset OFFSET. */ + static CORE_ADDR +@@ -286,6 +294,7 @@ dwarf_expr_prep_ctx (struct frame_info * + ctx->read_reg = dwarf_expr_read_reg; + ctx->read_mem = dwarf_expr_read_mem; + ctx->get_frame_base = dwarf_expr_frame_base; ++ ctx->get_frame_cfa = dwarf_expr_frame_cfa; + ctx->get_tls_address = dwarf_expr_tls_address; + ctx->get_object_address = dwarf_expr_object_address; + +@@ -439,6 +448,15 @@ needs_frame_frame_base (void *baton, gdb + nf_baton->needs_frame = 1; + } + ++/* CFA accesses require a frame. */ ++static CORE_ADDR ++needs_frame_frame_cfa (void *baton) ++{ ++ struct needs_frame_baton *nf_baton = baton; ++ nf_baton->needs_frame = 1; ++ return 1; ++} ++ + /* Thread-local accesses do require a frame. */ + static CORE_ADDR + needs_frame_tls_address (void *baton, CORE_ADDR offset) +@@ -468,6 +486,7 @@ dwarf2_loc_desc_needs_frame (gdb_byte *d + ctx->read_reg = needs_frame_read_reg; + ctx->read_mem = needs_frame_read_mem; + ctx->get_frame_base = needs_frame_frame_base; ++ ctx->get_frame_cfa = needs_frame_frame_cfa; + ctx->get_tls_address = needs_frame_tls_address; + + dwarf_expr_eval (ctx, data, size); diff --git a/gdb-archer.patch b/gdb-archer.patch index 2a183ca..9ee49c8 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -2,7 +2,7 @@ http://sourceware.org/gdb/wiki/ProjectArcher http://sourceware.org/gdb/wiki/ArcherBranchManagement GIT snapshot: -commit e2812eadef2c15baeccd003e11fdf3fbc0b90dc2 +commit 17bfc0488f54aeeb7a9e20ef3caa7e31e8e985fb branch `archer' - the merge of branches: archer-jankratochvil-merge-expr @@ -12596,7 +12596,7 @@ index 845b320..ad6e7d7 100644 extern struct cleanup *make_final_cleanup (make_cleanup_ftype *, void *); diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo -index 10e7388..c4ab391 100644 +index 10e7388..099f88a 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -955,8 +955,10 @@ Connect to process ID @var{number}, as with the @code{attach} command. @@ -12929,44 +12929,7 @@ index 10e7388..c4ab391 100644 @node Calling @section Calling Program Functions -@@ -12510,6 +12666,12 @@ It is possible for the function you call via the @code{print} or - the function, or if you passed it incorrect arguments). What happens - in that case is controlled by the @code{set unwindonsignal} command. - -+Similarly, with a C++ program it is possible for the function you -+call via the @code{print} or @code{call} command to generate an -+exception that is not handled due to the constraints of the dummy -+frame. What happens in that case is controlled by the -+@code{set unwind-on-terminating-exception} command. -+ - @table @code - @item set unwindonsignal - @kindex set unwindonsignal -@@ -12526,6 +12688,23 @@ received. - @kindex show unwindonsignal - Show the current setting of stack unwinding in the functions called by - @value{GDBN}. -+ -+@item set unwind-on-terminating-exception -+@kindex set unwind-on-terminating-exception -+@cindex unwind stack in called functions -+@cindex call dummy stack unwinding on unhandled exception. -+Set unwinding of the stack if a C++ exception is raised but unhandled -+while in a function that @value{GDBN} called in the program being -+debugged. If set to on (the default), @value{GDBN} unwinds the stack -+it created for the call and restores the context to what it was before -+the call. If set to off, @value{GDBN} the exception is delivered to -+the default C++ exception handler. -+ -+@item show unwind-on-terminating-exception -+@kindex show unwind-on-terminating-exception -+Show the current setting of stack unwinding in the functions called by -+@value{GDBN}. -+ - @end table - - @cindex weak alias functions -@@ -17815,7 +17994,7 @@ command: +@@ -17815,7 +17971,7 @@ command: @table @code @kindex source @cindex execute commands from a file @@ -12975,7 +12938,7 @@ index 10e7388..c4ab391 100644 Execute the command file @var{filename}. @end table -@@ -17832,6 +18011,11 @@ If @code{-v}, for verbose mode, is given then @value{GDBN} displays +@@ -17832,6 +17988,11 @@ If @code{-v}, for verbose mode, is given then @value{GDBN} displays each command as it is executed. The option must be given before @var{filename}, and is interpreted as part of the filename anywhere else. @@ -12987,7 +12950,7 @@ index 10e7388..c4ab391 100644 Commands that would ask for confirmation if used interactively proceed without asking when used in a command file. Many @value{GDBN} commands that normally print messages to say what they are doing omit the messages -@@ -18093,8 +18277,6 @@ containing @code{end}. For example: +@@ -18093,8 +18254,6 @@ containing @code{end}. For example: @smallexample (@value{GDBP}) python @@ -12996,7 +12959,7 @@ index 10e7388..c4ab391 100644 >print 23 >end 23 -@@ -18107,6 +18289,14 @@ in a Python script. This can be controlled using @code{maint set +@@ -18107,6 +18266,14 @@ in a Python script. This can be controlled using @code{maint set python print-stack}: if @code{on}, the default, then Python stack printing is enabled; if @code{off}, then Python stack printing is disabled. @@ -13011,7 +12974,7 @@ index 10e7388..c4ab391 100644 @end table @node Python API -@@ -18114,6 +18304,14 @@ disabled. +@@ -18114,6 +18281,14 @@ disabled. @cindex python api @cindex programming in python @@ -13026,7 +12989,7 @@ index 10e7388..c4ab391 100644 @cindex python stdout @cindex python pagination At startup, @value{GDBN} overrides Python's @code{sys.stdout} and -@@ -18125,8 +18323,17 @@ situation, a Python @code{KeyboardInterrupt} exception is thrown. +@@ -18125,8 +18300,17 @@ situation, a Python @code{KeyboardInterrupt} exception is thrown. @menu * Basic Python:: Basic Python Functions. * Exception Handling:: @@ -13045,7 +13008,7 @@ index 10e7388..c4ab391 100644 @end menu @node Basic Python -@@ -18152,10 +18359,30 @@ command as having originated from the user invoking it interactively. +@@ -18152,10 +18336,30 @@ command as having originated from the user invoking it interactively. It must be a boolean value. If omitted, it defaults to @code{False}. @end defun @@ -13080,7 +13043,7 @@ index 10e7388..c4ab391 100644 spaces if the parameter has a multi-part name. For example, @samp{print object} is a valid parameter name. -@@ -18179,6 +18406,28 @@ If no exception is raised, the return value is always an instance of +@@ -18179,6 +18383,28 @@ If no exception is raised, the return value is always an instance of @code{gdb.Value} (@pxref{Values From Inferior}). @end defun @@ -13109,7 +13072,7 @@ index 10e7388..c4ab391 100644 @findex gdb.write @defun write string Print a string to @value{GDBN}'s paginated standard output stream. -@@ -18193,6 +18442,66 @@ Flush @value{GDBN}'s paginated standard output stream. Flushing +@@ -18193,6 +18419,66 @@ Flush @value{GDBN}'s paginated standard output stream. Flushing function. @end defun @@ -13176,7 +13139,7 @@ index 10e7388..c4ab391 100644 @node Exception Handling @subsubsection Exception Handling @cindex python exceptions -@@ -18224,6 +18533,44 @@ message as its value, and the Python call stack backtrace at the +@@ -18224,6 +18510,44 @@ message as its value, and the Python call stack backtrace at the Python statement closest to where the @value{GDBN} error occured as the traceback. @@ -13221,7 +13184,7 @@ index 10e7388..c4ab391 100644 @node Values From Inferior @subsubsection Values From Inferior @cindex values from inferior, with Python -@@ -18258,8 +18605,36 @@ bar = some_val['foo'] +@@ -18258,8 +18582,36 @@ bar = some_val['foo'] Again, @code{bar} will also be a @code{gdb.Value} object. @@ -13260,7 +13223,7 @@ index 10e7388..c4ab391 100644 @defmethod Value dereference This method returns a new @code{gdb.Value} object whose contents is -@@ -18282,7 +18657,7 @@ The result @code{bar} will be a @code{gdb.Value} object holding the +@@ -18282,7 +18634,7 @@ The result @code{bar} will be a @code{gdb.Value} object holding the value pointed to by @code{foo}. @end defmethod @@ -13269,7 +13232,7 @@ index 10e7388..c4ab391 100644 If this @code{gdb.Value} represents a string, then this method converts the contents to a Python string. Otherwise, this method will throw an exception. -@@ -18308,6 +18683,465 @@ will be used, if the current language is able to supply one. +@@ -18308,6 +18660,465 @@ will be used, if the current language is able to supply one. The optional @var{errors} argument is the same as the corresponding argument to Python's @code{string.decode} method. @end defmethod @@ -13735,7 +13698,7 @@ index 10e7388..c4ab391 100644 @node Commands In Python @subsubsection Commands In Python -@@ -18320,7 +19154,7 @@ You can implement new @value{GDBN} CLI commands in Python. A CLI +@@ -18320,7 +19131,7 @@ You can implement new @value{GDBN} CLI commands in Python. A CLI command is implemented using an instance of the @code{gdb.Command} class, most commonly using a subclass. @@ -13744,7 +13707,7 @@ index 10e7388..c4ab391 100644 The object initializer for @code{Command} registers the new command with @value{GDBN}. This initializer is normally invoked from the subclass' own @code{__init__} method. -@@ -18332,11 +19166,11 @@ an exception is raised. +@@ -18332,11 +19143,11 @@ an exception is raised. There is no support for multi-line commands. @@ -13758,7 +13721,7 @@ index 10e7388..c4ab391 100644 one of the @samp{COMPLETE_} constants defined below. This argument tells @value{GDBN} how to perform completion for this command. If not given, @value{GDBN} will attempt to complete using the object's -@@ -18563,6 +19397,374 @@ registration of the command with @value{GDBN}. Depending on how the +@@ -18563,6 +19374,374 @@ registration of the command with @value{GDBN}. Depending on how the Python code is read into @value{GDBN}, you may need to import the @code{gdb} module explicitly. @@ -14133,7 +14096,7 @@ index 10e7388..c4ab391 100644 @node Interpreters @chapter Command Interpreters @cindex command interpreters -@@ -22273,6 +23475,103 @@ Unfreezing a variable does not update it, only subsequent +@@ -22273,6 +23452,103 @@ Unfreezing a variable does not update it, only subsequent (gdb) @end smallexample @@ -14237,7 +14200,7 @@ index 10e7388..c4ab391 100644 @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node GDB/MI Data Manipulation -@@ -23832,6 +25131,10 @@ as possible presense of the @code{frozen} field in the output +@@ -23832,6 +25108,10 @@ as possible presense of the @code{frozen} field in the output of @code{-varobj-create}. @item pending-breakpoints Indicates presence of the @option{-f} option to the @code{-break-insert} command. @@ -14248,7 +14211,7 @@ index 10e7388..c4ab391 100644 @item thread-info Indicates presence of the @code{-thread-info} command. -@@ -25402,28 +26705,6 @@ data in a @file{gmon.out} file, be sure to move it to a safe location. +@@ -25402,28 +26682,6 @@ data in a @file{gmon.out} file, be sure to move it to a safe location. Configuring with @samp{--enable-profiling} arranges for @value{GDBN} to be compiled with the @samp{-pg} compiler option. @@ -14653,7 +14616,7 @@ index 76577f1..bf46761 100644 #endif /* dwarf2loc.h */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 55868da..c22866f 100644 +index 55868da..9bc1386 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1,8 +1,7 @@ @@ -14855,13 +14818,13 @@ index 55868da..c22866f 100644 static unsigned int dwarf2_get_ref_die_offset (struct attribute *); -static int dwarf2_get_attr_constant_value (struct attribute *, int); -+enum dwarf2_get_attr_constant_value ++enum get_attr_constant_value + { + dwarf2_attr_unknown, + dwarf2_attr_const, + dwarf2_attr_block + }; -+static enum dwarf2_get_attr_constant_value dwarf2_get_attr_constant_value ++static enum get_attr_constant_value get_attr_constant_value + (struct attribute *attr, int *val_return); static struct die_info *follow_die_ref (struct die_info *, @@ -15866,15 +15829,22 @@ index 55868da..c22866f 100644 lowpc += baseaddr; highpc += baseaddr; -@@ -3124,14 +3561,87 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3124,14 +3561,94 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) cu->list_in_scope = &local_symbols; - if (die->child != NULL) ++ switch (cu->language) ++ { ++ case language_fortran: ++ cu->language_specific.fortran.use = NULL; ++ break; ++ } ++ + child_die = die->child; + die_children = 0; + while (child_die && child_die->tag) - { ++ { + process_die (child_die, cu); + child_die = sibling_die (child_die); + die_children++; @@ -15882,7 +15852,7 @@ index 55868da..c22866f 100644 + + attr = dwarf2_attr (die, DW_AT_abstract_origin, cu); + if (attr) -+ { + { + /* For the list of CHILD_DIEs. */ + unsigned *offsets; + unsigned *offsets_end, *offsetp; @@ -15956,7 +15926,7 @@ index 55868da..c22866f 100644 } new = pop_context (); -@@ -3145,6 +3655,13 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3145,6 +3662,13 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) determine_prefix (die, cu), processing_has_namespace_info); @@ -15970,7 +15940,7 @@ index 55868da..c22866f 100644 /* If we have address ranges, record them. */ dwarf2_record_block_ranges (die, block, baseaddr, cu); -@@ -3154,6 +3671,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3154,6 +3678,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) back to building a containing block's symbol lists. */ local_symbols = new->locals; param_symbols = new->params; @@ -15978,7 +15948,7 @@ index 55868da..c22866f 100644 /* If we've finished processing a top-level function, subsequent symbols go in the file symbol list. */ -@@ -3180,7 +3698,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3180,7 +3705,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) as multiple lexical blocks? Handling children in a sane way would be nasty. Might be easier to properly extend generic blocks to describe ranges. */ @@ -15987,7 +15957,7 @@ index 55868da..c22866f 100644 return; lowpc += baseaddr; highpc += baseaddr; -@@ -3197,7 +3715,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3197,7 +3722,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) } new = pop_context (); @@ -15996,7 +15966,7 @@ index 55868da..c22866f 100644 { struct block *block = finish_block (0, &local_symbols, new->old_blocks, new->start_addr, -@@ -3216,6 +3734,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3216,6 +3741,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) dwarf2_record_block_ranges (die, block, baseaddr, cu); } local_symbols = new->locals; @@ -16004,7 +15974,7 @@ index 55868da..c22866f 100644 } /* Get low and high pc attributes from DW_AT_ranges attribute value OFFSET. -@@ -3351,7 +3870,8 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return, +@@ -3351,7 +3877,8 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return, discontinuous, i.e. derived from DW_AT_ranges information. */ static int dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, @@ -16014,7 +15984,7 @@ index 55868da..c22866f 100644 { struct attribute *attr; CORE_ADDR low = 0; -@@ -3379,7 +3899,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, +@@ -3379,7 +3906,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, { /* Value of the DW_AT_ranges attribute is the offset in the .debug_ranges section. */ @@ -16023,7 +15993,7 @@ index 55868da..c22866f 100644 return 0; /* Found discontinuous range of addresses. */ ret = -1; -@@ -3418,7 +3938,7 @@ dwarf2_get_subprogram_pc_bounds (struct die_info *die, +@@ -3418,7 +3945,7 @@ dwarf2_get_subprogram_pc_bounds (struct die_info *die, CORE_ADDR low, high; struct die_info *child = die->child; @@ -16032,7 +16002,7 @@ index 55868da..c22866f 100644 { *lowpc = min (*lowpc, low); *highpc = max (*highpc, high); -@@ -3455,7 +3975,7 @@ get_scope_pc_bounds (struct die_info *die, +@@ -3455,7 +3982,7 @@ get_scope_pc_bounds (struct die_info *die, CORE_ADDR best_high = (CORE_ADDR) 0; CORE_ADDR current_low, current_high; @@ -16041,7 +16011,21 @@ index 55868da..c22866f 100644 { best_low = current_low; best_high = current_high; -@@ -3750,8 +4270,14 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, +@@ -3667,7 +4194,12 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, + byte_offset = 0; + } + else if (attr_form_is_constant (attr)) +- byte_offset = dwarf2_get_attr_constant_value (attr, 0); ++ { ++ enum get_attr_constant_value type; ++ ++ type = get_attr_constant_value (attr, &byte_offset); ++ gdb_assert (type == dwarf2_attr_const); ++ } + else + byte_offset = decode_locdesc (DW_BLOCK (attr), cu); + +@@ -3750,8 +4282,14 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, if (fieldname == NULL) return; @@ -16057,7 +16041,7 @@ index 55868da..c22866f 100644 /* The name is already allocated along with this objfile, so we don't need to duplicate it for the type. */ -@@ -3881,8 +4407,14 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, +@@ -3881,8 +4419,14 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, if (fieldname == NULL) return; @@ -16073,7 +16057,7 @@ index 55868da..c22866f 100644 /* Look up member function name in fieldlist. */ for (i = 0; i < fip->nfnfields; i++) -@@ -3926,7 +4458,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, +@@ -3926,7 +4470,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, /* The name is already allocated along with this objfile, so we don't need to duplicate it for the type. */ fnp->physname = physname ? physname : ""; @@ -16082,7 +16066,7 @@ index 55868da..c22866f 100644 this_type = read_type_die (die, cu); if (this_type && TYPE_CODE (this_type) == TYPE_CODE_FUNC) { -@@ -4110,7 +4642,7 @@ quirk_gcc_member_function_pointer (struct die_info *die, struct dwarf2_cu *cu) +@@ -4110,7 +4654,7 @@ quirk_gcc_member_function_pointer (struct die_info *die, struct dwarf2_cu *cu) return NULL; domain_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (pfn_type, 0)); @@ -16091,7 +16075,7 @@ index 55868da..c22866f 100644 smash_to_method_type (type, domain_type, TYPE_TARGET_TYPE (pfn_type), TYPE_FIELDS (pfn_type), TYPE_NFIELDS (pfn_type), TYPE_VARARGS (pfn_type)); -@@ -4147,7 +4679,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4147,7 +4691,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) if (type) return type; @@ -16100,7 +16084,7 @@ index 55868da..c22866f 100644 INIT_CPLUS_SPECIFIC (type); name = dwarf2_name (die, cu); if (name != NULL) -@@ -4360,7 +4892,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4360,7 +4904,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) struct attribute *attr; const char *name; @@ -16109,7 +16093,7 @@ index 55868da..c22866f 100644 TYPE_CODE (type) = TYPE_CODE_ENUM; name = dwarf2_full_name (die, cu); -@@ -4410,10 +4942,15 @@ determine_class_name (struct die_info *die, struct dwarf2_cu *cu) +@@ -4410,10 +4954,15 @@ determine_class_name (struct die_info *die, struct dwarf2_cu *cu) { if (child->tag == DW_TAG_subprogram) { @@ -16128,7 +16112,7 @@ index 55868da..c22866f 100644 if (phys_prefix != NULL) { -@@ -4510,6 +5047,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -4510,6 +5059,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) new_symbol (die, this_type, cu); } @@ -16158,7 +16142,7 @@ index 55868da..c22866f 100644 /* Extract all information from a DW_TAG_array_type DIE and put it in the DIE's type field. For now, this only handles one dimensional arrays. */ -@@ -4523,7 +5083,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4523,7 +5095,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) struct type *element_type, *range_type, *index_type; struct type **range_types = NULL; struct attribute *attr; @@ -16167,7 +16151,7 @@ index 55868da..c22866f 100644 struct cleanup *back_to; char *name; -@@ -4570,16 +5130,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4570,16 +5142,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) type = element_type; if (read_array_order (die, cu) == DW_ORD_col_major) @@ -16189,7 +16173,7 @@ index 55868da..c22866f 100644 /* Understand Dwarf2 support for vector types (like they occur on the PowerPC w/ AltiVec). Gcc just adds another attribute to the -@@ -4646,12 +5201,14 @@ read_set_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4646,12 +5213,14 @@ read_set_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, set_type, cu); } @@ -16206,7 +16190,7 @@ index 55868da..c22866f 100644 struct attribute *attr; struct symbol *sym; CORE_ADDR base = (CORE_ADDR) 0; -@@ -4676,10 +5233,40 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) +@@ -4676,10 +5245,40 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) } if (die->child != NULL) { @@ -16247,7 +16231,7 @@ index 55868da..c22866f 100644 attr = dwarf2_attr (child_die, DW_AT_data_member_location, cu); if (attr) { -@@ -4687,8 +5274,25 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) +@@ -4687,8 +5286,25 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) base + decode_locdesc (DW_BLOCK (attr), cu); add_symbol_to_list (sym, &global_symbols); } @@ -16273,7 +16257,7 @@ index 55868da..c22866f 100644 } } -@@ -4756,12 +5360,17 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) +@@ -4756,9 +5372,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) if (is_anonymous) { const char *previous_prefix = determine_prefix (die, cu); @@ -16284,17 +16268,7 @@ index 55868da..c22866f 100644 } } -+ switch (cu->language) -+ { -+ case language_fortran: -+ cu->language_specific.fortran.use = NULL; -+ break; -+ } -+ - if (die->child != NULL) - { - struct die_info *child_die = die->child; -@@ -4774,20 +5383,155 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) +@@ -4774,20 +5388,155 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) } } @@ -16307,9 +16281,10 @@ index 55868da..c22866f 100644 { - struct die_info *child_die = die->child; + struct type *type; -+ + +- /* FIXME: Support the separate Fortran module namespaces. */ + type = read_module_type (die, cu); -+ + + if (type) + new_symbol (die, type, cu); +} @@ -16350,10 +16325,9 @@ index 55868da..c22866f 100644 + save_global_symbols = global_symbols; + global_symbols = NULL; + save_list_in_scope = cu->list_in_scope; - -- /* FIXME: Support the separate Fortran module namespaces. */ ++ + /* Process the child DIEs. */ - ++ + child_die = die->child; while (child_die && child_die->tag) { @@ -16453,7 +16427,7 @@ index 55868da..c22866f 100644 } /* Return the name of the namespace represented by DIE. Set -@@ -4951,29 +5695,95 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4951,29 +5700,95 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct objfile *objfile = cu->objfile; struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; @@ -16478,7 +16452,7 @@ index 55868da..c22866f 100644 - else - { - /* check for the DW_AT_byte_size attribute */ -+ switch (dwarf2_get_attr_constant_value (attr, &length)) ++ switch (get_attr_constant_value (attr, &length)) + { + case dwarf2_attr_const: + /* We currently do not support a constant address where the location @@ -16495,7 +16469,7 @@ index 55868da..c22866f 100644 - { - length = 1; - } -+ switch (dwarf2_get_attr_constant_value (attr, &length)) ++ switch (get_attr_constant_value (attr, &length)) + { + case dwarf2_attr_unknown: + length = 1; @@ -16567,7 +16541,7 @@ index 55868da..c22866f 100644 type = create_string_type (NULL, range_type); return set_die_type (die, type, cu); -@@ -5067,7 +5877,6 @@ static struct type * +@@ -5067,7 +5882,6 @@ static struct type * read_typedef (struct die_info *die, struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; @@ -16575,18 +16549,18 @@ index 55868da..c22866f 100644 const char *name = NULL; struct type *this_type; -@@ -5175,8 +5984,8 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5175,8 +5989,8 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type; struct type *range_type; struct attribute *attr; - int low = 0; - int high = -1; + int low, high, byte_stride_int; -+ enum dwarf2_get_attr_constant_value high_type; ++ enum get_attr_constant_value high_type; char *name; base_type = die_type (die, cu); -@@ -5189,42 +5998,90 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5189,42 +6003,90 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) 0, NULL, cu->objfile); } @@ -16604,7 +16578,7 @@ index 55868da..c22866f 100644 attr = dwarf2_attr (die, DW_AT_lower_bound, cu); - if (attr) - low = dwarf2_get_attr_constant_value (attr, 0); -+ switch (dwarf2_get_attr_constant_value (attr, &low)) ++ switch (get_attr_constant_value (attr, &low)) + { + case dwarf2_attr_unknown: + if (cu->language == language_fortran) @@ -16654,11 +16628,11 @@ index 55868da..c22866f 100644 - } - else - high = dwarf2_get_attr_constant_value (attr, 1); -+ high_type = dwarf2_get_attr_constant_value (attr, &high); ++ high_type = get_attr_constant_value (attr, &high); + if (high_type == dwarf2_attr_unknown) + { + attr = dwarf2_attr (die, DW_AT_count, cu); -+ high_type = dwarf2_get_attr_constant_value (attr, &high); ++ high_type = get_attr_constant_value (attr, &high); + /* It does not hurt but it is needlessly ineffective in check_typedef. */ + if (high_type != dwarf2_attr_unknown) + { @@ -16687,7 +16661,7 @@ index 55868da..c22866f 100644 - range_type = create_range_type (NULL, base_type, low, high); + /* DW_AT_bit_stride is currently unsupported as we count in bytes. */ + attr = dwarf2_attr (die, DW_AT_byte_stride, cu); -+ switch (dwarf2_get_attr_constant_value (attr, &byte_stride_int)) ++ switch (get_attr_constant_value (attr, &byte_stride_int)) + { + case dwarf2_attr_unknown: + break; @@ -16707,7 +16681,7 @@ index 55868da..c22866f 100644 name = dwarf2_name (die, cu); if (name) -@@ -5386,10 +6243,13 @@ read_die_and_siblings (gdb_byte *info_ptr, bfd *abfd, +@@ -5386,10 +6248,13 @@ read_die_and_siblings (gdb_byte *info_ptr, bfd *abfd, } /* Decompress a section that was compressed using zlib. Store the @@ -16723,7 +16697,7 @@ index 55868da..c22866f 100644 gdb_byte **outbuf, bfd_size_type *outsize) { bfd *abfd = objfile->obfd; -@@ -5405,6 +6265,7 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, +@@ -5405,6 +6270,7 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, z_stream strm; int rc; int header_size = 12; @@ -16731,7 +16705,7 @@ index 55868da..c22866f 100644 if (bfd_seek (abfd, sectp->filepos, SEEK_SET) != 0 || bfd_bread (compressed_buffer, compressed_size, abfd) != compressed_size) -@@ -5434,8 +6295,13 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, +@@ -5434,8 +6300,13 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, strm.avail_in = compressed_size - header_size; strm.next_in = (Bytef*) compressed_buffer + header_size; strm.avail_out = uncompressed_size; @@ -16747,7 +16721,7 @@ index 55868da..c22866f 100644 rc = inflateInit (&strm); while (strm.avail_in > 0) { -@@ -5456,6 +6322,8 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, +@@ -5456,6 +6327,8 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, error (_("Dwarf Error: concluding DWARF uncompression in '%s': %d"), bfd_get_filename (abfd), rc); @@ -16756,7 +16730,7 @@ index 55868da..c22866f 100644 xfree (compressed_buffer); *outbuf = uncompressed_buffer; *outsize = uncompressed_size; -@@ -5463,17 +6331,20 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, +@@ -5463,17 +6336,20 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, } @@ -16782,7 +16756,7 @@ index 55868da..c22866f 100644 if (size == 0) return NULL; -@@ -5486,30 +6357,49 @@ dwarf2_read_section (struct objfile *objfile, asection *sectp) +@@ -5486,30 +6362,49 @@ dwarf2_read_section (struct objfile *objfile, asection *sectp) /* Upon decompression, update the buffer and its size. */ if (strncmp (header, "ZLIB", sizeof (header)) == 0) { @@ -16835,7 +16809,7 @@ index 55868da..c22866f 100644 /* In DWARF version 2, the description of the debugging information is stored in a separate .debug_abbrev section. Before we read any dies from a section we read in all abbreviations and install them -@@ -5749,6 +6639,7 @@ load_partial_dies (bfd *abfd, gdb_byte *info_ptr, int building_psymtab, +@@ -5749,6 +6644,7 @@ load_partial_dies (bfd *abfd, gdb_byte *info_ptr, int building_psymtab, && abbrev->tag != DW_TAG_lexical_block && abbrev->tag != DW_TAG_variable && abbrev->tag != DW_TAG_namespace @@ -16843,7 +16817,7 @@ index 55868da..c22866f 100644 && abbrev->tag != DW_TAG_member) { /* Otherwise we skip to the next sibling, if any. */ -@@ -5914,15 +6805,6 @@ read_partial_die (struct partial_die_info *part_die, +@@ -5914,15 +6810,6 @@ read_partial_die (struct partial_die_info *part_die, struct attribute attr; int has_low_pc_attr = 0; int has_high_pc_attr = 0; @@ -16859,7 +16833,7 @@ index 55868da..c22866f 100644 memset (part_die, 0, sizeof (struct partial_die_info)); -@@ -5945,47 +6827,35 @@ read_partial_die (struct partial_die_info *part_die, +@@ -5945,47 +6832,35 @@ read_partial_die (struct partial_die_info *part_die, switch (attr.name) { case DW_AT_name: @@ -16925,7 +16899,7 @@ index 55868da..c22866f 100644 case DW_AT_location: /* Support the .debug_loc offsets */ if (attr_form_is_block (&attr)) -@@ -6002,9 +6872,6 @@ read_partial_die (struct partial_die_info *part_die, +@@ -6002,9 +6877,6 @@ read_partial_die (struct partial_die_info *part_die, "partial symbol information"); } break; @@ -16935,7 +16909,7 @@ index 55868da..c22866f 100644 case DW_AT_external: part_die->is_external = DW_UNSND (&attr); break; -@@ -6029,10 +6896,6 @@ read_partial_die (struct partial_die_info *part_die, +@@ -6029,10 +6901,6 @@ read_partial_die (struct partial_die_info *part_die, part_die->sibling = dwarf2_per_objfile->info_buffer + dwarf2_get_ref_die_offset (&attr); break; @@ -16946,7 +16920,7 @@ index 55868da..c22866f 100644 case DW_AT_byte_size: part_die->has_byte_size = 1; break; -@@ -6074,13 +6937,6 @@ read_partial_die (struct partial_die_info *part_die, +@@ -6074,13 +6942,6 @@ read_partial_die (struct partial_die_info *part_die, || dwarf2_per_objfile->has_section_at_zero)) part_die->has_pc_info = 1; @@ -16960,7 +16934,7 @@ index 55868da..c22866f 100644 return info_ptr; } -@@ -6173,7 +7029,9 @@ fixup_partial_die (struct partial_die_info *part_die, +@@ -6173,7 +7034,9 @@ fixup_partial_die (struct partial_die_info *part_die, /* If we found a reference attribute and the DIE has no name, try to find a name in the referred to DIE. */ @@ -16971,7 +16945,7 @@ index 55868da..c22866f 100644 { struct partial_die_info *spec_die; -@@ -6189,6 +7047,9 @@ fixup_partial_die (struct partial_die_info *part_die, +@@ -6189,6 +7052,9 @@ fixup_partial_die (struct partial_die_info *part_die, if (spec_die->is_external) part_die->is_external = spec_die->is_external; } @@ -16981,7 +16955,7 @@ index 55868da..c22866f 100644 } /* Set default names for some unnamed DIEs. */ -@@ -7512,10 +8373,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym, +@@ -7512,10 +8378,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym, (i.e. when the value of a register or memory location is referenced, or a thread-local block, etc.). Then again, it might not be worthwhile. I'm assuming that it isn't unless performance @@ -16996,7 +16970,7 @@ index 55868da..c22866f 100644 } /* Given a pointer to a DWARF information entry, figure out if we need -@@ -7538,20 +8401,49 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -7538,20 +8406,49 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); if (die->tag != DW_TAG_namespace) @@ -17049,7 +17023,7 @@ index 55868da..c22866f 100644 /* Default assumptions. Use the passed type or decode it from the die. */ -@@ -7637,9 +8529,28 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -7637,9 +8534,28 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) if (attr) { var_decode_location (attr, sym, cu); @@ -17079,7 +17053,7 @@ index 55868da..c22866f 100644 else add_symbol_to_list (sym, cu->list_in_scope); } -@@ -7656,7 +8567,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -7656,7 +8572,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) && dwarf2_attr (die, DW_AT_type, cu) != NULL) { SYMBOL_CLASS (sym) = LOC_UNRESOLVED; @@ -17088,7 +17062,7 @@ index 55868da..c22866f 100644 } } break; -@@ -7780,6 +8691,16 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -7780,6 +8696,16 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) SYMBOL_CLASS (sym) = LOC_TYPEDEF; add_symbol_to_list (sym, &global_symbols); break; @@ -17105,7 +17079,15 @@ index 55868da..c22866f 100644 default: /* Not a tag we recognize. Hopefully we aren't processing trash data, but since we must specifically ignore things -@@ -8042,12 +8963,18 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu) +@@ -7826,6 +8752,7 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym, + DW_ADDR (attr)); + SYMBOL_CLASS (sym) = LOC_CONST_BYTES; + break; ++ case DW_FORM_string: + case DW_FORM_strp: + /* DW_STRING is already allocated on the obstack, point directly + to it. */ +@@ -8042,12 +8969,18 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_namespace: this_type = read_namespace_type (die, cu); break; @@ -17124,7 +17106,29 @@ index 55868da..c22866f 100644 return this_type; } -@@ -8128,6 +9055,19 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) +@@ -8113,9 +9046,18 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) + switch (parent->tag) + { + case DW_TAG_namespace: +- parent_type = read_type_die (parent, cu); +- /* We give a name to even anonymous namespaces. */ +- return TYPE_TAG_NAME (parent_type); ++ { ++ char *prefix; ++ parent_type = read_type_die (parent, cu); ++ /* We give a name to even anonymous namespaces. */ ++ prefix = TYPE_TAG_NAME (parent_type); ++ /* Special hack for bogus global namespace that is emitted as an ++ explicit namespace with the name '::' in g++ 4.1, for ++ some decls. */ ++ if (strcmp(prefix, "::")==0) ++ return ""; ++ return prefix; ++ } + case DW_TAG_class_type: + case DW_TAG_interface_type: + case DW_TAG_structure_type: +@@ -8128,6 +9070,19 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) members; no typedefs, no member functions, et cetera. So it does not need a prefix. */ return ""; @@ -17144,7 +17148,7 @@ index 55868da..c22866f 100644 default: return determine_prefix (parent, cu); } -@@ -8192,12 +9132,64 @@ dwarf2_linkage_name (struct die_info *die, struct dwarf2_cu *cu) +@@ -8192,12 +9147,64 @@ dwarf2_linkage_name (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu); if (attr && DW_STRING (attr)) return DW_STRING (attr); @@ -17212,7 +17216,7 @@ index 55868da..c22866f 100644 /* Get name of a die, return NULL if not found. */ static char * -@@ -8206,9 +9198,29 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu) +@@ -8206,9 +9213,29 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu) struct attribute *attr; attr = dwarf2_attr (die, DW_AT_name, cu); @@ -17245,7 +17249,7 @@ index 55868da..c22866f 100644 } /* Return the die that this die in an extension of, or NULL if there -@@ -8703,6 +9715,8 @@ dwarf_form_name (unsigned form) +@@ -8703,6 +9730,8 @@ dwarf_form_name (unsigned form) return "DW_FORM_ref_udata"; case DW_FORM_indirect: return "DW_FORM_indirect"; @@ -17254,7 +17258,7 @@ index 55868da..c22866f 100644 default: return "DW_FORM_"; } -@@ -9353,26 +10367,35 @@ dwarf2_get_ref_die_offset (struct attribute *attr) +@@ -9353,26 +10382,35 @@ dwarf2_get_ref_die_offset (struct attribute *attr) return result; } @@ -17264,8 +17268,8 @@ index 55868da..c22866f 100644 -static int -dwarf2_get_attr_constant_value (struct attribute *attr, int default_value) -+static enum dwarf2_get_attr_constant_value -+dwarf2_get_attr_constant_value (struct attribute *attr, int *val_return) ++static enum get_attr_constant_value ++get_attr_constant_value (struct attribute *attr, int *val_return) { + if (attr == NULL) + return dwarf2_attr_unknown; @@ -17284,7 +17288,7 @@ index 55868da..c22866f 100644 - return default_value; + *val_return = DW_SND (attr); + return dwarf2_attr_const; - } ++ } + if (attr->form == DW_FORM_udata + || attr->form == DW_FORM_data1 + || attr->form == DW_FORM_data2 @@ -17293,7 +17297,7 @@ index 55868da..c22866f 100644 + { + *val_return = DW_UNSND (attr); + return dwarf2_attr_const; -+ } + } + if (attr->form == DW_FORM_block + || attr->form == DW_FORM_block1 + || attr->form == DW_FORM_block2 @@ -17305,7 +17309,7 @@ index 55868da..c22866f 100644 } /* THIS_CU has a reference to PER_CU. If necessary, load the new compilation -@@ -9963,6 +10986,17 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -9963,6 +11001,17 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, { gdb_byte *mac_ptr, *mac_end; struct macro_source_file *current_file = 0; @@ -17323,7 +17327,7 @@ index 55868da..c22866f 100644 if (dwarf2_per_objfile->macinfo_buffer == NULL) { -@@ -9970,19 +11004,24 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -9970,19 +11019,24 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, return; } @@ -17352,7 +17356,7 @@ index 55868da..c22866f 100644 } macinfo_type = read_1_byte (abfd, mac_ptr); -@@ -9993,7 +11032,81 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -9993,7 +11047,81 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, /* A zero macinfo type indicates the end of the macro information. */ case 0: @@ -17435,7 +17439,7 @@ index 55868da..c22866f 100644 case DW_MACINFO_define: case DW_MACINFO_undef: -@@ -10008,19 +11121,31 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -10008,19 +11136,31 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, mac_ptr += bytes_read; if (! current_file) @@ -17478,7 +17482,7 @@ index 55868da..c22866f 100644 } break; -@@ -10034,9 +11159,22 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -10034,9 +11174,22 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, file = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read); mac_ptr += bytes_read; @@ -17504,7 +17508,7 @@ index 55868da..c22866f 100644 } break; -@@ -10090,7 +11228,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -10090,7 +11243,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, } break; } @@ -17513,7 +17517,16 @@ index 55868da..c22866f 100644 } /* Check if the attribute's form is a DW_FORM_block* -@@ -10150,6 +11288,34 @@ attr_form_is_constant (struct attribute *attr) +@@ -10123,7 +11276,7 @@ attr_form_is_section_offset (struct attribute *attr) + + /* Return non-zero if ATTR's value falls in the 'constant' class, or + zero otherwise. When this function returns true, you can apply +- dwarf2_get_attr_constant_value to it. ++ get_attr_constant_value to it. + + However, note that for some attributes you must check + attr_form_is_section_offset before using this test. DW_FORM_data4 +@@ -10150,6 +11303,34 @@ attr_form_is_constant (struct attribute *attr) } } @@ -17548,7 +17561,7 @@ index 55868da..c22866f 100644 static void dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, struct dwarf2_cu *cu) -@@ -10179,35 +11345,24 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, +@@ -10179,35 +11360,24 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, SYMBOL_OPS (sym) = &dwarf2_loclist_funcs; SYMBOL_LOCATION_BATON (sym) = baton; } @@ -17598,7 +17611,7 @@ index 55868da..c22866f 100644 } } -@@ -10482,6 +11637,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) +@@ -10482,6 +11652,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) return ofs_lhs->offset == ofs_rhs->offset; } @@ -17630,7 +17643,7 @@ index 55868da..c22866f 100644 /* Set the type associated with DIE to TYPE. Save it in CU's hash table if necessary. For convenience, return TYPE. */ -@@ -10490,6 +11670,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -10490,6 +11685,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) { struct dwarf2_offset_and_type **slot, ofs; @@ -20112,7 +20125,7 @@ index 3a405a8..a2e2636 100644 once for each known thread. */ typedef int (*thread_callback_func) (struct thread_info *, void *); diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c -index 8102321..012485c 100644 +index 8102321..9899727 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -38,6 +38,8 @@ @@ -20318,17 +20331,7 @@ index 8102321..012485c 100644 if (low_bound >= 0) TYPE_UNSIGNED (result_type) = 1; -@@ -727,6 +769,9 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp) - switch (TYPE_CODE (type)) - { - case TYPE_CODE_RANGE: -+ if (TYPE_RANGE_UPPER_BOUND_IS_UNDEFINED (type) -+ || TYPE_RANGE_LOWER_BOUND_IS_UNDEFINED (type)) -+ return -1; - *lowp = TYPE_LOW_BOUND (type); - *highp = TYPE_HIGH_BOUND (type); - return 1; -@@ -805,30 +850,56 @@ create_array_type (struct type *result_type, +@@ -805,30 +847,56 @@ create_array_type (struct type *result_type, if (result_type == NULL) { @@ -20399,7 +20402,7 @@ index 8102321..012485c 100644 return (result_type); } -@@ -865,7 +936,12 @@ create_set_type (struct type *result_type, struct type *domain_type) +@@ -865,7 +933,12 @@ create_set_type (struct type *result_type, struct type *domain_type) { if (result_type == NULL) { @@ -20413,7 +20416,7 @@ index 8102321..012485c 100644 } TYPE_CODE (result_type) = TYPE_CODE_SET; TYPE_NFIELDS (result_type) = 1; -@@ -1368,6 +1444,84 @@ stub_noname_complaint (void) +@@ -1368,6 +1441,84 @@ stub_noname_complaint (void) complaint (&symfile_complaints, _("stub type has NULL name")); } @@ -20498,7 +20501,7 @@ index 8102321..012485c 100644 /* Added by Bryan Boreham, Kewill, Sun Sep 17 18:07:17 1989. If this is a stubbed struct (i.e. declared as struct foo *), see if -@@ -1384,7 +1538,8 @@ stub_noname_complaint (void) +@@ -1384,7 +1535,8 @@ stub_noname_complaint (void) /* Find the real type of TYPE. This function returns the real type, after removing all layers of typedefs and completing opaque or stub types. Completion changes the TYPE argument, but stripping of @@ -20508,7 +20511,7 @@ index 8102321..012485c 100644 struct type * check_typedef (struct type *type) -@@ -1420,7 +1575,7 @@ check_typedef (struct type *type) +@@ -1420,7 +1572,7 @@ check_typedef (struct type *type) if (sym) TYPE_TARGET_TYPE (type) = SYMBOL_TYPE (sym); else /* TYPE_CODE_UNDEF */ @@ -20517,7 +20520,7 @@ index 8102321..012485c 100644 } type = TYPE_TARGET_TYPE (type); } -@@ -1494,34 +1649,37 @@ check_typedef (struct type *type) +@@ -1494,34 +1646,37 @@ check_typedef (struct type *type) } } @@ -20573,7 +20576,7 @@ index 8102321..012485c 100644 TYPE_TARGET_STUB (type) = 0; } else if (TYPE_CODE (type) == TYPE_CODE_RANGE) -@@ -1529,9 +1687,12 @@ check_typedef (struct type *type) +@@ -1529,9 +1684,12 @@ check_typedef (struct type *type) TYPE_LENGTH (type) = TYPE_LENGTH (target_type); TYPE_TARGET_STUB (type) = 0; } @@ -20586,7 +20589,7 @@ index 8102321..012485c 100644 return type; } -@@ -1753,7 +1914,7 @@ init_type (enum type_code code, int length, int flags, +@@ -1753,7 +1911,7 @@ init_type (enum type_code code, int length, int flags, { struct type *type; @@ -20595,7 +20598,7 @@ index 8102321..012485c 100644 TYPE_CODE (type) = code; TYPE_LENGTH (type) = length; -@@ -1783,15 +1944,24 @@ init_type (enum type_code code, int length, int flags, +@@ -1783,15 +1941,24 @@ init_type (enum type_code code, int length, int flags, if (flags & TYPE_FLAG_FIXED_INSTANCE) TYPE_FIXED_INSTANCE (type) = 1; @@ -20629,7 +20632,7 @@ index 8102321..012485c 100644 /* C++ fancies. */ -@@ -1803,6 +1973,10 @@ init_type (enum type_code code, int length, int flags, +@@ -1803,6 +1970,10 @@ init_type (enum type_code code, int length, int flags, { INIT_CPLUS_SPECIFIC (type); } @@ -20640,7 +20643,7 @@ index 8102321..012485c 100644 return (type); } -@@ -2916,33 +3090,47 @@ type_pair_eq (const void *item_lhs, const void *item_rhs) +@@ -2916,33 +3087,47 @@ type_pair_eq (const void *item_lhs, const void *item_rhs) } /* Allocate the hash table used by copy_type_recursive to walk @@ -20703,7 +20706,7 @@ index 8102321..012485c 100644 return type; /* This type shouldn't be pointing to any types in other objfiles; -@@ -2954,11 +3142,15 @@ copy_type_recursive (struct objfile *objfile, +@@ -2954,11 +3139,15 @@ copy_type_recursive (struct objfile *objfile, if (*slot != NULL) return ((struct type_pair *) *slot)->new; @@ -20722,7 +20725,7 @@ index 8102321..012485c 100644 stored->old = type; stored->new = new_type; *slot = stored; -@@ -2968,6 +3160,13 @@ copy_type_recursive (struct objfile *objfile, +@@ -2968,6 +3157,13 @@ copy_type_recursive (struct objfile *objfile, *TYPE_MAIN_TYPE (new_type) = *TYPE_MAIN_TYPE (type); TYPE_OBJFILE (new_type) = NULL; @@ -20736,7 +20739,7 @@ index 8102321..012485c 100644 if (TYPE_NAME (type)) TYPE_NAME (new_type) = xstrdup (TYPE_NAME (type)); if (TYPE_TAG_NAME (type)) -@@ -2976,12 +3175,45 @@ copy_type_recursive (struct objfile *objfile, +@@ -2976,12 +3172,45 @@ copy_type_recursive (struct objfile *objfile, TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type); TYPE_LENGTH (new_type) = TYPE_LENGTH (type); @@ -20782,7 +20785,7 @@ index 8102321..012485c 100644 TYPE_FIELDS (new_type) = XCALLOC (nfields, struct field); for (i = 0; i < nfields; i++) { -@@ -2990,8 +3222,8 @@ copy_type_recursive (struct objfile *objfile, +@@ -2990,8 +3219,8 @@ copy_type_recursive (struct objfile *objfile, TYPE_FIELD_BITSIZE (new_type, i) = TYPE_FIELD_BITSIZE (type, i); if (TYPE_FIELD_TYPE (type, i)) TYPE_FIELD_TYPE (new_type, i) @@ -20793,7 +20796,7 @@ index 8102321..012485c 100644 if (TYPE_FIELD_NAME (type, i)) TYPE_FIELD_NAME (new_type, i) = xstrdup (TYPE_FIELD_NAME (type, i)); -@@ -3010,6 +3242,16 @@ copy_type_recursive (struct objfile *objfile, +@@ -3010,6 +3239,16 @@ copy_type_recursive (struct objfile *objfile, xstrdup (TYPE_FIELD_STATIC_PHYSNAME (type, i))); break; @@ -20810,7 +20813,7 @@ index 8102321..012485c 100644 default: internal_error (__FILE__, __LINE__, _("Unexpected type field location kind: %d"), -@@ -3018,17 +3260,32 @@ copy_type_recursive (struct objfile *objfile, +@@ -3018,17 +3257,32 @@ copy_type_recursive (struct objfile *objfile, } } @@ -20849,7 +20852,7 @@ index 8102321..012485c 100644 /* Maybe copy the type_specific bits. NOTE drow/2005-12-09: We do not copy the C++-specific bits like -@@ -3046,6 +3303,20 @@ copy_type_recursive (struct objfile *objfile, +@@ -3046,6 +3300,20 @@ copy_type_recursive (struct objfile *objfile, return new_type; } @@ -20870,7 +20873,7 @@ index 8102321..012485c 100644 /* Make a copy of the given TYPE, except that the pointer & reference types are not preserved. -@@ -3059,7 +3330,7 @@ copy_type (const struct type *type) +@@ -3059,7 +3327,7 @@ copy_type (const struct type *type) gdb_assert (TYPE_OBJFILE (type) != NULL); @@ -20879,7 +20882,7 @@ index 8102321..012485c 100644 TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type); TYPE_LENGTH (new_type) = TYPE_LENGTH (type); memcpy (TYPE_MAIN_TYPE (new_type), TYPE_MAIN_TYPE (type), -@@ -3068,6 +3339,232 @@ copy_type (const struct type *type) +@@ -3068,6 +3336,232 @@ copy_type (const struct type *type) return new_type; } @@ -21112,7 +21115,7 @@ index 8102321..012485c 100644 static struct type * build_flt (int bit, char *name, const struct floatformat **floatformats) { -@@ -3105,7 +3602,7 @@ build_complex (int bit, char *name, struct type *target_type) +@@ -3105,7 +3599,7 @@ build_complex (int bit, char *name, struct type *target_type) return builtin_type_error; } t = init_type (TYPE_CODE_COMPLEX, 2 * bit / TARGET_CHAR_BIT, @@ -21121,7 +21124,7 @@ index 8102321..012485c 100644 TYPE_TARGET_TYPE (t) = target_type; return t; } -@@ -3119,56 +3616,56 @@ gdbtypes_post_init (struct gdbarch *gdbarch) +@@ -3119,56 +3613,56 @@ gdbtypes_post_init (struct gdbarch *gdbarch) builtin_type->builtin_void = init_type (TYPE_CODE_VOID, 1, 0, @@ -21190,7 +21193,7 @@ index 8102321..012485c 100644 builtin_type->builtin_float = build_flt (gdbarch_float_bit (gdbarch), "float", gdbarch_float_format (gdbarch)); -@@ -3187,26 +3684,26 @@ gdbtypes_post_init (struct gdbarch *gdbarch) +@@ -3187,26 +3681,26 @@ gdbtypes_post_init (struct gdbarch *gdbarch) builtin_type->builtin_string = init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0, @@ -21222,7 +21225,7 @@ index 8102321..012485c 100644 /* Pointer/Address types. */ -@@ -3245,27 +3742,28 @@ gdbtypes_post_init (struct gdbarch *gdbarch) +@@ -3245,27 +3739,28 @@ gdbtypes_post_init (struct gdbarch *gdbarch) init_type (TYPE_CODE_INT, gdbarch_addr_bit (gdbarch) / 8, TYPE_FLAG_UNSIGNED, @@ -21256,7 +21259,7 @@ index 8102321..012485c 100644 return builtin_type; } -@@ -3276,6 +3774,9 @@ _initialize_gdbtypes (void) +@@ -3276,6 +3771,9 @@ _initialize_gdbtypes (void) { gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init); @@ -21266,7 +21269,7 @@ index 8102321..012485c 100644 /* FIXME: The following types are architecture-neutral. However, they contain pointer_type and reference_type fields potentially caching pointer or reference types that *are* architecture -@@ -3284,47 +3785,47 @@ _initialize_gdbtypes (void) +@@ -3284,47 +3782,47 @@ _initialize_gdbtypes (void) builtin_type_int0 = init_type (TYPE_CODE_INT, 0 / 8, 0, @@ -21325,7 +21328,7 @@ index 8102321..012485c 100644 builtin_type_ieee_single = build_flt (-1, "builtin_type_ieee_single", floatformats_ieee_single); -@@ -3344,15 +3845,15 @@ _initialize_gdbtypes (void) +@@ -3344,15 +3842,15 @@ _initialize_gdbtypes (void) builtin_type_void = init_type (TYPE_CODE_VOID, 1, 0, @@ -21807,39 +21810,10 @@ index f40b6b7..ff429c4 100644 { /* If this system does not support PT_STEP, a higher level diff --git a/gdb/infcall.c b/gdb/infcall.c -index d6da8b2..80168b3 100644 +index d6da8b2..2f483f3 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c -@@ -98,6 +98,28 @@ Unwinding of stack if a signal is received while in a call dummy is %s.\n"), - value); - } - -+/* This boolean tells what gdb should do if a std::terminate call is -+ made while in a function called from gdb (call dummy). -+ As the confines of a single dummy stack prohibit out-of-frame -+ handlers from handling a raised exception, and as out-of-frame -+ handlers are common in C++, this can lead to no handler being found -+ by the unwinder, and a std::terminate call. This is a false positive. -+ If set, gdb unwinds the stack and restores the context to what it -+ was before the call. -+ -+ The default is to unwind the frame if a std::terminate call is made.. */ -+ -+static int unwind_on_terminating_exception_p = 1; -+static void -+show_unwind_on_terminating_exception_p (struct ui_file *file, int from_tty, -+ struct cmd_list_element *c, -+ const char *value) -+ -+{ -+ fprintf_filtered (file, _("\ -+Unwind stack if a C++ exception is unhandled while in a call dummy is %s.\n"), -+ value); -+} - - /* Perform the standard coercions that are specified - for arguments to be passed to C or Ada functions. -@@ -217,7 +239,7 @@ find_function_addr (struct value *function, struct type **retval_type) +@@ -217,7 +217,7 @@ find_function_addr (struct value *function, struct type **retval_type) /* Determine address to call. */ if (code == TYPE_CODE_FUNC || code == TYPE_CODE_METHOD) { @@ -21848,121 +21822,6 @@ index d6da8b2..80168b3 100644 value_type = TYPE_TARGET_TYPE (ftype); } else if (code == TYPE_CODE_PTR) -@@ -419,6 +441,8 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) - struct cleanup *args_cleanup; - struct frame_info *frame; - struct gdbarch *gdbarch; -+ struct breakpoint *terminate_bp = 0; -+ struct minimal_symbol *tm; - ptid_t call_thread_ptid; - struct gdb_exception e; - const char *name; -@@ -718,6 +742,29 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) - bpt = set_momentary_breakpoint (sal, dummy_id, bp_call_dummy); - bpt->disposition = disp_del; - } -+ -+ /* Create a breakpoint in std::terminate. -+ If a C++ exception is raised in the dummy-frame, and the -+ exception handler is (normally, and expected to be) out-of-frame, -+ the default C++ handler will (wrongly) be called in an inferior -+ function call. This is wrong, as an exception can be normally -+ and legally handled out-of-frame. The confines of the dummy frame -+ prevent the unwinder from finding the correct handler (or any -+ handler, unless it is in-frame). The default handler calls -+ std::terminate. This will kill the inferior. Assert that -+ terminate should never be called in an inferior function -+ call. Place a momentary breakpoint in the std::terminate function -+ and if triggered in the call, rewind */ -+ if (unwind_on_terminating_exception_p) -+ { -+ tm = lookup_minimal_symbol ("std::terminate()", NULL, NULL); -+ if (tm != NULL) -+ { -+ terminate_bp = set_momentary_breakpoint_at_pc -+ (SYMBOL_VALUE_ADDRESS (tm), bp_breakpoint); -+ make_cleanup_delete_breakpoint (terminate_bp); -+ } -+ } - - /* Everything's ready, push all the info needed to restore the - caller (and identify the dummy-frame) onto the dummy-frame -@@ -828,6 +875,16 @@ When the function is done executing, GDB will silently stop."), - name); - } - -+ if (! target_has_execution) -+ { -+ /* If we try to restore the inferior status (via the cleanup), -+ we'll crash as the inferior is no longer running. */ -+ discard_cleanups (inf_status_cleanup); -+ discard_inferior_status (inf_status); -+ error (_("\ -+The program being debugged exited while in a function called from GDB.")); -+ } -+ - if (stopped_by_random_signal || !stop_stack_dummy) - { - const char *name = get_function_name (funaddr, -@@ -884,6 +941,38 @@ When the function is done executing, GDB will silently stop."), - - if (!stop_stack_dummy) - { -+ -+ /* Check if unwind on terminating exception behaviour is on */ -+ if (unwind_on_terminating_exception_p) -+ { -+ /* Check that the breakpoint is our special std::terminate -+ breakpoint. If it is, we do not want to kill the inferior -+ in an inferior function call. Rewind, and warn the user */ -+ -+ if ((terminate_bp != NULL) && -+ (inferior_thread()->stop_bpstat->breakpoint_at->address -+ == terminate_bp->loc->address)) -+ -+ -+ { -+ -+ /* We must get back to the frame we were before the -+ dummy call. */ -+ dummy_frame_pop (dummy_id); -+ -+ /* We also need to restore inferior status to that before the -+ dummy call. */ -+ restore_inferior_status (inf_status); -+ -+ error (_("\ -+The program being debugged entered a std::terminate call which would\n\ -+have terminated the program being debugged. GDB has restored the\n\ -+context to what it was before the call\n\ -+To change this behaviour use \"set unwind-on-terminating-exception off\"\n\ -+Evaluation of the expression containing the function (%s) will be abandoned."), -+ name); -+ } -+ } - /* We hit a breakpoint inside the FUNCTION. - Keep the dummy frame, the user may want to examine its state. - Discard inferior status, we're not at the same point -@@ -992,4 +1081,19 @@ The default is to stop in the frame where the signal was received."), - NULL, - show_unwind_on_signal_p, - &setlist, &showlist); -+ -+ add_setshow_boolean_cmd ("unwind-on-terminating-exception", no_class, -+ &unwind_on_terminating_exception_p, _("\ -+Set unwinding of stack if a std::terminate() call originates from\n\ -+the default C++ exception handler."), _("\ -+Show unwinding of stack if a std::terminate() call originates from\n\ -+the default C++ exception handler."), _("\ -+The unwind on terminating exception flag lets the user determine\n\ -+what gdb should do if a std::terminate() call is made from the\n\ -+default exception handler.\n\ -+The default is to unwind the frame."), -+ NULL, -+ show_unwind_on_terminating_exception_p, -+ &setlist, &showlist); -+ - } diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 0a17dab..d48f4b1 100644 --- a/gdb/infcmd.c @@ -25217,10 +25076,10 @@ index 0000000..fe7c072 +register_libstdcxx_printers (gdb.current_objfile ()) diff --git a/gdb/python/lib/gdb/libstdcxx/v6/printers.py b/gdb/python/lib/gdb/libstdcxx/v6/printers.py new file mode 100644 -index 0000000..58fd91c +index 0000000..8c0efc5 --- /dev/null +++ b/gdb/python/lib/gdb/libstdcxx/v6/printers.py -@@ -0,0 +1,629 @@ +@@ -0,0 +1,631 @@ +# Pretty-printers for libstc++. + +# Copyright (C) 2008, 2009 Free Software Foundation, Inc. @@ -25250,9 +25109,11 @@ index 0000000..58fd91c + self.val = val + + def to_string (self): ++ if self.val['_M_refcount']['_M_pi'] == 0: ++ return '%s (empty) %s' % (self.typename, self.val['_M_ptr']) + return '%s (count %d) %s' % (self.typename, -+ self.val['_M_refcount']['_M_pi']['_M_use_count'], -+ self.val['_M_ptr']) ++ self.val['_M_refcount']['_M_pi']['_M_use_count'], ++ self.val['_M_ptr']) + +class UniquePointerPrinter: + "Print a unique_ptr" @@ -35636,6 +35497,42 @@ index 9f382db..12db521 100644 MISCELLANEOUS = coremmap.data ../foobar.baz \ shr1.sl shr2.sl solib_sl.sl solib1.sl solib2.sl +diff --git a/gdb/testsuite/gdb.base/arrayidx.c b/gdb/testsuite/gdb.base/arrayidx.c +index 98d4d35..f98a656 100644 +--- a/gdb/testsuite/gdb.base/arrayidx.c ++++ b/gdb/testsuite/gdb.base/arrayidx.c +@@ -17,6 +17,13 @@ + + int array[] = {1, 2, 3, 4}; + ++#ifdef __GNUC__ ++struct ++ { ++ int a[0]; ++ } unbound; ++#endif ++ + int + main (void) + { +diff --git a/gdb/testsuite/gdb.base/arrayidx.exp b/gdb/testsuite/gdb.base/arrayidx.exp +index 71ce4aa..af0e5f8 100644 +--- a/gdb/testsuite/gdb.base/arrayidx.exp ++++ b/gdb/testsuite/gdb.base/arrayidx.exp +@@ -59,4 +59,12 @@ gdb_test "print array" \ + "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \ + "Print array with array-indexes on" + +- ++set test "p unbound.a == &unbound.a\[0\]" ++gdb_test_multiple $test $test { ++ -re " = 1\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "No symbol \"unbound\" in current context.\r\n$gdb_prompt $" { ++ unsupported "$test (no GCC)" ++ } ++} diff --git a/gdb/testsuite/gdb.base/call-rt-st.exp b/gdb/testsuite/gdb.base/call-rt-st.exp index 3359c70..f73dd7f 100644 --- a/gdb/testsuite/gdb.base/call-rt-st.exp @@ -37716,19 +37613,6 @@ index 0000000..5da7378 +gdb_test "p temp1" " = '1' " "second: print temp1" +gdb_test "p temp2" " = '2' " "second: print temp2" +gdb_test "p temp3" " = '3' " "second: print temp3" -diff --git a/gdb/testsuite/gdb.cp/Makefile.in b/gdb/testsuite/gdb.cp/Makefile.in -index 1787ad5..391bfc2 100644 ---- a/gdb/testsuite/gdb.cp/Makefile.in -+++ b/gdb/testsuite/gdb.cp/Makefile.in -@@ -4,7 +4,7 @@ srcdir = @srcdir@ - EXECUTABLES = ambiguous annota2 anon-union cplusfuncs cttiadd \ - derivation inherit local member-ptr method misc \ - overload ovldbreak ref-typ ref-typ2 templates userdef virtfunc namespace \ -- ref-types ref-params method2 pr9594 -+ ref-types ref-params method2 pr9594 gdb2495 - - all info install-info dvi install uninstall installcheck check: - @echo "Nothing to be done for $@..." diff --git a/gdb/testsuite/gdb.cp/abstract-origin.cc b/gdb/testsuite/gdb.cp/abstract-origin.cc new file mode 100644 index 0000000..e2de3fb @@ -38314,268 +38198,6 @@ index 77687a6..66d16cf 100644 set f_uc "${ws}unsigned char m_unsigned_char;" set f_f "${ws}float m_float;" set f_d "${ws}double m_double;" -diff --git a/gdb/testsuite/gdb.cp/gdb2495.cc b/gdb/testsuite/gdb.cp/gdb2495.cc -new file mode 100644 -index 0000000..4df265f ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/gdb2495.cc -@@ -0,0 +1,90 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ 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 . -+ */ -+ -+#include -+#include -+ -+using namespace std; -+ -+class SimpleException -+{ -+ -+public: -+ -+ void raise_signal (int dummy) -+ { -+ if (dummy > 0) -+ raise(SIGABRT); -+ } -+ -+ int no_throw_function () -+ { -+ return 1; -+ } -+ -+ void throw_function () -+ { -+ throw 1; -+ } -+ -+ int throw_function_with_handler () -+ { -+ try -+ { -+ throw 1; -+ } -+ catch (...) -+ { -+ cout << "Handled" << endl; -+ } -+ -+ return 2; -+ } -+ -+ void call_throw_function_no_handler () -+ { -+ throw_function (); -+ } -+ -+ void call_throw_function_handler () -+ { -+ throw_function_with_handler (); -+ } -+}; -+SimpleException exceptions; -+ -+int -+main() -+{ -+ // Have to call all these functions -+ // so not optimized away. -+ exceptions.raise_signal (-1); -+ exceptions.no_throw_function (); -+ exceptions.throw_function_with_handler (); -+ exceptions.call_throw_function_handler (); -+ try -+ { -+ exceptions.throw_function (); -+ exceptions.call_throw_function_no_handler (); -+ } -+ catch (...) -+ { -+ } -+ return 0; -+} -+ -diff --git a/gdb/testsuite/gdb.cp/gdb2495.exp b/gdb/testsuite/gdb.cp/gdb2495.exp -new file mode 100644 -index 0000000..62c09c2 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/gdb2495.exp -@@ -0,0 +1,160 @@ -+# 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 . -+ -+ -+# In gdb inferior function calls, if a C++ exception is raised in the -+# dummy-frame, and the exception handler is (normally, and expected to -+# be) out-of-frame, the default C++ handler will (wrongly) be called -+# in an inferior function call. -+# This is incorrect as an exception can normally and legally be handled -+# out-of-frame. The confines of the dummy frame prevent the unwinder -+# from finding the correct handler (or any handler, unless it is -+# in-frame). The default handler calls std::terminate. This will kill -+# the inferior. Assert that terminate should never be called in an -+# inferior function call. These tests test the functionality around -+# unwinding that sequence and also tests the flag behaviour gating this -+# functionality. -+ -+# This test is largley based off gdb.base/callfuncs.exp. -+ -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+if { [skip_cplus_tests] } { continue } -+ -+set prms_id 2495 -+set bug_id 0 -+ -+set testfile "gdb2495" -+set srcfile ${testfile}.cc -+set binfile $objdir/$subdir/$testfile -+ -+# Create and source the file that provides information about the compiler -+# used to compile the test case. -+if [get_compiler_info ${binfile} "c++"] { -+ return -1 -+} -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { -+ untested gdb2495.exp -+ return -1 -+} -+ -+# Some targets can't do function calls, so don't even bother with this -+# test. -+if [target_info exists gdb,cannot_call_functions] { -+ setup_xfail "*-*-*" 2416 -+ fail "This target can not call functions" -+ continue -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+if ![runto_main] then { -+ perror "couldn't run to main" -+ continue -+} -+ -+# See http://sources.redhat.com/gdb/bugs/2495 -+ -+# Test normal baseline behaviour. Call a function that -+# does not raise an exception ... -+gdb_test "p exceptions.no_throw_function()" " = 1" -+# And one that does but handles it in-frame ... -+gdb_test "p exceptions.throw_function_with_handler()" " = 2" -+# Both should return normally. -+ -+# Test basic unwind. Call a function that raises an exception but -+# does not handle it. It should be rewound ... -+gdb_test "p exceptions.throw_function()" \ -+ "The program being debugged entered a std::terminate call .*" \ -+ "Call a function that raises an exception without a handler." -+ -+# Make sure that after rewinding we are back at the call parent. -+gdb_test "bt" \ -+ "#0 main.*" \ -+ "bt after returning from a popped frame" -+ -+# Make sure the only breakpoint is the one set via the runto_main -+# call and that the std::terminate breakpoint has evaporated and -+# cleaned-up. -+gdb_test "info breakpoints" \ -+ "gdb.cp/gdb2495\.cc.*" -+ -+# Turn off this new behaviour ... -+send_gdb "set unwind-on-terminating-exception off\n" -+gdb_expect { -+ -re "$gdb_prompt $" {pass "set unwind-on-terminating-exception"} -+ timeout {fail "(timeout) set unwind-on-terminating-exception"} -+} -+ -+# Check that it is turned off ... -+gdb_test "show unwind-on-terminating-exception" \ -+ "exception is unhandled while in a call dummy is off.*" \ -+ "Turn off unwind on terminating exception flag" -+ -+# Check that the old behaviour is restored. -+gdb_test "p exceptions.throw_function()" \ -+ "The program being debugged stopped while in a function called .*" \ -+ "Call a function that raises an exception with unwinding off.." -+ -+ -+# Restart back at main -+if ![runto_main] then { -+ perror "couldn't run to main" -+ continue -+} -+ -+ -+# Check to see if our new behaviour alters the unwind signal -+# behaviour. It should not. Test both on and off states. -+ -+# Turn on unwind on signal behaviour ... -+send_gdb "set unwindonsignal on\n" -+gdb_expect { -+ -re "$gdb_prompt $" {pass "set unwindonsignal on"} -+ timeout {fail "(timeout) set unwindonsignal on"} -+} -+ -+# Check that it is turned on ... -+gdb_test "show unwindonsignal" \ -+ "signal is received while in a call dummy is on.*" \ -+ "Turn on unwind on signal" -+ -+# Check to see if new behaviour interferes with -+# normal signal handling in inferior function calls. -+gdb_test "p exceptions.raise_signal(1)" \ -+ "To change this behavior use \"set unwindonsignal off\".*" -+ -+# And reverse. Turn off -+send_gdb "set unwindonsignal off\n" -+gdb_expect { -+ -re "$gdb_prompt $" {pass "set unwindonsignal off"} -+ timeout {fail "(timeout) set unwindonsignal off"} -+} -+ -+# Check that it is turned off ... -+gdb_test "show unwindonsignal" \ -+ "signal is received while in a call dummy is off.*" \ -+ "Turn off unwind on signal" -+ -+# Check to see if new behaviour interferes with -+# normal signal handling in inferior function calls. -+gdb_test "p exceptions.raise_signal(1)" \ -+ "To change this behavior use \"set unwindonsignal on\".*" diff --git a/gdb/testsuite/gdb.cp/member-ptr.cc b/gdb/testsuite/gdb.cp/member-ptr.cc index 1dff70a..648b2af 100644 --- a/gdb/testsuite/gdb.cp/member-ptr.cc @@ -39458,7 +39080,7 @@ index 0000000..1c6e84a + "func.* \\(.*\\) at .*" \ + "step" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-strp.S b/gdb/testsuite/gdb.dwarf2/dw2-strp.S -index a1602a5..293cc1b 100644 +index a1602a5..4dbb761 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-strp.S +++ b/gdb/testsuite/gdb.dwarf2/dw2-strp.S @@ -28,7 +28,8 @@ @@ -39471,23 +39093,60 @@ index a1602a5..293cc1b 100644 .Larray_type: .uleb128 2 /* Abbrev: DW_TAG_array_type */ -@@ -60,6 +61,10 @@ +@@ -51,15 +52,25 @@ + .byte 1 /* DW_AT_byte_size */ + .byte 6 /* DW_AT_encoding */ + +- .uleb128 5 /* Abbrev: DW_TAG_variable */ ++ .uleb128 5 /* Abbrev: DW_TAG_variable DW_FORM_strp */ + .4byte .Lvarname /* DW_AT_name */ + .4byte .Lconst_type-.Lcu1_begin/* DW_AT_type */ + .4byte .Lvarcontents /* DW_AT_const_value */ + .byte 1 /* DW_AT_external */ + ++ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */ ++ .string "a_string2" /* DW_AT_name */ ++ .4byte .Lconst_type-.Lcu1_begin/* DW_AT_type */ ++ .string "hello world2\n" /* DW_AT_const_value */ ++ .byte 1 /* DW_AT_external */ ++ .Lconst_type: - .uleb128 6 /* Abbrev: DW_TAG_const_type */ +- .uleb128 6 /* Abbrev: DW_TAG_const_type */ ++ .uleb128 7 /* Abbrev: DW_TAG_const_type */ .4byte .Larray_type-.Lcu1_begin/* DW_AT_type */ + -+ .uleb128 7 /* Abbrev: DW_TAG_variable (name "") */ ++ .uleb128 8 /* Abbrev: DW_TAG_variable (name "") */ + .4byte .Lemptyname /* DW_AT_name */ + .byte 0 /* End of children of CU */ .Lcu1_end: -@@ -126,6 +131,15 @@ +@@ -120,12 +131,35 @@ + .byte 0x0 /* Terminator */ + + .uleb128 6 /* Abbrev code */ ++ .uleb128 0x34 /* DW_TAG_variable */ ++ .byte 0x0 /* no_children */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .uleb128 0x1c /* DW_AT_const_value */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x3f /* DW_AT_external */ ++ .uleb128 0xc /* DW_FORM_flag */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 7 /* Abbrev code */ + .uleb128 0x26 /* DW_TAG_const_type */ + .byte 0x0 /* DW_children_no */ + .uleb128 0x49 /* DW_AT_type */ .uleb128 0x13 /* DW_FORM_ref4 */ .byte 0x0 /* Terminator */ .byte 0x0 /* Terminator */ + -+ .uleb128 7 /* Abbrev code */ ++ .uleb128 8 /* Abbrev code */ + .uleb128 0x34 /* DW_TAG_variable */ + .byte 0x0 /* DW_children_no */ + .uleb128 0x3 /* DW_AT_name */ @@ -39498,12 +39157,158 @@ index a1602a5..293cc1b 100644 .byte 0x0 /* Terminator */ /* String table */ -@@ -140,3 +154,5 @@ +@@ -140,3 +174,5 @@ .string "a_string" .Lvarcontents: .string "hello world!\n" +.Lemptyname: + .string "" +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-strp.exp b/gdb/testsuite/gdb.dwarf2/dw2-strp.exp +index 2201d30..41620a4 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-strp.exp ++++ b/gdb/testsuite/gdb.dwarf2/dw2-strp.exp +@@ -48,5 +48,8 @@ gdb_start + gdb_reinitialize_dir $srcdir/$subdir + gdb_load ${binfile} + +-gdb_test "p a_string" "\\\$1 = \"hello world!\\\\n\"" ++gdb_test "p a_string" " = \"hello world!\\\\n\"" + gdb_test "ptype a_string" "type = char \\\[14\\\]" ++ ++gdb_test "p a_string2" " = \"hello world2\\\\n\"" ++gdb_test "ptype a_string2" "type = char \\\[14\\\]" +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S +new file mode 100644 +index 0000000..5fcdd84 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S +@@ -0,0 +1,83 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2009 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 . */ ++ ++/* Debug information */ ++ ++ .section .debug_info ++.Lcu1_begin: ++ /* CU header */ ++ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */ ++.Lcu1_start: ++ .2byte 2 /* DWARF Version */ ++ .4byte .Labbrev1_begin /* Offset into abbrev section */ ++ .byte 4 /* Pointer size */ ++ ++ /* CU die */ ++ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ ++ .ascii "dw2-struct-member-data-location.c\0" /* DW_AT_name */ ++ .ascii "GNU C 4.3.2\0" /* DW_AT_producer */ ++ .byte 1 /* DW_AT_language (C) */ ++ ++.Ltype_uchar: ++ .uleb128 2 /* Abbrev: DW_TAG_structure_type */ ++ .ascii "some_struct\0" /* DW_AT_name */ ++ ++ .uleb128 3 /* Abbrev: DW_TAG_member */ ++ .ascii "field\0" /* DW_AT_name */ ++ .byte 0 /* DW_AT_data_member_location */ ++ ++ .byte 0 /* End of children of some_struct */ ++ ++ .byte 0 /* End of children of CU */ ++ ++.Lcu1_end: ++ ++/* Abbrev table */ ++ .section .debug_abbrev ++.Labbrev1_begin: ++ .uleb128 1 /* Abbrev code */ ++ .uleb128 0x11 /* DW_TAG_compile_unit */ ++ .byte 1 /* has_children */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x25 /* DW_AT_producer */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x13 /* DW_AT_language */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 2 /* Abbrev code */ ++ .uleb128 0x13 /* DW_TAG_structure_type */ ++ .byte 1 /* has_children */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 3 /* Abbrev code */ ++ .uleb128 0x0d /* DW_TAG_member */ ++ .byte 0 /* has_children */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x38 /* DW_AT_data_member_location */ ++ .uleb128 0x0b /* DW_FORM_data1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp +new file mode 100644 +index 0000000..c41151c +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp +@@ -0,0 +1,37 @@ ++# Copyright 2009 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 . ++ ++# This test can only be run on targets which support DWARF-2 and use gas. ++# For now pick a sampling of likely targets. ++if {![istarget *-*-linux*] ++ && ![istarget *-*-gnu*] ++ && ![istarget *-*-elf*] ++ && ![istarget *-*-openbsd*] ++ && ![istarget arm-*-eabi*] ++ && ![istarget powerpc-*-eabi*]} { ++ return 0 ++} ++ ++set testfile "dw2-struct-member-data-location" ++set srcfile ${testfile}.S ++set binfile ${testfile}.x ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objdir}/${subdir}/${binfile}" object {nodebug}] != "" } { ++ return -1 ++} ++ ++clean_restart $binfile ++ ++gdb_test "ptype struct some_struct" "type = struct some_struct {\[\r\n \t\]*void field;\[\r\n \t\]*}" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unresolved-main.c b/gdb/testsuite/gdb.dwarf2/dw2-unresolved-main.c new file mode 100644 index 0000000..c24eb96 @@ -40438,10 +40243,10 @@ index 0000000..4229304 + l = .FALSE. ! stop-here +end diff --git a/gdb/testsuite/gdb.fortran/module.exp b/gdb/testsuite/gdb.fortran/module.exp -index 342ccee..5f078a3 100644 +index 342ccee..c836c3c 100644 --- a/gdb/testsuite/gdb.fortran/module.exp +++ b/gdb/testsuite/gdb.fortran/module.exp -@@ -15,21 +15,30 @@ +@@ -15,21 +15,31 @@ set testfile "module" set srcfile ${testfile}.f90 @@ -40481,11 +40286,12 @@ index 342ccee..5f078a3 100644 +gdb_test "print var_b" " = 11" +gdb_test "print var_c" "No symbol \"var_c\" in current context\\." +gdb_test "print var_d" " = 12" ++gdb_test "print var_i" " = 14" "print var_i value 14" diff --git a/gdb/testsuite/gdb.fortran/module.f90 b/gdb/testsuite/gdb.fortran/module.f90 -index 501ccc8..99013dd 100644 +index 501ccc8..118931d 100644 --- a/gdb/testsuite/gdb.fortran/module.f90 +++ b/gdb/testsuite/gdb.fortran/module.f90 -@@ -13,10 +13,36 @@ +@@ -13,10 +13,37 @@ ! You should have received a copy of the GNU General Public License ! along with this program. If not, see . @@ -40503,7 +40309,7 @@ index 501ccc8..99013dd 100644 +end module mod2 + +module modmany -+ integer :: var_a = 10, var_b = 11, var_c = 12 ++ integer :: var_a = 10, var_b = 11, var_c = 12, var_i = 14 +end module modmany + + subroutine sub1 @@ -40518,13 +40324,14 @@ index 501ccc8..99013dd 100644 + var_i = var_i ! i-is-2 + end + -+ use modmany, only: var_b, var_d => var_c ++ use modmany, only: var_b, var_d => var_c, var_i + + call sub1 + call sub2 + + if (var_b .ne. 11) call abort + if (var_d .ne. 12) call abort ++ if (var_i .ne. 14) call abort + var_b = var_b ! a-b-c-d end diff --git a/gdb/testsuite/gdb.fortran/string.exp b/gdb/testsuite/gdb.fortran/string.exp diff --git a/gdb-bz507267-block-sort-fast.patch b/gdb-bz507267-block-sort-fast.patch new file mode 100644 index 0000000..9aafee1 --- /dev/null +++ b/gdb-bz507267-block-sort-fast.patch @@ -0,0 +1,76 @@ +https://bugzilla.redhat.com/show_bug.cgi?id=507267 + +--- gdb-6.8.50.20090302/gdb/buildsym.c-orig 2009-06-22 15:20:39.000000000 +0200 ++++ gdb-6.8.50.20090302/gdb/buildsym.c 2009-06-22 17:50:54.000000000 +0200 +@@ -900,6 +900,19 @@ watch_main_source_file_lossage (void) + } + } + ++/* Helper function for qsort. Parametes are `struct block *' pointers, ++ function sorts them in descending order by their BLOCK_START. */ ++ ++static int ++block_compar (const void *ap, const void *bp) ++{ ++ const struct block *a = *(const struct block **) ap; ++ const struct block *b = *(const struct block **) bp; ++ ++ return (BLOCK_START (b) > BLOCK_START (a)) ++ - (BLOCK_START (b) < BLOCK_START (a)); ++} ++ + /* Finish the symbol definitions for one main source file, close off + all the lexical contexts for that file (creating struct block's for + them), then make the struct symtab for that file and put it in the +@@ -953,32 +966,28 @@ end_symtab (CORE_ADDR end_addr, struct o + OBJF_REORDERED is true, then sort the pending blocks. */ + if ((objfile->flags & OBJF_REORDERED) && pending_blocks) + { +- /* FIXME! Remove this horrid bubble sort and use merge sort!!! */ +- int swapped; +- do +- { +- struct pending_block *pb, *pbnext; ++ unsigned count = 0; ++ struct pending_block *pb; ++ struct block **barray, **bp; ++ struct cleanup *back_to; + +- pb = pending_blocks; +- pbnext = pb->next; +- swapped = 0; ++ for (pb = pending_blocks; pb != NULL; pb = pb->next) ++ count++; + +- while (pbnext) +- { +- /* swap blocks if unordered! */ ++ barray = xmalloc (sizeof (*barray) * count); ++ back_to = make_cleanup (xfree, barray); + +- if (BLOCK_START (pb->block) < BLOCK_START (pbnext->block)) +- { +- struct block *tmp = pb->block; +- pb->block = pbnext->block; +- pbnext->block = tmp; +- swapped = 1; +- } +- pb = pbnext; +- pbnext = pbnext->next; +- } +- } +- while (swapped); ++ bp = barray; ++ for (pb = pending_blocks; pb != NULL; pb = pb->next) ++ *bp++ = pb->block; ++ ++ qsort (barray, count, sizeof (*barray), block_compar); ++ ++ bp = barray; ++ for (pb = pending_blocks; pb != NULL; pb = pb->next) ++ pb->block = *bp++; ++ ++ do_cleanups (back_to); + } + + /* Cleanup any undefined types that have been left hanging around diff --git a/gdb-orphanripper.c b/gdb-orphanripper.c index 0acd86a..90b96f0 100644 --- a/gdb-orphanripper.c +++ b/gdb-orphanripper.c @@ -90,6 +90,7 @@ static int spawn (char **argv) termios.c_oflag = 0; termios.c_cflag = CS8 | CREAD | CLOCAL | HUPCL | B9600; termios.c_lflag = IEXTEN | NOFLSH; + termios.c_line = 0; memset (termios.c_cc, _POSIX_VDISABLE, sizeof (termios.c_cc)); termios.c_cc[VTIME] = 0; termios.c_cc[VMIN ] = 1; diff --git a/gdb.changes b/gdb.changes index e527ccc..9afeaa7 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Tue Jul 28 13:44:45 CEST 2009 - rguenther@suse.de + +- Fix crash during debuginfo reading. + +------------------------------------------------------------------- +Wed Jul 8 13:22:36 CEST 2009 - rguenther@suse.de + +- Drop fixes done upstream. + ------------------------------------------------------------------- Wed Jun 17 16:43:08 CEST 2009 - matz@suse.de diff --git a/gdb.spec b/gdb.spec index 2466827..3fa3461 100644 --- a/gdb.spec +++ b/gdb.spec @@ -16,21 +16,21 @@ # -Summary: The GNU Debugger +Summary: A GNU source-level debugger for C, C++, Java and other languages Name: gdb # 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.8.50.20090302 -Release: 6 +Release: 7 # 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. -License: GNU Free Documentation License, Version 1.2 (GFDL 1.2); GPL v2 or later; GPL v3 or later -Group: Development/Tools/Debuggers +License: GPLv3+ +Group: Development/Debuggers Source: ftp://sourceware.org/pub/gdb/releases/gdb-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build -Url: http://www.gnu.org/software/gdb/ +Url: http://gnu.org/software/gdb/ # For our convenience %define gdb_src gdb-%{version} %define gdb_build build-%{_target_platform} @@ -57,7 +57,6 @@ Patch1: gdb-6.3-rh-dummykfail-20041202.patch Patch2: gdb-6.3-rh-testversion-20041202.patch # Check that libunwind works - new test then fix Patch3: gdb-6.3-rh-testlibunwind-20041202.patch -Patch4: gdb-6.3-rh-testlibunwind1fix-20041202.patch # Use convert_from_func_ptr_addr on the solib breakpoint address; # simplifies and makes more consistent the logic. Patch104: gdb-6.3-ppcdotsolib-20041022.patch @@ -170,8 +169,8 @@ Patch225: gdb-6.5-bz109921-DW_AT_decl_file-test.patch Patch229: gdb-6.3-bz140532-ppc-unwinding-test.patch # Testcase for exec() from threaded program (BZ 202689). Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch -# Backported post gdb-6.8 release fixups. -###Patch232: gdb-6.8-upstream.patch +# Backported post gdb-6.8.50.20090302 snapshot fixups. +Patch232: gdb-6.8.50.20090302-upstream.patch # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch # Temporary support for shared libraries >2GB on 64bit hosts. (BZ 231832) @@ -271,6 +270,7 @@ Patch349: gdb-archer.patch # Fix parsing elf64-i386 files for kdump PAE vmcore dumps (BZ 457187). # - Turn on 64-bit BFD support, globally enable AC_SYS_LARGEFILE. Patch352: gdb-6.8-bz457187-largefile.patch +Patch360: gdb-6.8-bz457187-largefile-test.patch # Fix crash on pretty-printer reading uninitialized std::string (BZ 495781). Patch357: gdb-c_get_string-xfree.patch # Fix crash in the charset support. @@ -278,14 +278,17 @@ Patch359: gdb-charset-crash.patch # Fix crashes due to (missing) varobj revalidation, for VLA (for BZ 377541). Patch369: gdb-varobj-revalidate-prep.patch Patch370: gdb-varobj-revalidate-core.patch +# Implement DW_OP_call_frame_cfa (for recent GCC). +Patch373: gdb-DW_OP_call_frame_cfa.patch +# Accelerate sorting blocks on reading a file (found on WebKit) (BZ 507267). +Patch374: gdb-bz507267-block-sort-fast.patch # Fix readline 5.1 warnings Patch1000: readline-5.1-random.patch Patch1001: gdb-readline6.patch Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch Patch1004: bnc492331.patch -Patch1005: bnc329420-1.patch -Patch1006: bnc329420-2.patch Patch1007: fix-gdb-backtrace.diff +Patch1008: fix-symread-crash.diff BuildRequires: bison flex gettext glibc-devel ncurses-devel texinfo zlib-devel %if %{suse_version} < 1020 BuildRequires: expat @@ -296,10 +299,12 @@ BuildRequires: readline-devel # dlopen() no longer makes rpm-libs a mandatory dependency. #Requires: rpm-libs BuildRequires: rpm-devel +%if 0%{!?_without_python:1} %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} BuildRequires: python-devel # Temporarily before it gets moved to libstdc++.rpm BuildRequires: libstdc++ +%endif # 0%{!?_without_python:1} %if 0%{?_with_testsuite:1} BuildRequires: dejagnu sharutils # gcc-objc++ is not covered by the GDB testsuite. @@ -328,57 +333,21 @@ Requires(post): /sbin/install-info Requires(preun): /sbin/install-info %description -You can use GDB to debug programs written in C, C++, Ada, and Modula-2. -GNU Fortran 77 support is also partially included. - - - -Authors: --------- - Doug Evans - Fred Fish - Ian Lance Taylor - J.T. Conklin - Jason Molenda - Jeffrey A. Law - Jim Kingdon - Kung Hsu - Michael Meissner - Per Bothner - Peter Schauer - Rob Savoye - Stan Shebs - Steve Chamberlain - Stu Grossman +GDB, the GNU debugger, allows you to debug programs written in C, C++, +Java, and other languages, by executing them in a controlled fashion +and printing their data. %package -n gdbserver -License: GPL v2 or later; GPL v3 or later -Summary: Remote Server for the GNU Debugger -Group: Development/Tools/Debuggers +License: GPLv3+ +Summary: A standalone server for GDB (the GNU source-level debugger) +Group: Development/Debuggers %description -n gdbserver -GDBSERVER is a program that allows you to run GDB on a different -machine than the one which is running the program being debugged. +GDB, the GNU debugger, allows you to debug programs written in C, C++, +Java, and other languages, by executing them in a controlled fashion +and printing their data. - - -Authors: --------- - Doug Evans - Fred Fish - Ian Lance Taylor - J.T. Conklin - Jason Molenda - Jeffrey A. Law - Jim Kingdon - Kung Hsu - Michael Meissner - Per Bothner - Peter Schauer - Rob Savoye - Stan Shebs - Steve Chamberlain - Stu Grossman +This package provides a program that allows you to run GDB on a different machine than the one which is running the program being debugged. %prep # This allows the tarball name to be different from our @@ -391,11 +360,10 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c # Match the Fedora's version info. %patch2 -p1 %if 0%{!?_with_upstream:1} -###patch232 -p1 +%patch232 -p1 %patch349 -p1 %patch1 -p1 %patch3 -p1 -%patch4 -p1 %patch104 -p1 %patch105 -p1 %patch106 -p1 @@ -501,8 +469,11 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch352 -p1 %patch357 -p1 %patch359 -p1 +%patch360 -p1 %patch369 -p1 %patch370 -p1 +%patch373 -p1 +%patch374 -p1 %patch124 -p1 %patch1000 %if %{suse_version} > 1110 @@ -510,9 +481,8 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %endif %patch1002 -p1 %patch1004 -p1 -%patch1005 -p1 -%patch1006 %patch1007 +%patch1008 -p1 find -name "*.orig" | xargs rm -f ! find -name "*.rej" # Should not happen. %endif # 0%{!?_with_upstream:1} @@ -570,7 +540,11 @@ CFLAGS="$CFLAGS -O0 -ggdb2" --with-system-readline \ --with-expat \ --enable-tui \ +%if 0%{!?_without_python:1} --with-python \ +%else + --without-python \ +%endif --without-rpm \ %ifarch ia64 --with-libunwind \ @@ -652,10 +626,7 @@ gcc -o ./orphanripper %{SOURCE2} -Wall -lutil # Upstream GDB would lock up the testsuite run for too long on its failures. CHECK="$(echo $CHECK|sed 's#check//unix/[^ ]*#& &/-fPIE/-pie#g')" %endif # 0%{!?_with_upstream:1} - for CURRENT in $CHECK - do - ./orphanripper make -k $CURRENT || : - done + ./orphanripper make %{?_smp_mflags} -k $CHECK || : ) for t in sum log do @@ -686,6 +657,7 @@ test -x $RPM_BUILD_ROOT%{_prefix}/bin/gdbtui ln -sf gdb $RPM_BUILD_ROOT%{_prefix}/bin/gdbtui cmp $RPM_BUILD_ROOT%{_mandir}/*/gdb.1 $RPM_BUILD_ROOT%{_mandir}/*/gdbtui.1 ln -sf gdb.1 $RPM_BUILD_ROOT%{_mandir}/*/gdbtui.1 +%if 0%{!?_without_python:1} # In the future: #%# A part of the libstdc++ rpm. #%rm -rf $RPM_BUILD_ROOT%{python_sitelib}/gdb/libstdcxx @@ -697,6 +669,7 @@ for LIB in lib lib64;do sed -e 's,@dir@,%{python_sitelib}/gdb,' <$RPM_BUILD_DIR/%{gdb_src}/gdb/python/lib/gdb/libstdcxx/v6/hook.in \ >$LIBPATH/$(basename %{_prefix}/%{_lib}/libstdc++.so.6.*)-gdb.py done +%endif # 0%{!?_without_python:1} # Remove the files that are part of a gdb build but that are owned and # provided by other packages. # These are part of binutils @@ -745,7 +718,9 @@ fi %if 0%{!?_with_upstream:1} %{_bindir}/gstack %{_mandir}/*/gstack.1* +%if 0%{!?_without_python:1} %{python_sitelib}/gdb +%endif # 0%{!?_without_python:1} %{_datadir}/gdb %endif # 0%{!?_with_upstream:1} %{_infodir}/annotate.info* @@ -762,784 +737,3 @@ fi %endif %changelog -* Wed Jun 17 2009 matz@suse.de -- Apply fix for backtraces without unwind info again. [#390722] -- Disable gdb-6.5-bz218379-ppc-solib-trampoline-fix.patch, it's not - necessary anymore and breaks the above. -* Wed May 27 2009 rguenther@suse.de -- Merge FC11 update 23. - - Fix crashes due to (missing) varobj revalidation, for VLA (for brc#377541). - - Archer update to the snapshot: e2812eadef2c15baeccd003e11fdf3fbc0b90dc2 - - Archer backport: 58dcda94ac5d6398f47382505e9d3d9d866d79bf - + f3de7bbd655337fe6705aeaafcc970deff3dd5d5 - - Implement Fortran modules namespaces (brc#466118). -* Mon May 18 2009 rguenther@suse.de -- Add patch to fix handling of string DW_AT_const_values. [bnc#329420] -- Verified - * Fix printing of 'inf'. [bnc#466266] - * Stepping through templates. [bnc#414230] - * gcore script. [fate#303462] -* Thu May 14 2009 rguenther@suse.de -- Change reported version to mention SUSE instead of Fedora. -- Fix handling of bogus global namespace DIEs from GCC 4.1. [bnc#329420] -- Fix Power7 DFP detection. [bnc#492331] -* Thu May 07 2009 rguenther@suse.de -- Fix build for SLE10. [fate#305977] -- Adjust missing debug packages suggested install command. -* Wed Apr 29 2009 rguenther@suse.de -- Adjust package name and release to not contain macros. -* Mon Apr 27 2009 rguenther@suse.de -- Disable rpm support for locating debug info packages. -* Mon Apr 27 2009 rguenther@suse.de -- Switch to Fedora 11 source RPM. - * includes partially merge from Archer. [bnc#329420, bnc#497141, - bnc#492782] -* Tue Mar 10 2009 rguenther@suse.de -- Add VLA support patch from Fedora to fix possible - dwarf_expr_frame_base NULL checking regression. -- Fix readline incompatibility. -* Mon Mar 02 2009 rguenther@suse.de -- Integrate support for transparently debugging inline functions. -* Mon Feb 16 2009 schwab@suse.de -- Update to head to trunk. -* Tue Feb 03 2009 schwab@suse.de -- Update to head to trunk. -* Thu Jan 22 2009 schwab@suse.de -- Update Cell combined debugger patch. -* Fri Jan 16 2009 schwab@suse.de -- Update to head of trunk. -* Fri Jan 16 2009 bwalle@suse.de -- Recommend Python for GDB to prevent strange error messages to - be presented to the user in the default case. -* Wed Dec 10 2008 olh@suse.de -- use Obsoletes: -XXbit only for ppc64 to help solver during distupgrade - (bnc#437293) -* Thu Nov 20 2008 schwab@suse.de -- Update to head of trunk. -- Don't lose running state of the inferior. -- Fix dangling pointers after following fork. -* Sun Nov 09 2008 schwab@suse.de -- Update .debug_line parser patch. -* Mon Nov 03 2008 schwab@suse.de -- Update to head of trunk. -- Fix auxv decoding. -* Mon Nov 03 2008 schwab@suse.de -- Revert broken change from jblunck. -* Thu Oct 30 2008 olh@suse.de -- obsolete old -XXbit packages (bnc#437293) -* Tue Oct 28 2008 jblunck@suse.de -- Fix segfault when reading line number program (bnc #439457). -* Mon Oct 27 2008 schwab@suse.de -- Complain about invalid line number program. -* Tue Oct 07 2008 schwab@suse.de -- Fix crash. -* Wed Sep 24 2008 schwab@suse.de -- Update to head of trunk. -- Add POWER7 support. -- Add gcore. -- Add spu-elf to list of targets. -* Fri Sep 12 2008 schwab@suse.de -- Update to head of trunk. -- Add Cell combined debugger patch. -* Thu Sep 04 2008 schwab@suse.de -- Update to head of trunk. -* Fri Aug 15 2008 schwab@suse.de -- Update to head of trunk. -* Fri Aug 08 2008 schwab@suse.de -- Update to head of trunk. -- Enable multi-target support. -* Fri Jul 18 2008 schwab@suse.de -- Update to head of trunk. -* Mon Jul 07 2008 schwab@suse.de -- Update to head of trunk. -* Wed Jun 18 2008 schwab@suse.de -- Update to head of trunk. -* Fri May 23 2008 matz@suse.de -- Try harder to provide backtraces without debuginfo on i386. [bnc #390722] -* Wed May 21 2008 schwab@suse.de -- Fix assertion failure. -* Fri May 09 2008 schwab@suse.de -- Split off gdbserver. -- Fix watchpoints. -* Thu Apr 10 2008 ro@suse.de -- added baselibs.conf file to build xxbit packages - for multilib support -* Fri Mar 28 2008 schwab@suse.de -- Update to gdb 6.8. - * New native configurations - NetBSD/hppa hppa*-*netbsd* - Xtensa GNU/Linux xtensa*-*-linux* - * New targets - NetBSD/hppa hppa*-*-netbsd* - Xtensa GNU/Lunux xtensa*-*-linux* - * Change in command line behavior -- corefiles vs. process ids. - When the '-p NUMBER' or '--pid NUMBER' options are used, and - attaching to process NUMBER fails, GDB no longer attempts to open a - core file named NUMBER. Attaching to a program using the -c option - is no longer supported. Instead, use the '-p' or '--pid' options. - * GDB can now be built as a native debugger for debugging Windows x86 - (mingw32) Portable Executable (PE) programs. - * Pending breakpoints no longer change their number when their address - is resolved. - * GDB now supports breakpoints with multiple locations, - including breakpoints on C++ constructors, inside C++ templates, - and in inlined functions. - * GDB's ability to debug optimized code has been improved. GDB more - accurately identifies function bodies and lexical blocks that occupy - more than one contiguous range of addresses. - * Target descriptions can now describe registers for PowerPC. - * The GDB remote stub, gdbserver, now supports the AltiVec and SPE - registers on PowerPC targets. - * The GDB remote stub, gdbserver, now supports thread debugging on GNU/Linux - targets even when the libthread_db library is not available. - * The GDB remote stub, gdbserver, now supports the new file transfer - commands (remote put, remote get, and remote delete). - * The GDB remote stub, gdbserver, now supports run and attach in - extended-remote mode. - * hppa*64*-*-hpux11* target broken - The debugger is unable to start a program and fails with the following - error: "Error trying to get information about dynamic linker". - The gdb-6.7 release is also affected. - * GDB now supports the --enable-targets= configure option to allow - building a single GDB executable that supports multiple remote - target architectures. - * GDB now supports debugging C and C++ programs which use the - Decimal Floating Point extension. In addition, the PowerPC target - now has a set of pseudo-registers to inspect decimal float values - stored in two consecutive float registers. - * The -break-insert MI command can optionally create pending - breakpoints now. - * Improved support for debugging Ada - Many improvements to the Ada language support have been made. These - include: - - Better support for Ada2005 interface types - - Improved handling of arrays and slices in general - - Better support for Taft-amendment types - - The '{type} ADDRESS' expression is now allowed on the left hand-side - of an assignment - - Improved command completion in Ada - - Several bug fixes - * New commands - set print frame-arguments (all|scalars|none) - show print frame-arguments - The value of this variable can be changed to control which argument - values should be printed by the debugger when displaying a frame. - remote put - remote get - remote delete - Transfer files to and from a remote target, and delete remote files. - * New MI commands - -target-file-put - -target-file-get - -target-file-delete - Transfer files to and from a remote target, and delete remote files. - * New remote packets - vFile:open: - vFile:close: - vFile:pread: - vFile:pwrite: - vFile:unlink: - Open, close, read, write, and delete files on the remote system. - * GDB on GNU/Linux and HP/UX can now debug through "exec" of a new - process. - vAttach - Attach to an existing process on the remote system, in extended-remote - mode. - vRun - Run a new process on the remote system, in extended-remote mode. -* Wed Mar 05 2008 schwab@suse.de -- Update to head of gdb_6_8-branch. -* Thu Feb 14 2008 schwab@suse.de -- Update to head of trunk. -* Thu Jan 31 2008 schwab@suse.de -- Update to head of trunk. -* Thu Jan 10 2008 schwab@suse.de -- Update to head of trunk. -* Mon Nov 12 2007 schwab@suse.de -- Update to gdb 6.7.1. - * hppa*64*-*-hpux11* target broken - The debugger is unable to start a program and fails with the following - error: "Error trying to get information about dynamic linker". - The gdb-6.7 release is also affected. -* Fri Oct 19 2007 olh@suse.de -- allow build with old distributions, libexpat-devel is new in 10.3 -* Thu Oct 11 2007 schwab@suse.de -- Update to gdb 6.7. - * Resolved 101 resource leaks, null pointer dereferences, etc. in gdb, - bfd, libiberty and opcodes, as revealed by static analysis donated by - Coverity, Inc. (http://scan.coverity.com). - * When looking up multiply-defined global symbols, GDB will now prefer the - symbol definition in the current shared library if it was built using the - -Bsymbolic linker option. - * When the Text User Interface (TUI) is not configured, GDB will now - recognize the -tui command-line option and print a message that the TUI - is not supported. - * The GDB remote stub, gdbserver, now has lower overhead for high - frequency signals (e.g. SIGALRM) via the QPassSignals packet. - * GDB for MIPS targets now autodetects whether a remote target provides - 32-bit or 64-bit register values. - * Support for C++ member pointers has been improved. - * GDB now understands XML target descriptions, which specify the - target's overall architecture. GDB can read a description from - a local file or over the remote serial protocol. - * Vectors of single-byte data use a new integer type which is not - automatically displayed as character or string data. - * The /s format now works with the print command. It displays - arrays of single-byte integers and pointers to single-byte integers - as strings. - * Target descriptions can now describe target-specific registers, - for architectures which have implemented the support (currently - only ARM, M68K, and MIPS). - * GDB and the GDB remote stub, gdbserver, now support the XScale - iWMMXt coprocessor. - * The GDB remote stub, gdbserver, has been updated to support - ARM Windows CE (mingw32ce) debugging, and GDB Windows CE support - has been rewritten to use the standard GDB remote protocol. - * GDB can now step into C++ functions which are called through thunks. - * GDB for the Cell/B.E. SPU now supports overlay debugging. - * The GDB remote protocol "qOffsets" packet can now honor ELF segment - layout. It also supports a TextSeg= and DataSeg= response when only - segment base addresses (rather than offsets) are available. - * The /i format now outputs any trailing branch delay slot instructions - immediately following the last instruction within the count specified. - * The GDB remote protocol "T" stop reply packet now supports a - "library" response. Combined with the new "qXfer:libraries:read" - packet, this response allows GDB to debug shared libraries on targets - where the operating system manages the list of loaded libraries (e.g. - Windows and SymbianOS). - * The GDB remote stub, gdbserver, now supports dynamic link libraries - (DLLs) on Windows and Windows CE targets. - * GDB now supports a faster verification that a .debug file matches its binary - according to its build-id signature, if the signature is present. - * New commands - set remoteflow - show remoteflow - Enable or disable hardware flow control (RTS/CTS) on the serial port - when debugging using remote targets. - set mem inaccessible-by-default - show mem inaccessible-by-default - If the target supplies a memory map, for instance via the remote - protocol's "qXfer:memory-map:read" packet, setting this variable - prevents GDB from accessing memory outside the memory map. This - is useful for targets with memory mapped registers or which react - badly to accesses of unmapped address space. - set breakpoint auto-hw - show breakpoint auto-hw - If the target supplies a memory map, for instance via the remote - protocol's "qXfer:memory-map:read" packet, setting this variable - lets GDB use hardware breakpoints automatically for memory regions - where it can not use software breakpoints. This covers both the - "break" command and internal breakpoints used for other commands - including "next" and "finish". - catch exception - catch exception unhandled - Stop the program execution when Ada exceptions are raised. - catch assert - Stop the program execution when an Ada assertion failed. - set sysroot - show sysroot - Set an alternate system root for target files. This is a more - general version of "set solib-absolute-prefix", which is now - an alias to "set sysroot". - info spu - Provide extended SPU facility status information. This set of - commands is available only when debugging the Cell/B.E. SPU - architecture. - * New native configurations - OpenBSD/sh sh*-*openbsd* - set tdesc filename - unset tdesc filename - show tdesc filename - Use the specified local file as an XML target description, and do - not query the target for its built-in description. - * New targets - OpenBSD/sh sh*-*-openbsd* - MIPS64 GNU/Linux (gdbserver) mips64-linux-gnu - Toshiba Media Processor mep-elf - * New remote packets - QPassSignals: - Ignore the specified signals; pass them directly to the debugged program - without stopping other threads or reporting them to GDB. - qXfer:features:read: - Read an XML target description from the target, which describes its - features. - qXfer:spu:read: - qXfer:spu:write: - Read or write contents of an spufs file on the target system. These - packets are available only on the Cell/B.E. SPU architecture. - qXfer:libraries:read: - Report the loaded shared libraries. Combined with new "T" packet - response, this packet allows GDB to debug shared libraries on - targets where the operating system manages the list of loaded - libraries (e.g. Windows and SymbianOS). - * Removed targets - Support for these obsolete configurations has been removed. - alpha*-*-osf1* - alpha*-*-osf2* - d10v-*-* - hppa*-*-hiux* - i[34567]86-ncr-* - i[34567]86-*-dgux* - i[34567]86-*-lynxos* - i[34567]86-*-netware* - i[34567]86-*-sco3.2v5* - i[34567]86-*-sco3.2v4* - i[34567]86-*-sco* - i[34567]86-*-sysv4.2* - i[34567]86-*-sysv4* - i[34567]86-*-sysv5* - i[34567]86-*-unixware2* - i[34567]86-*-unixware* - i[34567]86-*-sysv* - i[34567]86-*-isc* - m68*-cisco*-* - m68*-tandem-* - mips*-*-pe - rs6000-*-lynxos* - sh*-*-pe - * Other removed features - target abug - target cpu32bug - target est - target rom68k - Various m68k-only ROM monitors. - target hms - target e7000 - target sh3 - target sh3e - Various Renesas ROM monitors and debugging interfaces for SH and - H8/300. - target ocd - Support for a Macraigor serial interface to on-chip debugging. - GDB does not directly support the newer parallel or USB - interfaces. - DWARF 1 support - A debug information format. The predecessor to DWARF 2 and - DWARF 3, which are still supported. - Support for the HP aCC compiler on HP-UX/PA-RISC - SOM-encapsulated symbolic debugging information, automatic - invocation of pxdb, and the aCC custom C++ ABI. This does not - affect HP-UX for Itanium or GCC for HP-UX/PA-RISC. Code compiled - with aCC can still be debugged on an assembly level. - MIPS ".pdr" sections - A MIPS-specific format used to describe stack frame layout - in debugging information. - Scheme support - GDB could work with an older version of Guile to debug - the interpreter and Scheme programs running in it. - set mips stack-arg-size - set mips saved-gpreg-size - Use "set mips abi" to control parameter passing for MIPS. -* Mon Oct 01 2007 schwab@suse.de -- Update to head of gdb_6_7-branch. -* Mon Sep 24 2007 schwab@suse.de -- Fix internal error [#309928]. -* Thu Jul 26 2007 schwab@suse.de -- Update to head of trunk. -* Fri Jul 13 2007 schwab@suse.de -- Update to head of trunk. -* Sun Jun 24 2007 schwab@suse.de -- Fix annotations for commands prompt. -* Thu Jun 21 2007 schwab@suse.de -- Update to head of trunk. -* Fri Jun 08 2007 schwab@suse.de -- Update to head of trunk. -* Fri May 11 2007 schwab@suse.de -- Update to head of trunk. -* Fri Apr 13 2007 schwab@suse.de -- Avoid crash on object with no text section [#176306]. -* Wed Apr 11 2007 schwab@suse.de -- Handle non-threaded processes in gstack [#262694]. -* Sun Apr 01 2007 schwab@suse.de -- Properly decode CR register number. -* Thu Mar 29 2007 schwab@suse.de -- Update solib-extract-address patch. -* Tue Mar 20 2007 schwab@suse.de -- Update single stepping patch again [#154486]. -* Fri Mar 16 2007 schwab@suse.de -- Update single stepping patch [#154486]. -* Thu Mar 15 2007 schwab@suse.de -- Fix altivec vector return location [#250004]. -* Mon Mar 12 2007 schwab@suse.de -- Update ppc DWARF patch to also handle broken debug info from old - compilers. -* Thu Mar 08 2007 schwab@suse.de -- Deal with stepping over sequence of atomic insns [#154486]. -* Wed Mar 07 2007 schwab@suse.de -- Improve last change. -* Tue Mar 06 2007 schwab@suse.de -- Better handling of ppc64 function descriptor symbols. -* Mon Mar 05 2007 schwab@suse.de -- Remove obsolete patch. -- Fix show endian. -* Thu Jan 11 2007 schwab@suse.de -- Fix unchecked use of PC_REGNUM. -* Wed Dec 20 2006 schwab@suse.de -- Update to gdb 6.6. - * New targets - Xtensa xtensa-elf - Cell Broadband Engine SPU spu-elf - * GDB can now be configured as a cross-debugger targeting native Windows - (mingw32) or Cygwin. It can communicate with a remote debugging stub - running on a Windows system over TCP/IP to debug Windows programs. - * The GDB remote stub, gdbserver, has been updated to support Windows and - Cygwin debugging. Both single-threaded and multi-threaded programs are - supported. - * The "set trust-readonly-sections" command works again. This command was - broken in GDB 6.3, 6.4, and 6.5. - * Support for GNU/Linux Thread Local Storage (TLS, per-thread variables) no - longer requires symbolic debug information (e.g. DWARF-2). - * New commands - set substitute-path - unset substitute-path - show substitute-path - Manage a list of substitution rules that GDB uses to rewrite the name - of the directories where the sources are located. This can be useful - for instance when the sources were moved to a different location - between compilation and debugging. - set trace-commands - show trace-commands - Print each CLI command as it is executed. Each command is prefixed with - a number of `+' symbols representing the nesting depth. - The source command now has a `-v' option to enable the same feature. - * REMOVED features - The ARM Demon monitor support (RDP protocol, "target rdp"). - Kernel Object Display, an embedded debugging feature which only worked with - an obsolete version of Cisco IOS. - The 'set download-write-size' and 'show download-write-size' commands. - * New remote packets - qSupported: - Tell a stub about GDB client features, and request remote target features. - The first feature implemented is PacketSize, which allows the target to - specify the size of packets it can handle - to minimize the number of - packets required and improve performance when connected to a remote - target. - qXfer:auxv:read: - Fetch an OS auxilliary vector from the remote stub. This packet is a - more efficient replacement for qPart:auxv:read. - * Removed remote packets - qPart:auxv:read: - This packet has been replaced by qXfer:auxv:read. Only GDB 6.4 and 6.5 - used it, and only gdbserver implemented it. -* Sat Dec 02 2006 schwab@suse.de -- Update to gdb 6.5.90. -* Sat Oct 28 2006 schwab@suse.de -- Rename detach-fork to detach fork. -* Tue Oct 24 2006 schwab@suse.de -- Better fix for function descriptor handling on ppc64. -* Fri Aug 25 2006 schwab@suse.de -- Minimal support for .gnu.hash. -* Thu Aug 24 2006 schwab@suse.de -- Fix off-by-one in add_symbol_file_command [#200831]. -* Fri Aug 11 2006 schwab@suse.de -- Correctly extend addresses read from link map. -* Sun Jul 16 2006 schwab@suse.de -- Fix function decriptor handing on ppc64. -* Wed Jun 21 2006 schwab@suse.de -- Update to final gdb 6.5. -* Sat Jun 03 2006 schwab@suse.de -- Update to gdb 6.5 RC 1. -* Wed May 31 2006 schwab@suse.de -- Set long double size to 16 [#180103]. -* Mon May 22 2006 schwab@suse.de -- Update to gdb 6.4.90 snapshot 20060522. -* Sun Apr 23 2006 schwab@suse.de -- Add patch to avoid losing compilation directory. -- Fix a parallel build problem. -* Tue Apr 04 2006 schwab@suse.de -- Relocate PIEs. -* Mon Mar 27 2006 schwab@suse.de -- Handle .eh_frame register encoding that is different from .dwarf_frame. -- Remove obsolete patch. -* Wed Jan 25 2006 mls@suse.de -- converted neededforbuild to BuildRequires -* Mon Jan 23 2006 schwab@suse.de -- Add fix for PIC prologue analyzer on powerpc. -* Wed Dec 14 2005 schwab@suse.de -- Add fix for observer notify queue after attach. -* Fri Dec 02 2005 schwab@suse.de -- Update to gdb 6.4. -* Tue Nov 22 2005 schwab@suse.de -- Update to gdb 6.3.90. -* Fri Nov 04 2005 schwab@suse.de -- Update to gdb-6.3.50 snapshot 20051103. -* Mon Oct 03 2005 schwab@suse.de -- Update to gdb 6.3.50 snapshot 20051003. -* Mon Sep 19 2005 schwab@suse.de -- Fix warnings. -* Sun Aug 21 2005 schwab@suse.de -- Add DWARF CFI unwinder on ppc. -* Mon Jun 20 2005 schwab@suse.de -- Require libunwind-devel on ia64. -* Thu Jun 09 2005 schwab@suse.de -- Add patch for ia64 vDSO support and unwinding through signals and - syscalls [#60766]. -* Mon Apr 11 2005 schwab@suse.de -- Fix backtrace through vsyscall [#63483]. -* Mon Apr 11 2005 schwab@suse.de -- Add patch to fix bugs in rs6000/powerpc register set functions. -- Fix a testsuite bug. -* Sun Mar 06 2005 schwab@suse.de -- Add patch to suppress fork attach/detach messages. -* Wed Mar 02 2005 schwab@suse.de -- Add patch to fix following vfork from a secondary thread. -* Mon Feb 28 2005 schwab@suse.de -- Don't ignore DW_TAG_member [#66406]. -* Tue Feb 01 2005 schwab@suse.de -- Find separate debug symbol files in /usr/lib/debug by default. -* Thu Jan 27 2005 schwab@suse.de -- Add patch to handle back-to-back and nested signals. -* Thu Jan 27 2005 schwab@suse.de -- Add patch to implement reggroups for ppc. -* Wed Jan 26 2005 schwab@suse.de -- Add patch to implement PPC GNU/Linux sigtramp frame code. -* Wed Jan 12 2005 schwab@suse.de -- Don't error out when encountering an unavailable value. -* Fri Dec 03 2004 schwab@suse.de -- Downgrade errors to warnings during backtrace [#48484]. -- Undocument --readnever since it may not be supported by future releases. -- Fix patches from last change. -* Fri Dec 03 2004 kukuk@suse.de -- Add --readnever option as workaround for [#48485] -* Sun Nov 14 2004 schwab@suse.de -- Add libunwind-devel to neededforbuild. -* Sat Nov 13 2004 schwab@suse.de -- Fix missing dependencies. -* Wed Nov 10 2004 schwab@suse.de -- Version 6.2.91 renamed to 6.3. -* Tue Nov 09 2004 schwab@suse.de -- Update to gdb 6.2.91 (6.3 release candidate). -* Mon Nov 08 2004 schwab@suse.de -- Revert last change. -- Fix typo. -* Mon Nov 08 2004 uli@suse.de -- fixed to build on s390* -* Mon Oct 25 2004 schwab@suse.de -- Fix building gdbserver on x86-64. -* Mon Oct 25 2004 schwab@suse.de -- Update to gdb 6.2.90. -- Use libunwind on ia64. -* Thu Sep 09 2004 schwab@suse.de -- Update to gdb 6.2.1. -* Wed Aug 25 2004 schwab@suse.de -- Fix deadlock in child_wait [#42796]. -* Tue Aug 24 2004 schwab@suse.de -- Import latest changes from 6.2 branch. -* Fri Jul 30 2004 schwab@suse.de -- Update to gdb 6.2. -* Thu Jul 29 2004 schwab@suse.de -- Update to gdb 6.1.92. -* Mon Jul 26 2004 schwab@suse.de -- Fix handling of relative filenames in DWARF2 .debug_line. -* Mon Jul 19 2004 schwab@suse.de -- Update to gdb 6.1.91. -* Thu Jun 24 2004 schwab@suse.de -- Better handling of dying threads. -* Fri Jun 18 2004 schwab@suse.de -- Update to gdb 6.1.1. -* Tue May 25 2004 schwab@suse.de -- Fix handling of short lived threads [#40841]. -* Sat May 01 2004 schwab@suse.de -- Restore removed hunk. -* Fri Apr 30 2004 meissner@suse.de -- applied 3 patches to fix problems on ppc64. #39394 -* Sat Apr 17 2004 schwab@suse.de -- Pacify autobuild. -* Mon Apr 05 2004 schwab@suse.de -- Version 6.0.92 has been renamed to 6.1. -* Sat Apr 03 2004 schwab@suse.de -- Update to gdb 6.0.92 (6.1 release candidate). -* Tue Mar 30 2004 schwab@suse.de -- Fix invalid use of va_list. -* Mon Mar 29 2004 schwab@suse.de -- Update to gdb 6.0.91. -* Mon Mar 29 2004 schwab@suse.de -- Update to current CVS. -* Fri Mar 19 2004 schwab@suse.de -- Fix last change: don't disable testsuite. -* Wed Mar 17 2004 mludvig@suse.cz -- Added opcodes for VIA PadLock instructions. -* Tue Mar 02 2004 schwab@suse.de -- Update to gdb 6.0.90. -- Run testsuite. -* Thu Jan 08 2004 schwab@suse.de -- Fix gate area range. -* Wed Dec 10 2003 schwab@suse.de -- Support DW_TAG_subrange_type. -- Backport recent ia64 improvements from mainline. -* Tue Oct 21 2003 mludvig@ -- Add support for debugging both i386 and amd64 apps by a single - amd64 GDB binary. -* Mon Oct 20 2003 mludvig@suse.cz -- Correctly interpret symbol tables for debugging kernel modules - (gdb6-symtab-minimal.diff) -- Fixed support for GCC variable tracking (gdb6-vartrack.diff) -- Fixed support for Fortran arrays (gdb6-fortranarray.diff) -* Tue Oct 07 2003 schwab@suse.de -- Hack to build on sparc. -* Mon Oct 06 2003 schwab@suse.de -- Update to gdb 6.0. -* Fri Oct 03 2003 kukuk@suse.de -- Remove unused tetex from neededforbuild -* Mon Sep 29 2003 schwab@suse.de -- Update to gdb 5.3.93 pre-release. -* Wed Sep 17 2003 schwab@suse.de -- Remove debugging hooks. -* Wed Sep 17 2003 schwab@suse.de -- Ignore more insns during i386 prologue decoding [#30288]. -- Fix hash table mixup in bfd_simple interface. -* Tue Sep 16 2003 schwab@suse.de -- Update to gdb 5.3.92 pre-release. - * Fixes bug 31033. -* Wed Sep 03 2003 schwab@suse.de -- Update to gdb 5.3.91 pre-release. -* Tue Aug 19 2003 schwab@suse.de -- Update to gdb 5.3.90 2003-08-19 cvs snapshot. -* Mon Jun 23 2003 kukuk@suse.de -- Fix compiling on SPARC -* Tue Jun 10 2003 schwab@suse.de -- Don't package mmalloc.info, since libmmalloc isn't included either. -* Thu May 15 2003 schwab@suse.de -- Remove unwanted files. -* Thu Apr 24 2003 ro@suse.de -- fix install_info --delete call and move from preun to postun -* Fri Apr 11 2003 mludvig@suse.cz -- Fix read_2u() function in dwarf2cfi.c -* Thu Apr 10 2003 mludvig@suse.cz -- Add 'info cfi
' command. -- Fix off-by-4 bug in the CFI parser. -* Mon Apr 07 2003 schwab@suse.de -- Only delete info entries when removing last version. -* Thu Mar 27 2003 schwab@suse.de -- Fix specfile. -* Thu Mar 06 2003 aj@suse.de -- Fix neededforbuild. -* Wed Feb 26 2003 mludvig@suse.cz -- Added loclist support -- Fixed eh_frame parsing problems -- Updated for proposed x86-64 ABI change -* Thu Feb 06 2003 schwab@suse.de -- Use %%install_info. -* Tue Feb 04 2003 schwab@suse.de -- Enable TUI. -* Sun Jan 26 2003 olh@suse.de -- add inital native ppc64 support -* Thu Jan 09 2003 mludvig@suse.cz -- Fixed compilation problem with last gdb-asmbtrace.diff. - No new feature. -* Tue Jan 07 2003 mludvig@suse.cz -- Several Dwarf2 and x86-64 specific changes - * Added ability to do backtrace from some functions - without debug info (patch gdb-asmbtrace.diff) - * Fixed crash on re-run of a debugged program. - * Added some more verbosity to dwarf2cfi engine. -* Thu Dec 12 2002 schwab@suse.de -- Update to gdb 5.3. - * GNU/Linux shared library multi-threaded performance improved. - * ``gdbserver'' now supports multi-threaded applications on some targets - * GDB now supports C/C++ preprocessor macros. -* Fri Oct 11 2002 aj@suse.de -- Handle gcc code generated by gcc -f-elimante-dwarf2-dups -g. -* Thu Sep 26 2002 schwab@suse.de -- Avoid installing libbfd, libopcodes, libiberty and libmmalloc [#20199]. -* Wed Sep 18 2002 sf@suse.de -- added patch from mludvig to remove framepointer on x86_64 -* Wed Sep 04 2002 kukuk@suse.de -- Add Patch for reading SPARC core files -* Tue Sep 03 2002 schwab@suse.de -- Remove tetex from neededforbuild. -* Wed Jul 24 2002 schwab@suse.de -- Update to gdb 5.2.1. -* Thu Jul 18 2002 mludvig@suse.de -- Fix PLT recognisation. -* Mon Jul 08 2002 schwab@suse.de -- Add fix for memory leak. -* Tue Jul 02 2002 mludvig@suse.cz -- removed my previous patches -- added a huge one suse-521-x8664.diff -* Thu Jun 06 2002 sf@suse.de -- added fpregset.diff (from mludvig@suse.de) -- added dwarf2cfi.diff (from mludvig@suse.de) -* Wed May 15 2002 sf@suse.de -- added some dwarf2-patches for x86_64 - (from mludvig@suse.de) -* Thu May 09 2002 schwab@suse.de -- Fix breakpoints on MLX bundle. -* Mon May 06 2002 schwab@suse.de -- Sparc doesn't have gdbserver either. -* Sun May 05 2002 schwab@suse.de -- Update to gdb 5.2. -- Gdbserver now available for all but alpha. -* Fri Jan 25 2002 schwab@suse.de -- Update to gdb 5.1.1. -* Thu Nov 22 2001 schwab@suse.de -- Update to gdb 5.1. -- Build and install gdbserver on i386 and ia64. -* Sat Aug 18 2001 schwab@suse.de -- Update to gdb snapthot 20010316. -* Fri May 18 2001 schwab@suse.de -- Include ia64 warning patches (from nadvornik@suse.cz). -* Thu Apr 12 2001 schwab@suse.de -- Remove declaration of tilde_expand, now in readline header. -* Sun Apr 01 2001 schwab@suse.de -- Fix hardware watchpoints on ia64. -* Fri Mar 30 2001 schwab@suse.de -- Fix crash on info architecture (#6865). -* Wed Mar 28 2001 schwab@suse.de -- Use installed readline library. -* Tue Mar 06 2001 schwab@suse.de -- Remove some ia64 hacks. -* Tue Dec 12 2000 schwab@suse.de -- Improve handling of breakpoints in shared libraries. -* Fri Nov 17 2000 kukuk@suse.de -- Update to working gdb snapshot -* Wed Sep 27 2000 fober@suse.de -- s390: added s390-sigregs-SuSE.patch -* Thu Sep 14 2000 fober@suse.de -- s390: incorporate new ibm patches for gdb 5.0 -* Wed Sep 06 2000 fober@suse.de -- s390: incorporate ibm patches for gdb 5.0 -* Fri Jun 30 2000 kukuk@suse.de -- Add gdb-5.0 -* Tue Apr 04 2000 bk@suse.de -- s390 team added s390 support -* Tue Mar 21 2000 schwab@suse.de -- Fix core dump reading (#2586). -* Fri Feb 04 2000 kukuk@suse.de -- Add patches for PPC -- Move /usr/info -> /usr/share/info -* Mon Dec 06 1999 kukuk@suse.de -- Remove gdb 4.17 -- Add gdb 4.18 fixes for SPARC -* Mon Sep 13 1999 bs@suse.de -- ran old prepare_spec on spec file to switch to new prepare_spec. -* Fri Sep 03 1999 kukuk@suse.de -- Use RPM values for CFLAGS and configure -* Tue Aug 24 1999 uli@suse.de -- added -fsigned-char to CFLAGS (PPC) -* Mon Aug 23 1999 kukuk@suse.de -- Add gdb 4.18 thread patch from RH -* Mon Jul 19 1999 florian@suse.de -- add gdb-4.17.0.12 as /usr/bin/gdb-4.17 -* Wed Jul 07 1999 kukuk@suse.de -- update to 4.18 using diff from jurix -* Tue Feb 23 1999 ro@suse.de -- update to 4.17.0.11 using diff from jurix -* Thu Jan 21 1999 ro@suse.de -- update to 4.17.0.8 -* Thu Oct 01 1998 ro@suse.de -- update to 4.17.0.4 using jurix-diff -* Tue Sep 15 1998 ro@suse.de -- hacked for GLIBC: include sys/ucontext and sys/ptrace where needed -- catch strup redeclarations -- cleaned up patch-sequence -* Wed Oct 29 1997 florian@suse.de -- fix in libc to correctly support core-files -- add bug-fix to read symbols from dynamic symbol tables -- apply all patches from debian gdb-4.16-11 -* Thu Jan 02 1997 florian@suse.de - Neue Version 4.16. - gdb kompiliert nur mit libc 5.4.7 richtig. Mit 5.2.18 kann gdb - keine core-files lesen. - Ich waere dafuer, einfach das Binary von libc 5.4.7 zu benutzen. - Wird schon funktionieren...