| OLD | NEW |
| 1 # Copyright 1998-2004, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 1998-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 # tests for local variables | 16 # tests for local variables |
| 17 # Written by Satish Pai <pai@apollo.hp.com> 1997-07-08 | 17 # Written by Satish Pai <pai@apollo.hp.com> 1997-07-08 |
| 18 # Cleaned by Michael Chastain <mec@shout.net> 2002-04-08 | 18 # Cleaned by Michael Chastain <mec@shout.net> 2002-04-08 |
| 19 | 19 |
| 20 | 20 |
| 21 # This file is part of the gdb testsuite | 21 # This file is part of the gdb testsuite |
| 22 | 22 |
| 23 set ws "\[\r\n\t \]+" | 23 set ws "\[\r\n\t \]+" |
| 24 set nl "\[\r\n\]+" | 24 set nl "\[\r\n\]+" |
| 25 | 25 |
| 26 if $tracelevel then { | |
| 27 strace $tracelevel | |
| 28 } | |
| 29 | |
| 30 # | 26 # |
| 31 # test running programs | 27 # test running programs |
| 32 # | 28 # |
| 33 | 29 |
| 34 if { [skip_cplus_tests] } { continue } | 30 if { [skip_cplus_tests] } { continue } |
| 35 | 31 |
| 36 set testfile "local" | 32 standard_testfile .cc |
| 37 set srcfile ${testfile}.cc | |
| 38 set binfile ${objdir}/${subdir}/${testfile} | |
| 39 | 33 |
| 40 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug c++}] != "" } { | 34 if [get_compiler_info "c++"] { |
| 41 untested local.exp | |
| 42 return -1 | |
| 43 } | |
| 44 | |
| 45 if [get_compiler_info $binfile "c++"] { | |
| 46 return -1 | 35 return -1 |
| 47 } | 36 } |
| 48 | 37 |
| 49 gdb_exit | 38 if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { |
| 50 gdb_start | 39 return -1 |
| 51 gdb_reinitialize_dir $srcdir/$subdir | 40 } |
| 52 gdb_load ${binfile} | |
| 53 | |
| 54 | 41 |
| 55 # | 42 # |
| 56 # set it up at a breakpoint so we can play with the variable values | 43 # set it up at a breakpoint so we can play with the variable values |
| 57 # | 44 # |
| 58 if ![runto_main] then { | 45 if ![runto_main] then { |
| 59 perror "couldn't run to breakpoint" | 46 perror "couldn't run to breakpoint" |
| 60 continue | 47 continue |
| 61 } | 48 } |
| 62 | 49 |
| 63 if ![runto 'marker1'] then { | 50 if ![runto 'marker1'] then { |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } | 285 } |
| 299 -re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23${w
s}$nl\}$nl$gdb_prompt $" { | 286 -re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23${w
s}$nl\}$nl$gdb_prompt $" { |
| 300 # gcc v3 -gstabs+, abi 2 | 287 # gcc v3 -gstabs+, abi 2 |
| 301 pass $name | 288 pass $name |
| 302 } | 289 } |
| 303 -re "There is no field named NestedInnerLocal.*$gdb_prompt $" { | 290 -re "There is no field named NestedInnerLocal.*$gdb_prompt $" { |
| 304 # gcc v3 -gdwarf-2 | 291 # gcc v3 -gdwarf-2 |
| 305 kfail "gdb/482" $name | 292 kfail "gdb/482" $name |
| 306 } | 293 } |
| 307 } | 294 } |
| OLD | NEW |