| OLD | NEW |
| 1 # Copyright 2007, 2009-2012 Free Software Foundation, Inc. | 1 # Copyright 2007, 2009-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 # When gdb resolves type information for class "derived" from objfile | 16 # When gdb resolves type information for class "derived" from objfile |
| 17 # gdb2384, it use to fill in the TYPE_VPTR_BASETYPE field with class "base" | 17 # gdb2384, it use to fill in the TYPE_VPTR_BASETYPE field with class "base" |
| 18 # from objfile gdb2384-base.so. When the program is rerun the type | 18 # from objfile gdb2384-base.so. When the program is rerun the type |
| 19 # information for base-in-so-base.so is discarded leaving | 19 # information for base-in-so-base.so is discarded leaving |
| 20 # TYPE_VPTR_BASETYPE dangling. | 20 # TYPE_VPTR_BASETYPE dangling. |
| 21 # | 21 # |
| 22 # PR c++/9489. | 22 # PR c++/9489. |
| 23 | 23 |
| 24 if $tracelevel then { | |
| 25 strace $tracelevel | |
| 26 } | |
| 27 | |
| 28 if { [skip_cplus_tests] } { continue } | 24 if { [skip_cplus_tests] } { continue } |
| 29 if { [skip_shlib_tests] } { continue } | 25 if { [skip_shlib_tests] } { continue } |
| 30 | 26 |
| 31 set testfile "gdb2384" | 27 standard_testfile .cc gdb2384-base.cc |
| 32 set srcfile ${testfile}.cc | |
| 33 set binfile $objdir/$subdir/$testfile | |
| 34 | 28 |
| 35 set libfile "gdb2384-base" | 29 set sofile [standard_output_file gdb2384-base.so] |
| 36 set libsrcfile ${libfile}.cc | |
| 37 set sofile $objdir/$subdir/${libfile}.so | |
| 38 | 30 |
| 39 # Create and source the file that provides information about the compiler | 31 # Create and source the file that provides information about the compiler |
| 40 # used to compile the test case. | 32 # used to compile the test case. |
| 41 if [get_compiler_info ${binfile} "c++"] { | 33 if [get_compiler_info "c++"] { |
| 42 return -1 | 34 return -1 |
| 43 } | 35 } |
| 44 | 36 |
| 45 if { [gdb_compile_shlib $srcdir/$subdir/$libsrcfile $sofile {debug c++}] != "" | 37 if { [gdb_compile_shlib $srcdir/$subdir/$srcfile2 $sofile {debug c++}] != "" |
| 46 || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug "c
++" shlib=${sofile}]] != ""} { | 38 || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug "c
++" shlib=${sofile}]] != ""} { |
| 47 untested gdb2384.exp | 39 untested gdb2384.exp |
| 48 return -1 | 40 return -1 |
| 49 } | 41 } |
| 50 | 42 |
| 51 gdb_exit | 43 clean_restart ${binfile} |
| 52 gdb_start | |
| 53 gdb_reinitialize_dir $srcdir/$subdir | |
| 54 gdb_load ${binfile} | |
| 55 gdb_load_shlibs ${sofile} | 44 gdb_load_shlibs ${sofile} |
| 56 | 45 |
| 57 | 46 |
| 58 if ![runto_main] then { | 47 if ![runto_main] then { |
| 59 perror "couldn't run to breakpoint" | 48 perror "couldn't run to breakpoint" |
| 60 return -1 | 49 return -1 |
| 61 } | 50 } |
| 62 | 51 |
| 63 gdb_breakpoint [gdb_get_line_number "set breakpoint here"] | 52 gdb_breakpoint [gdb_get_line_number "set breakpoint here"] |
| 64 gdb_continue_to_breakpoint "set breakpoint here" | 53 gdb_continue_to_breakpoint "set breakpoint here" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 85 ".*24.*" \ | 74 ".*24.*" \ |
| 86 "print d2.meth()" | 75 "print d2.meth()" |
| 87 | 76 |
| 88 runto_main | 77 runto_main |
| 89 gdb_breakpoint [gdb_get_line_number "set breakpoint here (second)"] | 78 gdb_breakpoint [gdb_get_line_number "set breakpoint here (second)"] |
| 90 gdb_continue_to_breakpoint "set breakpoint here (second)" | 79 gdb_continue_to_breakpoint "set breakpoint here (second)" |
| 91 gdb_test "print d2.meth ()" \ | 80 gdb_test "print d2.meth ()" \ |
| 92 ".*24.*" \ | 81 ".*24.*" \ |
| 93 "gdb2384 (second)" | 82 "gdb2384 (second)" |
| 94 | 83 |
| OLD | NEW |