This commit was generated by cvs2svn to track changes on a CVS vendor
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / scope.exp
1 # Copyright (C) 1992, 1994 Free Software Foundation, Inc.
2
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
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
16
17 # Please email any bugs, comments, and/or additions to this file to:
18 # bug-gdb@prep.ai.mit.edu
19
20 # This file was written by Fred Fish. (fnf@cygnus.com)
21
22 if $tracelevel then {
23 strace $tracelevel
24 }
25
26 set prms_id 0
27 set bug_id 0
28
29 set testfile "scope"
30 set binfile ${objdir}/${subdir}/${testfile}
31 if { [gdb_compile "${srcdir}/${subdir}/scope0.c ${srcdir}/${subdir}/scope1.c" "${binfile}" executable {debug}] != "" } {
32 perror "Couldn't compile scope0.c to object"
33 return -1
34 }
35
36 # Create and source the file that provides information about the compiler
37 # used to compile the test case.
38 if [get_compiler_info ${binfile}] {
39 return -1;
40 }
41
42 # Test locating various things when stopped just inside main, after
43 # running init(). To prevent cascading of errors, we report the
44 # first one and quit. If all pass, then we print the pass results.
45
46 proc test_at_main {} {
47 global gdb_prompt
48 global decimal
49 global det_file
50 global srcdir
51 global subdir
52 global gcc_compiled
53
54 # skip past init. There may be a call to __main at the start of
55 # main, so the first next may only get us to the init call.
56 if [gdb_test "next" "$decimal.*foo \\(\\);" "next over init() in main" "$decimal.*init \\(\\);" "next"] {
57 return ;
58 }
59
60
61 # Print scope0.c::filelocal, which is 1
62
63 if [gdb_test "print filelocal" "\\\$$decimal = 1" "print filelocal" ] {
64 return ;
65 }
66
67
68 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"] {
69 return ;
70 }
71
72
73 # Print scope0.c::filelocal_bss, which is 101
74
75 if [gdb_test "print filelocal_bss" "\\\$$decimal = 101" "print filelocal_bss" ] {
76 return ;
77 }
78
79
80 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"] {
81 return ;
82 }
83
84
85 # Print scope0.c::filelocal_ro, which is 201
86
87 # No clue why the powerpc fails this test.
88 setup_xfail "powerpc-*-*"
89 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
90 if [gdb_test "print filelocal_ro" "\\\$$decimal = 201" "print filelocal_ro in test_at_main" ] {
91 return ;
92 }
93
94
95 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
96 setup_xfail "powerpc-*-*"
97 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"] {
98 return ;
99 }
100
101
102 # Print scope1.c::filelocal, which is 2
103
104 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
105 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"] {
106 return ;
107 }
108
109
110 # Print scope1.c::filelocal_bss, which is 102
111
112 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
113 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"] {
114 return ;
115 }
116
117
118 # Print scope1.c::filelocal_ro, which is 202
119
120 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
121 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"] {
122 return ;
123 }
124
125
126 # Print scope1.c::foo::funclocal, which is 3
127
128 if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
129 if [gdb_test "print foo::funclocal" "\\\$$decimal = 3" "print foo::funclocal" ] {
130 return ;
131 }
132
133
134 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
135 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"] {
136 return ;
137 }
138
139
140 # Print scope1.c::foo::funclocal_ro, which is 203
141
142 if [gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" "print foo::funclocal_ro" ] {
143 return ;
144 }
145
146
147 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
148 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"] {
149 return ;
150 }
151
152
153 # Print scope1.c::bar::funclocal, which is 4
154
155 if [gdb_test "print bar::funclocal" "\\\$$decimal = 4" "print bar::funclocal" ] {
156 return ;
157 }
158
159
160 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
161 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"] {
162 return ;
163 }
164
165 }
166
167 proc test_at_foo {} {
168 global gdb_prompt
169 global decimal
170 global det_file
171 global srcdir
172 global subdir
173 global gcc_compiled
174
175 if [gdb_test "next" ".*bar \\(\\);" "" ] {
176 return ;
177 }
178
179
180 # Print scope0.c::filelocal, which is 1
181
182 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"] {
183 return ;
184 }
185
186
187 # Print scope0.c::filelocal_bss, which is 101
188
189 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"] {
190 return ;
191 }
192
193
194 # Print scope0.c::filelocal_ro, which is 201
195
196 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
197 setup_xfail "powerpc-*-*"
198 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"] {
199 return ;
200 }
201
202
203 gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at foo"
204
205 # Print scope1.c::filelocal, which is 2
206
207 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
208 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"] {
209 return ;
210 }
211
212
213 gdb_test "print filelocal_bss" "\\\$$decimal = 102" \
214 "print filelocal_bss at foo"
215
216 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
217 gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss"
218
219
220 gdb_test "print filelocal_ro" "\\\$$decimal = 202" \
221 "print filelocal_ro at foo"
222
223 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
224 gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"
225
226
227 # Print scope1.c::foo::funclocal, which is 3
228
229 gdb_test "print funclocal" "\\\$$decimal = 3" "print funclocal at foo"
230
231 if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
232 gdb_test "print foo::funclocal" "\\\$$decimal = 3" \
233 "print foo::funclocal at foo"
234
235 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
236 if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
237 gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal"
238
239
240 # Print scope1.c::foo::funclocal_bss, which is 103
241
242 gdb_test "print funclocal_bss" "\\\$$decimal = 103" \
243 "print funclocal_bss at foo"
244
245 if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
246 gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" \
247 "print foo::funclocal_bss at foo"
248
249 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
250 if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
251 gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal = 103" "print 'scope1.c'::foo::funclocal_bss at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_bss"
252
253
254 # Print scope1.c::foo::funclocal_ro, which is 203
255
256 gdb_test "print funclocal_ro" "\\\$$decimal = 203" \
257 "print funclocal_ro at foo"
258
259 if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
260 gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" \
261 "print foo::funclocal_ro at foo"
262
263 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
264 if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
265 gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro"
266
267
268 # Print scope1.c::bar::funclocal, which is 4
269
270 if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
271 gdb_test "print bar::funclocal" "\\\$$decimal = 4" \
272 "print bar::funclocal at foo"
273
274 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
275 if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
276 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"
277
278 }
279
280 proc test_at_bar {} {
281 global gdb_prompt
282 global decimal
283 global det_file
284 global srcdir
285 global subdir
286 global gcc_compiled
287
288 if [gdb_test "next" ".*" "" ] {
289 return ;
290 }
291
292
293 # Print scope0.c::filelocal, which is 1
294
295 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"] {
296 return ;
297 }
298
299
300 # Print scope0.c::filelocal_bss, which is 101
301
302 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"] {
303 return ;
304 }
305
306
307 # Print scope0.c::filelocal_ro, which is 201
308
309 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
310 setup_xfail "powerpc-*-*"
311 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"] {
312 return ;
313 }
314
315
316 # Print scope1.c::filelocal, which is 2
317
318 if [gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at bar" ] {
319 return ;
320 }
321
322
323 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
324 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"] {
325 return ;
326 }
327
328
329 # Print scope1.c::filelocal_bss, which is 102
330
331 if [gdb_test "print filelocal_bss" "\\\$$decimal = 102" "print filelocal_bss at bar" ] {
332 return ;
333 }
334
335
336 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
337 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"] {
338 return ;
339 }
340
341
342 # Print scope1.c::filelocal_ro, which is 202
343
344 if [gdb_test "print filelocal_ro" "\\\$$decimal = 202" "print filelocal_ro in test_at_bar" ] {
345 return ;
346 }
347
348
349 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
350 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"] {
351 return ;
352 }
353
354
355 # Print scope1.c::foo::funclocal, which is 3
356
357 if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
358 if [gdb_test "print foo::funclocal" "\\\$$decimal = 3" "print foo::funclocal at bar" ] {
359 return ;
360 }
361
362
363 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
364 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"] {
365 return ;
366 }
367
368
369 # Print scope1.c::foo::funclocal_bss, which is 103
370
371 if [gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" "print foo::funclocal_bss at bar" ] {
372 return ;
373 }
374
375
376 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
377 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"] {
378 return ;
379 }
380
381
382 # Print scope1.c::foo::funclocal_ro, which is 203
383
384 if [gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" "print foo::funclocal_ro at bar" ] {
385 return ;
386 }
387
388
389 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
390 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"] {
391 return ;
392 }
393
394
395 # Print scope1.c::bar::funclocal, which is 4
396
397 if [gdb_test "print funclocal" "\\\$$decimal = 4" "print funclocal at bar" ] {
398 return ;
399 }
400
401
402 if [gdb_test "print bar::funclocal" "\\\$$decimal = 4" "print bar::funclocal at bar" ] {
403 return ;
404 }
405
406
407 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
408 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"] {
409 return ;
410 }
411
412
413 # Print scope1.c::bar::funclocal_bss, which is 104
414
415 if [gdb_test "print funclocal_bss" "\\\$$decimal = 104" "print funclocal_bss at bar" ] {
416 return ;
417 }
418
419
420 if [gdb_test "print bar::funclocal_bss" "\\\$$decimal = 104" "print bar::funclocal_bss at bar" ] {
421 return ;
422 }
423
424
425 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
426 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"] {
427 return ;
428 }
429
430 }
431
432 # This test has little to do with local scopes, but it is in scope.exp anyway.
433 # That's life.
434
435 proc test_at_autovars {} {
436 global gdb_prompt
437 global decimal
438 global hex
439 global srcfile
440
441 # Test symbol table lookup with 100 local (auto) variables.
442
443 gdb_breakpoint marker1
444
445 if [gdb_test "cont" "Break.* marker1 \\(\\) at .*:$decimal.*" "continue to marker1"] {
446 return;
447 }
448
449 if [gdb_test "up" ".*" "" ] {
450 return ;
451 }
452
453 set count 0
454 while {$count < 100} {
455 if [gdb_test "print i$count" ".* = $count" "" ] {
456 return ;
457 }
458
459 set count [expr $count+1]
460 }
461 clear_xfail "*-*-*"
462 pass "$count auto variables correctly initialized"
463
464 # Test that block variable sorting is not screwing us.
465 gdb_test "frame" "#.*autovars \\(bcd=5, abc=6\\).*" "args in correct order"
466 }
467
468 proc test_at_localscopes {} {
469 global gdb_prompt
470 global decimal
471 global hex
472 global srcfile
473
474 gdb_breakpoint marker2
475 gdb_breakpoint marker3
476 gdb_breakpoint marker4
477
478 if [gdb_test "cont" "Break.* marker2 \\(\\) at .*:$decimal.*" "continue to marker2"] {
479 return;
480 }
481 if [gdb_test "up" ".*" "" ] {
482 return ;
483 }
484
485 # Should be at first (outermost) scope. Check values.
486
487 gdb_test "print localval" " = 10" "print localval, outer scope"
488 gdb_test "print localval1" " = 11" "print localval1, outer scope"
489 gdb_test "print localval2" "No symbol \"localval2\" in current context." \
490 "print localval2, outer scope"
491 gdb_test "print localval3" "No symbol \"localval3\" in current context." \
492 "print localval3, outer scope"
493
494 if [gdb_test "cont" "Break.* marker3 \\(\\) at .*:$decimal.*" \
495 "continue to marker3 in scope.exp"] then { return }
496 if [gdb_test "up" "" "up from marker3 in scope.exp"] then { return }
497
498 # Should be at next (first nested) scope. Check values.
499
500 gdb_test "print localval" " = 20" \
501 "print localval, first nested scope"
502 gdb_test "print localval1" " = 11" "print localval1, first nested scope"
503 gdb_test "print localval2" " = 12" "print localval2, first nested scope"
504 gdb_test "print localval3" "No symbol \"localval3\" in current context." \
505 "print localval3, first nested scope"
506
507 # This test will only fail if the file was compiled by gcc, but
508 # there's no way to check that.
509 setup_xfail "a29k-*-udi" 2423
510 if [gdb_test "cont" "Break.* marker4.*at .*:$decimal.*" \
511 "continue to marker4 in scope.exp"] then { return }
512 if [gdb_test "up" "" "up from marker4 in scope.exp"] then { return }
513
514 gdb_test "print localval" " = 30" "print localval, innermost scope"
515 gdb_test "print localval1" " = 11" "print localval1, innermost scope"
516 gdb_test "print localval2" " = 12" "print localval2, innermost scope"
517 gdb_test "print localval3" " = 13" "print localval3, innermost scope"
518 }
519
520 # Start with a fresh gdb.
521
522 gdb_exit
523 gdb_start
524 gdb_reinitialize_dir $srcdir/$subdir
525 gdb_load ${binfile}
526
527 if [istarget "*-*-vxworks*"] {
528 set timeout 120
529 verbose "Timeout is now $timeout seconds" 2
530 }
531
532 # Test that variables in various segments print out correctly before
533 # the program is run.
534
535 # AIX--sections get mapped to the same address so we can't get the right one.
536 setup_xfail "rs6000-*-*"
537 setup_xfail "powerpc-*-*"
538
539 gdb_test "print 'scope0.c'::filelocal_ro" "= 201"
540
541 # gdb currently cannot access bss memory on some targets if the inferior
542 # is not running.
543 #
544 # For PA boards using monitor/remote-pa.c, the bss test is going to
545 # randomly fail. We've already put remote-pa on the target stack,
546 # so we actually read memory from the board. Problem is crt0.o
547 # is responsible for clearing bss and that hasnt' happened yet.
548 setup_xfail "hppa*-*-*pro*"
549 send_gdb "print 'scope0.c'::filelocal_bss\n"
550 gdb_expect {
551 -re " = 0\r\n$gdb_prompt $" {
552 pass "print 'scope0.c'::filelocal_bss before run"
553 }
554 -re "Cannot access memory.*$gdb_prompt $" {
555 setup_xfail "*-*-*"
556 fail "print 'scope0.c'::filelocal_bss before run"
557 }
558 -re ".*$gdb_prompt $" {
559 fail "print 'scope0.c'::filelocal_bss before run"
560 }
561 default {
562 fail "print 'scope0.c'::filelocal_bss before run"
563 }
564 }
565
566 gdb_test "print 'scope0.c'::filelocal" "= 1" \
567 "print 'scope0.c'::filelocal before run"
568
569 if [runto_main] then { test_at_main }
570 if [istarget "mips-idt-*"] then {
571 # Restart because IDT/SIM runs out of file descriptors.
572 gdb_exit
573 gdb_start
574 gdb_reinitialize_dir $srcdir/$subdir
575 gdb_load ${binfile}
576 }
577 if [runto foo] then { test_at_foo }
578 if [istarget "mips-idt-*"] then {
579 # Restart because IDT/SIM runs out of file descriptors.
580 gdb_exit
581 gdb_start
582 gdb_reinitialize_dir $srcdir/$subdir
583 gdb_load ${binfile}
584 }
585 if [runto bar] then { test_at_bar }
586 if [istarget "mips-idt-*"] then {
587 # Restart because IDT/SIM runs out of file descriptors.
588 gdb_exit
589 gdb_start
590 gdb_reinitialize_dir $srcdir/$subdir
591 gdb_load ${binfile}
592 }
593 if [runto localscopes] then { test_at_localscopes }
594 if [istarget "mips-idt-*"] then {
595 # Restart because IDT/SIM runs out of file descriptors.
596 gdb_exit
597 gdb_start
598 gdb_reinitialize_dir $srcdir/$subdir
599 gdb_load ${binfile}
600 }
601 if [runto autovars] then { test_at_autovars }
602
603 if [istarget "*-*-vxworks*"] {
604 set timeout 120
605 verbose "Timeout is now $timeout seconds" 2
606 }
This page took 0.041607 seconds and 5 git commands to generate.