Index: gdb/testsuite/gdb.base/scope.exp |
diff --git a/gdb/testsuite/gdb.base/scope.exp b/gdb/testsuite/gdb.base/scope.exp |
index 273eaaeaf1fa4ec1a35d6991d89d4c7ee03949c8..e781cf034879b30e8b202ab9b16c7c0a080c895b 100644 |
--- a/gdb/testsuite/gdb.base/scope.exp |
+++ b/gdb/testsuite/gdb.base/scope.exp |
@@ -1,5 +1,4 @@ |
-# Copyright 1992, 1994-2000, 2002-2004, 2007-2012 Free Software |
-# Foundation, Inc. |
+# Copyright 1992-2013 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,29 +16,17 @@ |
# This file was written by Fred Fish. (fnf@cygnus.com) |
-set testfile "scope" |
-set binfile ${objdir}/${subdir}/${testfile} |
+standard_testfile scope0.c scope1.c |
- |
-if { [gdb_compile "${srcdir}/${subdir}/scope0.c" "${binfile}0.o" object {debug}] != "" } { |
- untested scope.exp |
- return -1 |
-} |
- |
-if { [gdb_compile "${srcdir}/${subdir}/scope1.c" "${binfile}1.o" object {debug}] != "" } { |
- untested scope.exp |
- return -1 |
-} |
- |
-if { [gdb_compile "${binfile}0.o ${binfile}1.o" ${binfile} executable {debug}] != "" } { |
- untested scope.exp |
- return -1 |
+if {[prepare_for_testing ${testfile}.exp ${testfile} \ |
+ [list $srcfile $srcfile2] {debug}]} { |
+ return -1 |
} |
# Create and source the file that provides information about the compiler |
# used to compile the test case. |
if [get_compiler_info] { |
- return -1; |
+ return -1 |
} |
# Test locating various things when stopped just inside main, after |
@@ -64,24 +51,24 @@ proc test_at_main {} { |
# Print scope0.c::filelocal, which is 1 |
if [gdb_test "print filelocal" "\\\$$decimal = 1" "print filelocal" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if [gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at main" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope0.c::filelocal_bss, which is 101 |
if [gdb_test "print filelocal_bss" "\\\$$decimal = 101" "print filelocal_bss" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if [gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_main" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
@@ -90,13 +77,13 @@ proc test_at_main {} { |
# No clue why the rs6000 fails this test. |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print filelocal_ro" "\\\$$decimal = 201" "print filelocal_ro in test_at_main" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
@@ -104,7 +91,7 @@ proc test_at_main {} { |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
@@ -112,7 +99,7 @@ proc test_at_main {} { |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
@@ -121,48 +108,48 @@ proc test_at_main {} { |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if {$hp_cc_compiler} then { setup_xfail "hppa2.0w-*-*" 11747CLLbs} |
if [gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope1.c::foo::funclocal, which is 3 |
if [gdb_test "print foo::funclocal" "\\\$$decimal = 3" "print foo::funclocal" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope1.c::foo::funclocal_ro, which is 203 |
if [gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" "print foo::funclocal_ro" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope1.c::bar::funclocal, which is 4 |
if [gdb_test "print bar::funclocal" "\\\$$decimal = 4" "print bar::funclocal" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
- gdb_stop_suppressing_tests; |
+ gdb_stop_suppressing_tests |
} |
@@ -174,21 +161,21 @@ proc test_at_foo {} { |
global subdir |
if [gdb_test "next" ".*bar \\(\\);" "" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope0.c::filelocal, which is 1 |
if [gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at foo" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope0.c::filelocal_bss, which is 101 |
if [gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_foo" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
@@ -196,7 +183,7 @@ proc test_at_foo {} { |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
@@ -206,7 +193,7 @@ proc test_at_foo {} { |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
@@ -266,7 +253,7 @@ proc test_at_foo {} { |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal" |
- gdb_stop_suppressing_tests; |
+ gdb_stop_suppressing_tests |
} |
@@ -278,21 +265,21 @@ proc test_at_bar {} { |
global subdir |
if [gdb_test "next" ".*" "" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope0.c::filelocal, which is 1 |
if [gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope0.c::filelocal_bss, which is 101 |
if [gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
@@ -300,123 +287,123 @@ proc test_at_bar {} { |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro at bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope1.c::filelocal, which is 2 |
if [gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at bar" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope1.c::filelocal_bss, which is 102 |
if [gdb_test "print filelocal_bss" "\\\$$decimal = 102" "print filelocal_bss at bar" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope1.c::filelocal_ro, which is 202 |
if [gdb_test "print filelocal_ro" "\\\$$decimal = 202" "print filelocal_ro in test_at_bar" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope1.c::foo::funclocal, which is 3 |
if [gdb_test "print foo::funclocal" "\\\$$decimal = 3" "print foo::funclocal at bar" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope1.c::foo::funclocal_bss, which is 103 |
if [gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" "print foo::funclocal_bss at bar" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal = 103" "print 'scope1.c'::foo::funclocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_bss"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope1.c::foo::funclocal_ro, which is 203 |
if [gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" "print foo::funclocal_ro at bar" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope1.c::bar::funclocal, which is 4 |
if [gdb_test "print funclocal" "\\\$$decimal = 4" "print funclocal at bar" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if [gdb_test "print bar::funclocal" "\\\$$decimal = 4" "print bar::funclocal at bar" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Print scope1.c::bar::funclocal_bss, which is 104 |
if [gdb_test "print funclocal_bss" "\\\$$decimal = 104" "print funclocal_bss at bar" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if [gdb_test "print bar::funclocal_bss" "\\\$$decimal = 104" "print bar::funclocal_bss at bar" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" } |
if [gdb_test "print 'scope1.c'::bar::funclocal_bss" "\\\$$decimal = 104" "print 'scope1.c'::bar::funclocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal_bss"] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
- gdb_stop_suppressing_tests; |
+ gdb_stop_suppressing_tests |
} |
@@ -434,17 +421,17 @@ proc test_at_autovars {} { |
gdb_breakpoint marker1 |
if [gdb_test "cont" "Break.* marker1 \\(\\) at .*:$decimal.*" "continue to marker1"] { |
- gdb_suppress_tests; |
+ gdb_suppress_tests |
} |
if [gdb_test "up" ".*autovars.*" "up from marker1 in scope.exp" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
set count 0 |
while {$count < 100} { |
if [gdb_test "print i$count" ".* = $count" "" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
set count [expr $count+1] |
@@ -467,10 +454,10 @@ proc test_at_localscopes {} { |
gdb_breakpoint marker4 |
if [gdb_test "cont" "Break.* marker2 \\(\\) at .*:$decimal.*" "continue to marker2"] { |
- gdb_suppress_tests; |
+ gdb_suppress_tests |
} |
if [gdb_test "up" ".*localscopes.*" "up from marker2 in scopes.exp" ] { |
- gdb_suppress_tests ; |
+ gdb_suppress_tests |
} |
# Should be at first (outermost) scope. Check values. |
@@ -509,16 +496,9 @@ proc test_at_localscopes {} { |
gdb_test "print localval1" " = 11" "print localval1, innermost scope" |
gdb_test "print localval2" " = 12" "print localval2, innermost scope" |
gdb_test "print localval3" " = 13" "print localval3, innermost scope" |
- gdb_stop_suppressing_tests; |
+ gdb_stop_suppressing_tests |
} |
-# Start with a fresh gdb. |
- |
-gdb_exit |
-gdb_start |
-gdb_reinitialize_dir $srcdir/$subdir |
-gdb_load ${binfile} |
- |
if [istarget "*-*-vxworks*"] { |
set timeout 120 |
verbose "Timeout is now $timeout seconds" 2 |