| OLD | NEW |
| 1 # Copyright 2002, 2004, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 2002, 2004, 2007-2012 Free Software Foundation, Inc. |
| 2 | 2 |
| 3 # This program is free software; you can redistribute it and/or modify | 3 # This program is free software; you can redistribute it and/or modify |
| 4 # it under the terms of the GNU General Public License as published by | 4 # it under the terms of the GNU General Public License as published by |
| 5 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
| 6 # (at your option) any later version. | 6 # (at your option) any later version. |
| 7 # | 7 # |
| 8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
| 12 # | 12 # |
| 13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
| 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | 15 |
| 16 if $tracelevel then { | |
| 17 strace $tracelevel | |
| 18 } | |
| 19 | |
| 20 | 16 |
| 21 if { [skip_cplus_tests] } { continue } | 17 if { [skip_cplus_tests] } { continue } |
| 22 | 18 |
| 23 set testfile hang | 19 standard_testfile hang1.cc hang2.cc hang3.cc |
| 24 set binfile ${objdir}/${subdir}/${testfile} | |
| 25 | 20 |
| 26 foreach file {hang1 hang2 hang3} { | 21 if {[prepare_for_testing $testfile.exp $testfile \ |
| 27 if {[gdb_compile "${srcdir}/${subdir}/${file}.cc" "${file}.o" object {c++ de
bug}] != ""} { | 22 » [list $srcfile $srcfile2 $srcfile3] {debug c++}]} { |
| 28 untested hang.exp | 23 return -1 |
| 29 return -1 | |
| 30 } | |
| 31 } | 24 } |
| 32 | 25 |
| 33 if {[gdb_compile "hang1.o hang2.o hang3.o" ${binfile} executable {c++ debug}] !=
"" } { | |
| 34 untested hang.exp | |
| 35 return -1 | |
| 36 } | |
| 37 | |
| 38 | |
| 39 gdb_exit | |
| 40 gdb_start | |
| 41 gdb_reinitialize_dir $srcdir/$subdir | |
| 42 gdb_load ${binfile} | |
| 43 | |
| 44 | |
| 45 # As of May 1, 2002, GDB hangs trying to read the debug info for the | 26 # As of May 1, 2002, GDB hangs trying to read the debug info for the |
| 46 # `hang2.o' compilation unit from the executable `hang', when compiled | 27 # `hang2.o' compilation unit from the executable `hang', when compiled |
| 47 # by g++ 2.96 with STABS debugging info. Here's what's going on, as | 28 # by g++ 2.96 with STABS debugging info. Here's what's going on, as |
| 48 # best as I can tell. | 29 # best as I can tell. |
| 49 # | 30 # |
| 50 # The definition of `struct A' in `hang.H' refers to `struct B' as an | 31 # The definition of `struct A' in `hang.H' refers to `struct B' as an |
| 51 # incomplete type. The stabs declare type number (1,3) to be a cross- | 32 # incomplete type. The stabs declare type number (1,3) to be a cross- |
| 52 # reference type, `xsB:'. | 33 # reference type, `xsB:'. |
| 53 # | 34 # |
| 54 # The definition of `struct C' contains a nested definition for | 35 # The definition of `struct C' contains a nested definition for |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 # a separate compilation unit, whose psymtab depends on hang1.o's | 96 # a separate compilation unit, whose psymtab depends on hang1.o's |
| 116 # psymtab. Otherwise, GDB won't call cleanup_undefined_types (as it | 97 # psymtab. Otherwise, GDB won't call cleanup_undefined_types (as it |
| 117 # finishes hang1.o's symbols) before it calls make_cv_type (while | 98 # finishes hang1.o's symbols) before it calls make_cv_type (while |
| 118 # reading hang3.o's symbols). | 99 # reading hang3.o's symbols). |
| 119 # | 100 # |
| 120 # The bug only happens when you compile with -gstabs+; Otherwise, GCC | 101 # The bug only happens when you compile with -gstabs+; Otherwise, GCC |
| 121 # won't include the `const' qualifier on `const_B_ptr' in `hang3.o''s | 102 # won't include the `const' qualifier on `const_B_ptr' in `hang3.o''s |
| 122 # STABS, so GDB won't try to create a const variant of the smashed | 103 # STABS, so GDB won't try to create a const variant of the smashed |
| 123 # struct type, and get caught by the corrupted cv_type chain. | 104 # struct type, and get caught by the corrupted cv_type chain. |
| 124 gdb_test "print var_in_hang3" " = 42" "doesn't corrupt cv_type chain" | 105 gdb_test "print var_in_hang3" " = 42" "doesn't corrupt cv_type chain" |
| OLD | NEW |