Home | History | Annotate | Line # | Download | only in gdb.base
scope.exp revision 1.1.1.7
      1  1.1.1.7  christos # Copyright 1992-2023 Free Software Foundation, Inc.
      2      1.1  christos 
      3      1.1  christos # This program is free software; you can redistribute it and/or modify
      4      1.1  christos # it under the terms of the GNU General Public License as published by
      5      1.1  christos # the Free Software Foundation; either version 3 of the License, or
      6      1.1  christos # (at your option) any later version.
      7      1.1  christos #
      8      1.1  christos # This program is distributed in the hope that it will be useful,
      9      1.1  christos # but WITHOUT ANY WARRANTY; without even the implied warranty of
     10      1.1  christos # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     11      1.1  christos # GNU General Public License for more details.
     12      1.1  christos #
     13      1.1  christos # You should have received a copy of the GNU General Public License
     14      1.1  christos # along with this program.  If not, see <http://www.gnu.org/licenses/>.
     15      1.1  christos 
     16      1.1  christos # This file was written by Fred Fish. (fnf (at) cygnus.com)
     17      1.1  christos 
     18      1.1  christos 
     19      1.1  christos standard_testfile scope0.c scope1.c
     20      1.1  christos 
     21  1.1.1.5  christos if {[build_executable "failed to build" ${testfile} \
     22      1.1  christos 	 [list $srcfile $srcfile2] {debug}]} {
     23      1.1  christos     return -1
     24      1.1  christos }
     25      1.1  christos 
     26      1.1  christos # Test locating various things when stopped just inside main, after
     27      1.1  christos # running init0().  To prevent cascading of errors, we report the
     28      1.1  christos # first one and quit.  If all pass, then we print the pass results.
     29      1.1  christos 
     30  1.1.1.7  christos proc_with_prefix test_at_main {} {
     31      1.1  christos     global gdb_prompt
     32      1.1  christos     global decimal
     33      1.1  christos     global det_file
     34      1.1  christos     global srcdir
     35      1.1  christos     global subdir
     36      1.1  christos 
     37      1.1  christos     # skip past init0.
     38      1.1  christos     # This used to do an extra "next" if the first one didn't get us
     39      1.1  christos     # over the call to init0, to handle calls to __main in the
     40      1.1  christos     # prologue, etc.  But if a breakpoint at main doesn't leave us on
     41      1.1  christos     # the first line of real code in the function, that's a GDB bug.
     42      1.1  christos     gdb_test "next" "$decimal.*foo \\(\\);" "next over init0() in main"
     43      1.1  christos 
     44      1.1  christos     # Print scope0.c::filelocal, which is 1
     45  1.1.1.7  christos     gdb_test "print filelocal" "\\\$$decimal = 1"
     46  1.1.1.7  christos     gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at main"
     47      1.1  christos 
     48      1.1  christos     # Print scope0.c::filelocal_bss, which is 101
     49  1.1.1.7  christos     gdb_test "print filelocal_bss" "\\\$$decimal = 101"
     50  1.1.1.7  christos     gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_main"
     51      1.1  christos 
     52      1.1  christos     # Print scope0.c::filelocal_ro, which is 201
     53      1.1  christos 
     54      1.1  christos     # No clue why the rs6000 fails this test.
     55  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     56  1.1.1.7  christos     gdb_test "print filelocal_ro" "\\\$$decimal = 201" "print filelocal_ro in test_at_main"
     57      1.1  christos 
     58  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     59  1.1.1.7  christos     gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro"
     60      1.1  christos 
     61      1.1  christos     # Print scope1.c::filelocal, which is 2
     62  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     63  1.1.1.7  christos     gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal"
     64      1.1  christos 
     65      1.1  christos     # Print scope1.c::filelocal_bss, which is 102
     66  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     67  1.1.1.7  christos     gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss"
     68      1.1  christos 
     69      1.1  christos     # Print scope1.c::filelocal_ro, which is 202
     70  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     71  1.1.1.7  christos     gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro"
     72      1.1  christos 
     73      1.1  christos     # Print scope1.c::foo::funclocal, which is 3
     74  1.1.1.7  christos     gdb_test "print foo::funclocal" "\\\$$decimal = 3"
     75      1.1  christos 
     76  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     77  1.1.1.7  christos     gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal"
     78      1.1  christos 
     79      1.1  christos     # Print scope1.c::foo::funclocal_ro, which is 203
     80  1.1.1.7  christos     gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203"
     81      1.1  christos 
     82  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     83  1.1.1.7  christos     gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro"
     84      1.1  christos 
     85      1.1  christos     # Print scope1.c::bar::funclocal, which is 4
     86  1.1.1.7  christos     gdb_test "print bar::funclocal" "\\\$$decimal = 4"
     87      1.1  christos 
     88  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
     89  1.1.1.7  christos     gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal"
     90      1.1  christos }
     91      1.1  christos 
     92  1.1.1.7  christos proc_with_prefix test_at_foo {} {
     93      1.1  christos     global gdb_prompt
     94      1.1  christos     global decimal
     95      1.1  christos     global det_file
     96      1.1  christos     global srcdir
     97      1.1  christos     global subdir
     98      1.1  christos 
     99  1.1.1.7  christos     gdb_test "next" ".*bar \\(\\);"
    100      1.1  christos 
    101      1.1  christos     # Print scope0.c::filelocal, which is 1
    102  1.1.1.7  christos     gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at foo"
    103      1.1  christos 
    104      1.1  christos     # Print scope0.c::filelocal_bss, which is 101
    105  1.1.1.7  christos     gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_foo"
    106      1.1  christos 
    107      1.1  christos     # Print scope0.c::filelocal_ro, which is 201
    108  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    109  1.1.1.7  christos     gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro"
    110      1.1  christos 
    111      1.1  christos 
    112      1.1  christos     # Print scope1.c::filelocal, which is 2
    113  1.1.1.7  christos     gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at foo"
    114      1.1  christos 
    115  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    116  1.1.1.7  christos     gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at foo"
    117      1.1  christos 
    118      1.1  christos     gdb_test "print filelocal_bss" "\\\$$decimal = 102" \
    119      1.1  christos 	"print filelocal_bss at foo"
    120      1.1  christos 
    121  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    122  1.1.1.7  christos     gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss at foo"
    123      1.1  christos 
    124      1.1  christos 
    125      1.1  christos     gdb_test "print filelocal_ro" "\\\$$decimal = 202" \
    126      1.1  christos 	"print filelocal_ro at foo"
    127      1.1  christos 
    128  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    129  1.1.1.7  christos     gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro at foo"
    130      1.1  christos 
    131      1.1  christos 
    132      1.1  christos     # Print scope1.c::foo::funclocal, which is 3
    133      1.1  christos 
    134      1.1  christos     gdb_test "print funclocal" "\\\$$decimal = 3" "print funclocal at foo"
    135      1.1  christos 
    136      1.1  christos     gdb_test "print foo::funclocal" "\\\$$decimal = 3" \
    137      1.1  christos 	"print foo::funclocal at foo"
    138      1.1  christos 
    139  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    140  1.1.1.7  christos     gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal at foo"
    141      1.1  christos 
    142      1.1  christos 
    143      1.1  christos     # Print scope1.c::foo::funclocal_bss, which is 103
    144      1.1  christos 
    145      1.1  christos     gdb_test "print funclocal_bss" "\\\$$decimal = 103" \
    146      1.1  christos 	"print funclocal_bss at foo"
    147      1.1  christos 
    148      1.1  christos     gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" \
    149      1.1  christos 	"print foo::funclocal_bss at foo"
    150      1.1  christos 
    151  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    152  1.1.1.7  christos     gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal = 103" "print 'scope1.c'::foo::funclocal_bss at foo"
    153      1.1  christos 
    154      1.1  christos 
    155      1.1  christos     # Print scope1.c::foo::funclocal_ro, which is 203
    156      1.1  christos 
    157      1.1  christos     gdb_test "print funclocal_ro" "\\\$$decimal = 203" \
    158      1.1  christos 	"print funclocal_ro at foo"
    159      1.1  christos 
    160      1.1  christos     gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" \
    161      1.1  christos 	"print foo::funclocal_ro at foo"
    162      1.1  christos 
    163  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    164  1.1.1.7  christos     gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro at foo"
    165      1.1  christos 
    166      1.1  christos 
    167      1.1  christos     # Print scope1.c::bar::funclocal, which is 4
    168      1.1  christos 
    169      1.1  christos     gdb_test "print bar::funclocal" "\\\$$decimal = 4" \
    170      1.1  christos 	"print bar::funclocal at foo"
    171      1.1  christos 
    172  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    173  1.1.1.7  christos     gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at foo"
    174      1.1  christos 
    175      1.1  christos }
    176      1.1  christos 
    177  1.1.1.7  christos proc_with_prefix test_at_bar {} {
    178      1.1  christos     global gdb_prompt
    179      1.1  christos     global decimal
    180      1.1  christos     global det_file
    181      1.1  christos     global srcdir
    182      1.1  christos     global subdir
    183      1.1  christos 
    184  1.1.1.7  christos     gdb_test "next"
    185      1.1  christos 
    186      1.1  christos     # Print scope0.c::filelocal, which is 1
    187  1.1.1.7  christos     gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at bar"
    188      1.1  christos 
    189  1.1.1.7  christos     # Print scope0.c::filelocal_bss, which is 101
    190  1.1.1.7  christos     gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_bar"
    191      1.1  christos 
    192  1.1.1.7  christos     # Print scope0.c::filelocal_ro, which is 201
    193  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    194  1.1.1.7  christos     gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro at bar"
    195      1.1  christos 
    196      1.1  christos     # Print scope1.c::filelocal, which is 2
    197  1.1.1.7  christos     gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at bar"
    198      1.1  christos 
    199  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    200  1.1.1.7  christos     gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at bar"
    201      1.1  christos 
    202      1.1  christos     # Print scope1.c::filelocal_bss, which is 102
    203  1.1.1.7  christos     gdb_test "print filelocal_bss" "\\\$$decimal = 102" "print filelocal_bss at bar"
    204      1.1  christos 
    205  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    206  1.1.1.7  christos     gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss at bar"
    207      1.1  christos 
    208      1.1  christos     # Print scope1.c::filelocal_ro, which is 202
    209  1.1.1.7  christos     gdb_test "print filelocal_ro" "\\\$$decimal = 202" "print filelocal_ro in test_at_bar"
    210      1.1  christos 
    211  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    212  1.1.1.7  christos     gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro at bar"
    213      1.1  christos 
    214      1.1  christos     # Print scope1.c::foo::funclocal, which is 3
    215  1.1.1.7  christos     gdb_test "print foo::funclocal" "\\\$$decimal = 3" "print foo::funclocal at bar"
    216      1.1  christos 
    217  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    218  1.1.1.7  christos     gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal at bar"
    219      1.1  christos 
    220      1.1  christos     # Print scope1.c::foo::funclocal_bss, which is 103
    221  1.1.1.7  christos     gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" "print foo::funclocal_bss at bar"
    222      1.1  christos 
    223  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    224  1.1.1.7  christos     gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal = 103" "print 'scope1.c'::foo::funclocal_bss at bar"
    225      1.1  christos 
    226      1.1  christos     # Print scope1.c::foo::funclocal_ro, which is 203
    227  1.1.1.7  christos     gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" "print foo::funclocal_ro at bar"
    228      1.1  christos 
    229  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    230  1.1.1.7  christos     gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro at bar"
    231      1.1  christos 
    232      1.1  christos     # Print scope1.c::bar::funclocal, which is 4
    233  1.1.1.7  christos     gdb_test "print funclocal" "\\\$$decimal = 4" "print funclocal at bar"
    234  1.1.1.7  christos     gdb_test "print bar::funclocal" "\\\$$decimal = 4" "print bar::funclocal at bar"
    235      1.1  christos 
    236  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    237  1.1.1.7  christos     gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at bar"
    238      1.1  christos 
    239      1.1  christos     # Print scope1.c::bar::funclocal_bss, which is 104
    240  1.1.1.7  christos     gdb_test "print funclocal_bss" "\\\$$decimal = 104" "print funclocal_bss at bar"
    241  1.1.1.7  christos     gdb_test "print bar::funclocal_bss" "\\\$$decimal = 104" "print bar::funclocal_bss at bar"
    242      1.1  christos 
    243  1.1.1.7  christos     if {[test_compiler_info gcc-*-*]} { setup_xfail "rs6000-*-*" }
    244  1.1.1.7  christos     gdb_test "print 'scope1.c'::bar::funclocal_bss" "\\\$$decimal = 104" "print 'scope1.c'::bar::funclocal_bss at bar"
    245      1.1  christos }
    246      1.1  christos 
    247      1.1  christos # This test has little to do with local scopes, but it is in scope.exp anyway.
    248      1.1  christos # That's life.
    249      1.1  christos 
    250  1.1.1.7  christos proc_with_prefix test_at_autovars {} {
    251      1.1  christos     global gdb_prompt
    252      1.1  christos     global decimal
    253      1.1  christos     global hex
    254      1.1  christos     global srcfile
    255      1.1  christos 
    256      1.1  christos     # Test symbol table lookup with 100 local (auto) variables.
    257      1.1  christos 
    258      1.1  christos     gdb_breakpoint marker1
    259      1.1  christos 
    260  1.1.1.7  christos     gdb_test "cont" "Break.* marker1 \\(\\) at .*:$decimal.*" "continue to marker1"
    261  1.1.1.7  christos     gdb_test "up" ".*autovars.*" "up from marker1"
    262      1.1  christos 
    263      1.1  christos     set count 0
    264      1.1  christos     while {$count < 100} {
    265  1.1.1.7  christos 	gdb_test "print i$count" ".* = $count" ""
    266      1.1  christos 	set count [expr $count+1]
    267      1.1  christos     }
    268      1.1  christos     clear_xfail "*-*-*"
    269      1.1  christos     pass "$count auto variables correctly initialized"
    270      1.1  christos 
    271      1.1  christos     # Test that block variable sorting is not screwing us.
    272      1.1  christos     gdb_test "frame" "#.*autovars \\(bcd=5, abc=6\\).*" "args in correct order"
    273      1.1  christos }
    274      1.1  christos 
    275  1.1.1.7  christos proc_with_prefix test_at_localscopes {} {
    276      1.1  christos     global gdb_prompt
    277      1.1  christos     global decimal
    278      1.1  christos     global hex
    279      1.1  christos     global srcfile
    280      1.1  christos 
    281      1.1  christos     gdb_breakpoint marker2
    282      1.1  christos     gdb_breakpoint marker3
    283      1.1  christos     gdb_breakpoint marker4
    284      1.1  christos 
    285  1.1.1.7  christos     gdb_test "cont" "Break.* marker2 \\(\\) at .*:$decimal.*" "continue to marker2"
    286  1.1.1.7  christos     gdb_test "up" ".*localscopes.*" "up from marker2"
    287      1.1  christos 
    288      1.1  christos     # Should be at first (outermost) scope.  Check values.
    289      1.1  christos 
    290      1.1  christos     gdb_test "print localval" " = 10" "print localval, outer scope"
    291      1.1  christos     gdb_test "print localval1" " = 11" "print localval1, outer scope"
    292      1.1  christos     gdb_test "print localval2" "No symbol \"localval2\" in current context." \
    293      1.1  christos 	"print localval2, outer scope"
    294      1.1  christos     gdb_test "print localval3" "No symbol \"localval3\" in current context." \
    295      1.1  christos 	"print localval3, outer scope"
    296      1.1  christos 
    297  1.1.1.7  christos     gdb_test "cont" "Break.* marker3 \\(\\) at .*:$decimal.*" \
    298  1.1.1.7  christos 	"continue to marker3"
    299  1.1.1.7  christos     gdb_test "up" ".*localscopes.*" "up from marker3"
    300      1.1  christos 
    301      1.1  christos     # Should be at next (first nested) scope.  Check values.
    302      1.1  christos 
    303      1.1  christos     gdb_test "print localval" " = 20" \
    304      1.1  christos 	"print localval, first nested scope"
    305      1.1  christos     gdb_test "print localval1" " = 11" "print localval1, first nested scope"
    306      1.1  christos     gdb_test "print localval2" " = 12" "print localval2, first nested scope"
    307      1.1  christos     gdb_test "print localval3" "No symbol \"localval3\" in current context." \
    308      1.1  christos 	"print localval3, first nested scope"
    309      1.1  christos 
    310      1.1  christos     # This test will only fail if the file was compiled by gcc, but
    311      1.1  christos     # there's no way to check that.
    312  1.1.1.7  christos     gdb_test "cont" "Break.* marker4.*at .*:$decimal.*" \
    313  1.1.1.7  christos 	"continue to marker4"
    314  1.1.1.7  christos     gdb_test "up" ".*localscopes.*" "up from marker4"
    315      1.1  christos 
    316      1.1  christos     gdb_test "print localval" " = 30" "print localval, innermost scope"
    317      1.1  christos     gdb_test "print localval1" " = 11" "print localval1, innermost scope"
    318      1.1  christos     gdb_test "print localval2" " = 12" "print localval2, innermost scope"
    319      1.1  christos     gdb_test "print localval3" " = 13" "print localval3, innermost scope"
    320      1.1  christos }
    321      1.1  christos 
    322  1.1.1.5  christos # Note, we don't pass a binfile to clean_restart because we need to
    323  1.1.1.5  christos # avoid gdb_load here.  With remote targets, gdb_load connects to the
    324  1.1.1.5  christos # remote target, and we specificaly want the following tests to run
    325  1.1.1.5  christos # before the program is started.
    326  1.1.1.5  christos clean_restart
    327  1.1.1.5  christos gdb_file_cmd $binfile
    328  1.1.1.5  christos 
    329      1.1  christos # Test that variables in various segments print out correctly before
    330      1.1  christos # the program is run.
    331      1.1  christos 
    332      1.1  christos # AIX--sections get mapped to the same address so we can't get the right one.
    333      1.1  christos setup_xfail "rs6000-*-*"
    334      1.1  christos 
    335      1.1  christos gdb_test "print 'scope0.c'::filelocal_ro" "= 201"
    336      1.1  christos 
    337  1.1.1.5  christos # Check that gdb can access bss memory if the inferior is not running.
    338      1.1  christos #
    339  1.1.1.5  christos # Note the care above about avoiding gdb_load.  Otherwise, for
    340  1.1.1.5  christos # embedded stub-like boards, this test would randomly fail.  If we'd
    341  1.1.1.5  christos # already put target remote on the target stack, we'd read memory from
    342  1.1.1.5  christos # the board instead of the program's binary, and we would have
    343  1.1.1.5  christos # connected before crt0.o had had a chance to clear bss.
    344  1.1.1.5  christos gdb_test "print 'scope0.c'::filelocal_bss" "= 0" \
    345  1.1.1.5  christos     "print 'scope0.c'::filelocal_bss before run"
    346      1.1  christos 
    347      1.1  christos gdb_test "print 'scope0.c'::filelocal" "= 1" \
    348      1.1  christos     "print 'scope0.c'::filelocal before run"
    349      1.1  christos 
    350  1.1.1.7  christos if {[runto_main]} { test_at_main }
    351  1.1.1.7  christos if {[runto foo]} { test_at_foo }
    352  1.1.1.7  christos if {[runto bar]} { test_at_bar }
    353  1.1.1.7  christos if {[runto localscopes]} { test_at_localscopes }
    354  1.1.1.7  christos if {[runto autovars]} { test_at_autovars }
    355