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