| OLD | NEW |
| 1 # Copyright 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 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 # Test that breakpoints on C++ constructors work, despite the | 16 # Test that breakpoints on C++ constructors work, despite the |
| 17 # fact that gcc generates several versions of constructor function. | 17 # fact that gcc generates several versions of constructor function. |
| 18 | 18 |
| 19 if $tracelevel then { | |
| 20 strace $tracelevel | |
| 21 } | |
| 22 | |
| 23 if { [skip_cplus_tests] } { continue } | 19 if { [skip_cplus_tests] } { continue } |
| 24 | 20 |
| 25 | 21 |
| 26 set testfile "mb-ctor" | 22 standard_testfile .cc |
| 27 set srcfile ${testfile}.cc | |
| 28 set binfile ${objdir}/${subdir}/${testfile} | |
| 29 | 23 |
| 30 if [get_compiler_info ${binfile} "c++"] { | 24 if [get_compiler_info "c++"] { |
| 31 return -1 | 25 return -1 |
| 32 } | 26 } |
| 33 | 27 |
| 34 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug c++}] != "" } { | 28 if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { |
| 35 untested mb-ctor.exp | 29 return -1 |
| 36 return -1 | |
| 37 } | 30 } |
| 38 | 31 |
| 39 gdb_exit | |
| 40 gdb_start | |
| 41 gdb_reinitialize_dir $srcdir/$subdir | |
| 42 gdb_load ${binfile} | |
| 43 | |
| 44 if ![runto_main] then { | 32 if ![runto_main] then { |
| 45 perror "couldn't run to breakpoint" | 33 perror "couldn't run to breakpoint" |
| 46 continue | 34 continue |
| 47 } | 35 } |
| 48 | 36 |
| 49 # Set a breakpoint with multiple locations | 37 # Set a breakpoint with multiple locations |
| 50 # and a condition. | 38 # and a condition. |
| 51 | 39 |
| 52 gdb_test "break 'Derived::Derived(int)'" \ | 40 gdb_test "break 'Derived::Derived(int)'" \ |
| 53 "Breakpoint.*at.*: Derived::Derived.int.. \\(2 locations\\).*" \ | 41 "Breakpoint.*at.*: Derived::Derived.int.. \\(2 locations\\).*" \ |
| (...skipping 24 matching lines...) Expand all Loading... |
| 78 gdb_test "continue" \ | 66 gdb_test "continue" \ |
| 79 ".*Breakpoint.*~Derived.*" \ | 67 ".*Breakpoint.*~Derived.*" \ |
| 80 "run to breakpoint 3 v2" | 68 "run to breakpoint 3 v2" |
| 81 | 69 |
| 82 gdb_test "continue" \ | 70 gdb_test "continue" \ |
| 83 ".*exited normally.*" \ | 71 ".*exited normally.*" \ |
| 84 "run to exit" | 72 "run to exit" |
| 85 | 73 |
| 86 | 74 |
| 87 | 75 |
| OLD | NEW |