OLD | NEW |
1 # Copyright 1992-2005, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 1992-2005, 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 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 # E.g. make check RUNTESTFLAGS=GDBFLAGS=mumble | 45 # E.g. make check RUNTESTFLAGS=GDBFLAGS=mumble |
46 # Testcases may use it to add additional flags, but they must: | 46 # Testcases may use it to add additional flags, but they must: |
47 # - append new flags, not overwrite | 47 # - append new flags, not overwrite |
48 # - restore the original value when done | 48 # - restore the original value when done |
49 global GDBFLAGS | 49 global GDBFLAGS |
50 if ![info exists GDBFLAGS] { | 50 if ![info exists GDBFLAGS] { |
51 set GDBFLAGS "" | 51 set GDBFLAGS "" |
52 } | 52 } |
53 verbose "using GDBFLAGS = $GDBFLAGS" 2 | 53 verbose "using GDBFLAGS = $GDBFLAGS" 2 |
54 | 54 |
| 55 # Make the build data directory available to tests. |
| 56 set BUILD_DATA_DIRECTORY "[pwd]/../data-directory" |
| 57 |
55 # INTERNAL_GDBFLAGS contains flags that the testsuite requires. | 58 # INTERNAL_GDBFLAGS contains flags that the testsuite requires. |
56 global INTERNAL_GDBFLAGS | 59 global INTERNAL_GDBFLAGS |
57 if ![info exists INTERNAL_GDBFLAGS] { | 60 if ![info exists INTERNAL_GDBFLAGS] { |
58 set INTERNAL_GDBFLAGS "-nw -nx -data-directory [pwd]/../data-directory" | 61 set INTERNAL_GDBFLAGS "-nw -nx -data-directory $BUILD_DATA_DIRECTORY" |
59 } | 62 } |
60 | 63 |
61 # The variable gdb_prompt is a regexp which matches the gdb prompt. | 64 # The variable gdb_prompt is a regexp which matches the gdb prompt. |
62 # Set it if it is not already set. | 65 # Set it if it is not already set. |
63 global gdb_prompt | 66 global gdb_prompt |
64 if ![info exists gdb_prompt] then { | 67 if ![info exists gdb_prompt] then { |
65 set gdb_prompt "\[(\]gdb\[)\]" | 68 set gdb_prompt "\[(\]gdb\[)\]" |
66 } | 69 } |
67 | 70 |
68 # The variable fullname_syntax_POSIX is a regexp which matches a POSIX | 71 # The variable fullname_syntax_POSIX is a regexp which matches a POSIX |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 return; | 262 return; |
260 } | 263 } |
261 send_gdb "jump *$start\n"; | 264 send_gdb "jump *$start\n"; |
262 } | 265 } |
263 timeout { | 266 timeout { |
264 perror "Jump to start() failed (timeout)"; | 267 perror "Jump to start() failed (timeout)"; |
265 return | 268 return |
266 } | 269 } |
267 } | 270 } |
268 } | 271 } |
269 if [target_info exists gdb_stub] { | |
270 gdb_expect 60 { | |
271 -re "$gdb_prompt $" { | |
272 send_gdb "continue\n" | |
273 } | |
274 } | |
275 } | |
276 return | 272 return |
277 } | 273 } |
278 | 274 |
279 if [target_info exists gdb,do_reload_on_run] { | 275 if [target_info exists gdb,do_reload_on_run] { |
280 if { [gdb_reload] != 0 } { | 276 if { [gdb_reload] != 0 } { |
281 return; | 277 return; |
282 } | 278 } |
283 } | 279 } |
284 send_gdb "run $args\n" | 280 send_gdb "run $args\n" |
285 # This doesn't work quite right yet. | 281 # This doesn't work quite right yet. |
(...skipping 19 matching lines...) Expand all Loading... |
305 | 301 |
306 proc gdb_start_cmd {args} { | 302 proc gdb_start_cmd {args} { |
307 global gdb_prompt use_gdb_stub | 303 global gdb_prompt use_gdb_stub |
308 | 304 |
309 if [target_info exists gdb_init_command] { | 305 if [target_info exists gdb_init_command] { |
310 send_gdb "[target_info gdb_init_command]\n"; | 306 send_gdb "[target_info gdb_init_command]\n"; |
311 gdb_expect 30 { | 307 gdb_expect 30 { |
312 -re "$gdb_prompt $" { } | 308 -re "$gdb_prompt $" { } |
313 default { | 309 default { |
314 perror "gdb_init_command for target failed"; | 310 perror "gdb_init_command for target failed"; |
315 » » return; | 311 » » return -1; |
316 } | 312 } |
317 } | 313 } |
318 } | 314 } |
319 | 315 |
320 if $use_gdb_stub { | 316 if $use_gdb_stub { |
321 return -1 | 317 return -1 |
322 } | 318 } |
323 | 319 |
324 send_gdb "start $args\n" | 320 send_gdb "start $args\n" |
325 # Use -notransfer here so that test cases (like chng-sym.exp) | 321 # Use -notransfer here so that test cases (like chng-sym.exp) |
326 # may test for additional start-up messages. | 322 # may test for additional start-up messages. |
327 gdb_expect 60 { | 323 gdb_expect 60 { |
328 -re "The program .* has been started already.*y or n. $" { | 324 -re "The program .* has been started already.*y or n. $" { |
329 send_gdb "y\n" | 325 send_gdb "y\n" |
330 exp_continue | 326 exp_continue |
331 } | 327 } |
332 -notransfer -re "Starting program: \[^\r\n\]*" { | 328 -notransfer -re "Starting program: \[^\r\n\]*" { |
333 return 0 | 329 return 0 |
334 } | 330 } |
335 } | 331 } |
336 return -1 | 332 return -1 |
337 } | 333 } |
338 | 334 |
339 # Set a breakpoint at FUNCTION. If there is an additional argument it is | 335 # Set a breakpoint at FUNCTION. If there is an additional argument it is |
340 # a list of options; the supported options are allow-pending, temporary, | 336 # a list of options; the supported options are allow-pending, temporary, |
341 # and no-message. | 337 # message, no-message, and passfail. |
| 338 # The result is 1 for success, 0 for failure. |
| 339 # |
| 340 # Note: The handling of message vs no-message is messed up, but it's based |
| 341 # on historical usage. By default this function does not print passes, |
| 342 # only fails. |
| 343 # no-message: turns off printing of fails (and passes, but they're already off) |
| 344 # message: turns on printing of passes (and fails, but they're already on) |
342 | 345 |
343 proc gdb_breakpoint { function args } { | 346 proc gdb_breakpoint { function args } { |
344 global gdb_prompt | 347 global gdb_prompt |
345 global decimal | 348 global decimal |
346 | 349 |
347 set pending_response n | 350 set pending_response n |
348 if {[lsearch -exact [lindex $args 0] allow-pending] != -1} { | 351 if {[lsearch -exact $args allow-pending] != -1} { |
349 set pending_response y | 352 set pending_response y |
350 } | 353 } |
351 | 354 |
352 set break_command "break" | 355 set break_command "break" |
353 set break_message "Breakpoint" | 356 set break_message "Breakpoint" |
354 if {[lsearch -exact [lindex $args 0] temporary] != -1} { | 357 if {[lsearch -exact $args temporary] != -1} { |
355 set break_command "tbreak" | 358 set break_command "tbreak" |
356 set break_message "Temporary breakpoint" | 359 set break_message "Temporary breakpoint" |
357 } | 360 } |
358 | 361 |
359 set no_message 0 | 362 set print_pass 0 |
360 if {[lsearch -exact [lindex $args 0] no-message] != -1} { | 363 set print_fail 1 |
361 » set no_message 1 | 364 set no_message_loc [lsearch -exact $args no-message] |
| 365 set message_loc [lsearch -exact $args message] |
| 366 # The last one to appear in args wins. |
| 367 if { $no_message_loc > $message_loc } { |
| 368 » set print_fail 0 |
| 369 } elseif { $message_loc > $no_message_loc } { |
| 370 » set print_pass 1 |
362 } | 371 } |
363 | 372 |
| 373 set test_name "setting breakpoint at $function" |
| 374 |
364 send_gdb "$break_command $function\n" | 375 send_gdb "$break_command $function\n" |
365 # The first two regexps are what we get with -g, the third is without -g. | 376 # The first two regexps are what we get with -g, the third is without -g. |
366 gdb_expect 30 { | 377 gdb_expect 30 { |
367 -re "$break_message \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prom
pt $" {} | 378 -re "$break_message \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prom
pt $" {} |
368 -re "$break_message \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $"
{} | 379 -re "$break_message \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $"
{} |
369 -re "$break_message \[0-9\]* at .*$gdb_prompt $" {} | 380 -re "$break_message \[0-9\]* at .*$gdb_prompt $" {} |
370 -re "$break_message \[0-9\]* \\(.*\\) pending.*$gdb_prompt $" { | 381 -re "$break_message \[0-9\]* \\(.*\\) pending.*$gdb_prompt $" { |
371 if {$pending_response == "n"} { | 382 if {$pending_response == "n"} { |
372 » » » if { $no_message == 0 } { | 383 » » » if { $print_fail } { |
373 » » » » fail "setting breakpoint at $function" | 384 » » » » fail $test_name |
374 } | 385 } |
375 return 0 | 386 return 0 |
376 } | 387 } |
377 } | 388 } |
378 -re "Make breakpoint pending.*y or \\\[n\\\]. $" { | 389 -re "Make breakpoint pending.*y or \\\[n\\\]. $" { |
379 send_gdb "$pending_response\n" | 390 send_gdb "$pending_response\n" |
380 exp_continue | 391 exp_continue |
381 } | 392 } |
382 -re "A problem internal to GDB has been detected" { | 393 -re "A problem internal to GDB has been detected" { |
383 » » fail "setting breakpoint at $function in runto (GDB internal err
or)" | 394 » » if { $print_fail } { |
| 395 » » fail "$test_name (GDB internal error)" |
| 396 » » } |
384 gdb_internal_error_resync | 397 gdb_internal_error_resync |
385 return 0 | 398 return 0 |
386 } | 399 } |
387 -re "$gdb_prompt $" { | 400 -re "$gdb_prompt $" { |
388 » » if { $no_message == 0 } { | 401 » » if { $print_fail } { |
389 » » » fail "setting breakpoint at $function" | 402 » » » fail $test_name |
| 403 » » } |
| 404 » » return 0 |
| 405 » } |
| 406 » eof { |
| 407 » » if { $print_fail } { |
| 408 » » » fail "$test_name (eof)" |
390 } | 409 } |
391 return 0 | 410 return 0 |
392 } | 411 } |
393 timeout { | 412 timeout { |
394 » » if { $no_message == 0 } { | 413 » » if { $print_fail } { |
395 » » » fail "setting breakpoint at $function (timeout)" | 414 » » » fail "$test_name (timeout)" |
396 } | 415 } |
397 return 0 | 416 return 0 |
398 } | 417 } |
399 } | 418 } |
| 419 if { $print_pass } { |
| 420 pass $test_name |
| 421 } |
400 return 1; | 422 return 1; |
401 } | 423 } |
402 | 424 |
403 # Set breakpoint at function and run gdb until it breaks there. | 425 # Set breakpoint at function and run gdb until it breaks there. |
404 # Since this is the only breakpoint that will be set, if it stops | 426 # Since this is the only breakpoint that will be set, if it stops |
405 # at a breakpoint, we will assume it is the one we want. We can't | 427 # at a breakpoint, we will assume it is the one we want. We can't |
406 # just compare to "function" because it might be a fully qualified, | 428 # just compare to "function" because it might be a fully qualified, |
407 # single quoted C++ function specifier. If there's an additional argument, | 429 # single quoted C++ function specifier. |
408 # pass it to gdb_breakpoint. | 430 # |
| 431 # If there are additional arguments, pass them to gdb_breakpoint. |
| 432 # We recognize no-message/message ourselves. |
| 433 # The default is no-message. |
| 434 # no-message is messed up here, like gdb_breakpoint: to preserve |
| 435 # historical usage fails are always printed by default. |
| 436 # no-message: turns off printing of fails (and passes, but they're already off) |
| 437 # message: turns on printing of passes (and fails, but they're already on) |
409 | 438 |
410 proc runto { function args } { | 439 proc runto { function args } { |
411 global gdb_prompt | 440 global gdb_prompt |
412 global decimal | 441 global decimal |
413 | 442 |
414 delete_breakpoints | 443 delete_breakpoints |
415 | 444 |
416 if ![gdb_breakpoint $function [lindex $args 0]] { | 445 # Default to "no-message". |
| 446 set args "no-message $args" |
| 447 |
| 448 set print_pass 0 |
| 449 set print_fail 1 |
| 450 set no_message_loc [lsearch -exact $args no-message] |
| 451 set message_loc [lsearch -exact $args message] |
| 452 # The last one to appear in args wins. |
| 453 if { $no_message_loc > $message_loc } { |
| 454 » set print_fail 0 |
| 455 } elseif { $message_loc > $no_message_loc } { |
| 456 » set print_pass 1 |
| 457 } |
| 458 |
| 459 set test_name "running to $function in runto" |
| 460 |
| 461 # We need to use eval here to pass our varargs args to gdb_breakpoint |
| 462 # which is also a varargs function. |
| 463 # But we also have to be careful because $function may have multiple |
| 464 # elements, and we don't want Tcl to move the remaining elements after |
| 465 # the first to $args. That is why $function is wrapped in {}. |
| 466 if ![eval gdb_breakpoint {$function} $args] { |
417 return 0; | 467 return 0; |
418 } | 468 } |
419 | 469 |
420 gdb_run_cmd | 470 gdb_run_cmd |
421 | 471 |
422 # the "at foo.c:36" output we get with -g. | 472 # the "at foo.c:36" output we get with -g. |
423 # the "in func" output we get without -g. | 473 # the "in func" output we get without -g. |
424 gdb_expect 30 { | 474 gdb_expect 30 { |
425 -re "Break.* at .*:$decimal.*$gdb_prompt $" { | 475 -re "Break.* at .*:$decimal.*$gdb_prompt $" { |
| 476 if { $print_pass } { |
| 477 pass $test_name |
| 478 } |
426 return 1 | 479 return 1 |
427 } | 480 } |
428 -re "Breakpoint \[0-9\]*, \[0-9xa-f\]* in .*$gdb_prompt $" { | 481 -re "Breakpoint \[0-9\]*, \[0-9xa-f\]* in .*$gdb_prompt $" { |
| 482 if { $print_pass } { |
| 483 pass $test_name |
| 484 } |
429 return 1 | 485 return 1 |
430 } | 486 } |
431 -re "The target does not support running in non-stop mode.\r\n$gdb_promp
t $" { | 487 -re "The target does not support running in non-stop mode.\r\n$gdb_promp
t $" { |
432 » unsupported "Non-stop mode not supported" | 488 » if { $print_fail } { |
| 489 » » unsupported "Non-stop mode not supported" |
| 490 » } |
433 return 0 | 491 return 0 |
434 } | 492 } |
435 -re ".*A problem internal to GDB has been detected" { | 493 -re ".*A problem internal to GDB has been detected" { |
436 » fail "running to $function in runto (GDB internal error)" | 494 » if { $print_fail } { |
| 495 » » fail "$test_name (GDB internal error)" |
| 496 » } |
437 gdb_internal_error_resync | 497 gdb_internal_error_resync |
438 return 0 | 498 return 0 |
439 } | 499 } |
440 -re "$gdb_prompt $" { | 500 -re "$gdb_prompt $" { |
441 » fail "running to $function in runto" | 501 » if { $print_fail } { |
| 502 » » fail $test_name |
| 503 » } |
442 return 0 | 504 return 0 |
443 } | 505 } |
444 eof { | 506 eof { |
445 » fail "running to $function in runto (end of file)" | 507 » if { $print_fail } { |
| 508 » » fail "$test_name (eof)" |
| 509 » } |
446 return 0 | 510 return 0 |
447 } | 511 } |
448 timeout { | 512 timeout { |
449 » fail "running to $function in runto (timeout)" | 513 » if { $print_fail } { |
| 514 » » fail "$test_name (timeout)" |
| 515 » } |
450 return 0 | 516 return 0 |
451 } | 517 } |
452 } | 518 } |
453 return 1 | 519 return 1 |
454 } | 520 } |
455 | 521 |
456 # Ask gdb to run until we hit a breakpoint at main. | 522 # Ask gdb to run until we hit a breakpoint at main. |
457 # The case where the target uses stubs has to be handled | |
458 # specially--if it uses stubs, assuming we hit | |
459 # breakpoint() and just step out of the function. | |
460 # | 523 # |
461 # N.B. This function deletes all existing breakpoints. | 524 # N.B. This function deletes all existing breakpoints. |
462 # If you don't want that, use gdb_start_cmd. | 525 # If you don't want that, use gdb_start_cmd. |
463 | 526 |
464 proc runto_main { } { | 527 proc runto_main { } { |
465 global gdb_prompt | 528 return [runto main no-message] |
466 global decimal | |
467 | |
468 if ![target_info exists gdb_stub] { | |
469 » return [runto main] | |
470 }» » » | |
471 | |
472 delete_breakpoints | |
473 | |
474 gdb_step_for_stub; | |
475 | |
476 return 1 | |
477 } | 529 } |
478 | 530 |
479 ### Continue, and expect to hit a breakpoint. | 531 ### Continue, and expect to hit a breakpoint. |
480 ### Report a pass or fail, depending on whether it seems to have | 532 ### Report a pass or fail, depending on whether it seems to have |
481 ### worked. Use NAME as part of the test name; each call to | 533 ### worked. Use NAME as part of the test name; each call to |
482 ### continue_to_breakpoint should use a NAME which is unique within | 534 ### continue_to_breakpoint should use a NAME which is unique within |
483 ### that test file. | 535 ### that test file. |
484 proc gdb_continue_to_breakpoint {name {location_pattern .*}} { | 536 proc gdb_continue_to_breakpoint {name {location_pattern .*}} { |
485 global gdb_prompt | 537 global gdb_prompt |
486 set full_name "continue to breakpoint: $name" | 538 set full_name "continue to breakpoint: $name" |
487 | 539 |
488 send_gdb "continue\n" | 540 send_gdb "continue\n" |
489 gdb_expect { | 541 gdb_expect { |
490 » -re "Breakpoint .* (at|in) $location_pattern\r\n$gdb_prompt $" { | 542 » -re "(?:Breakpoint|Temporary breakpoint) .* (at|in) $location_pattern\r\
n$gdb_prompt $" { |
491 pass $full_name | 543 pass $full_name |
492 } | 544 } |
493 -re ".*$gdb_prompt $" { | 545 -re ".*$gdb_prompt $" { |
494 fail $full_name | 546 fail $full_name |
495 } | 547 } |
496 timeout { | 548 timeout { |
497 fail "$full_name (timeout)" | 549 fail "$full_name (timeout)" |
498 } | 550 } |
499 } | 551 } |
500 } | 552 } |
(...skipping 18 matching lines...) Expand all Loading... |
519 # ... | 571 # ... |
520 # -re ".*A problem internal to GDB has been detected" { | 572 # -re ".*A problem internal to GDB has been detected" { |
521 # gdb_internal_error_resync | 573 # gdb_internal_error_resync |
522 # } | 574 # } |
523 # ... | 575 # ... |
524 # } | 576 # } |
525 # | 577 # |
526 proc gdb_internal_error_resync {} { | 578 proc gdb_internal_error_resync {} { |
527 global gdb_prompt | 579 global gdb_prompt |
528 | 580 |
| 581 verbose -log "Resyncing due to internal error." |
| 582 |
529 set count 0 | 583 set count 0 |
530 while {$count < 10} { | 584 while {$count < 10} { |
531 gdb_expect { | 585 gdb_expect { |
532 -re "Quit this debugging session\\? \\(y or n\\) $" { | 586 -re "Quit this debugging session\\? \\(y or n\\) $" { |
533 send_gdb "n\n" | 587 send_gdb "n\n" |
534 incr count | 588 incr count |
535 } | 589 } |
536 -re "Create a core file of GDB\\? \\(y or n\\) $" { | 590 -re "Create a core file of GDB\\? \\(y or n\\) $" { |
537 send_gdb "n\n" | 591 send_gdb "n\n" |
538 incr count | 592 incr count |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 | 652 |
599 if [string match "*\[\r\n\]" $command] { | 653 if [string match "*\[\r\n\]" $command] { |
600 error "Invalid trailing newline in \"$message\" test" | 654 error "Invalid trailing newline in \"$message\" test" |
601 } | 655 } |
602 | 656 |
603 if [string match "*\[\r\n\]*" $message] { | 657 if [string match "*\[\r\n\]*" $message] { |
604 error "Invalid newline in \"$message\" test" | 658 error "Invalid newline in \"$message\" test" |
605 } | 659 } |
606 | 660 |
607 if {$use_gdb_stub | 661 if {$use_gdb_stub |
608 && [regexp -nocase {^\s*(r|run|star|start|at|att|atta|attac|attach)\M} \ | 662 » && [regexp -nocase {^\s*(r|run|star|start|at|att|atta|attac|attach)\M} \ |
609 $command]} { | 663 $command]} { |
610 error "gdbserver does not support $command without extended-remote" | 664 error "gdbserver does not support $command without extended-remote" |
611 } | 665 } |
612 | 666 |
613 # TCL/EXPECT WART ALERT | 667 # TCL/EXPECT WART ALERT |
614 # Expect does something very strange when it receives a single braced | 668 # Expect does something very strange when it receives a single braced |
615 # argument. It splits it along word separators and performs substitutions. | 669 # argument. It splits it along word separators and performs substitutions. |
616 # This means that { "[ab]" } is evaluated as "[ab]", but { "\[ab\]" } is | 670 # This means that { "[ab]" } is evaluated as "[ab]", but { "\[ab\]" } is |
617 # evaluated as "\[ab\]". But that's not how TCL normally works; inside a | 671 # evaluated as "\[ab\]". But that's not how TCL normally works; inside a |
618 # double-quoted list item, "\[ab\]" is just a long way of representing | 672 # double-quoted list item, "\[ab\]" is just a long way of representing |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 global timeout; | 792 global timeout; |
739 if [info exists timeout] { | 793 if [info exists timeout] { |
740 set tmt $timeout; | 794 set tmt $timeout; |
741 } else { | 795 } else { |
742 set tmt 60; | 796 set tmt 60; |
743 } | 797 } |
744 } | 798 } |
745 } | 799 } |
746 | 800 |
747 set code { | 801 set code { |
748 -re ".*A problem internal to GDB has been detected" { | 802 » -re ".*A problem internal to GDB has been detected" { |
749 fail "$message (GDB internal error)" | 803 » fail "$message (GDB internal error)" |
750 gdb_internal_error_resync | 804 » gdb_internal_error_resync |
751 } | 805 » } |
752 » -re "\\*\\*\\* DOSEXIT code.*" { | 806 » -re "\\*\\*\\* DOSEXIT code.*" { |
753 » if { $message != "" } { | 807 » if { $message != "" } { |
754 » » fail "$message"; | 808 » » fail "$message"; |
755 » } | 809 » } |
756 » gdb_suppress_entire_file "GDB died"; | 810 » gdb_suppress_entire_file "GDB died"; |
757 » set result -1; | 811 » set result -1; |
758 » } | 812 » } |
759 } | 813 } |
760 append code $processed_code | 814 append code $processed_code |
761 append code { | 815 append code { |
762 » -re "Ending remote debugging.*$gdb_prompt $" { | 816 » -re "Ending remote debugging.*$gdb_prompt $" { |
763 if ![isnative] then { | 817 if ![isnative] then { |
764 warning "Can`t communicate to remote target." | 818 warning "Can`t communicate to remote target." |
765 } | 819 } |
766 gdb_exit | 820 gdb_exit |
767 gdb_start | 821 gdb_start |
768 set result -1 | 822 set result -1 |
769 } | 823 } |
770 » -re "Undefined\[a-z\]* command:.*$gdb_prompt $" { | 824 » -re "Undefined\[a-z\]* command:.*$gdb_prompt $" { |
771 perror "Undefined command \"$command\"." | 825 perror "Undefined command \"$command\"." |
772 fail "$message" | 826 » fail "$message" |
773 set result 1 | 827 set result 1 |
774 } | 828 } |
775 » -re "Ambiguous command.*$gdb_prompt $" { | 829 » -re "Ambiguous command.*$gdb_prompt $" { |
776 perror "\"$command\" is not a unique command name." | 830 perror "\"$command\" is not a unique command name." |
777 fail "$message" | 831 » fail "$message" |
778 set result 1 | 832 set result 1 |
779 } | 833 } |
780 » -re "$inferior_exited_re with code \[0-9\]+.*$gdb_prompt $" { | 834 » -re "$inferior_exited_re with code \[0-9\]+.*$gdb_prompt $" { |
781 if ![string match "" $message] then { | 835 if ![string match "" $message] then { |
782 set errmsg "$message (the program exited)" | 836 set errmsg "$message (the program exited)" |
783 } else { | 837 } else { |
784 set errmsg "$command (the program exited)" | 838 set errmsg "$command (the program exited)" |
785 } | 839 } |
786 fail "$errmsg" | 840 fail "$errmsg" |
787 set result -1 | 841 set result -1 |
788 } | 842 } |
789 » -re "$inferior_exited_re normally.*$gdb_prompt $" { | 843 » -re "$inferior_exited_re normally.*$gdb_prompt $" { |
790 if ![string match "" $message] then { | 844 if ![string match "" $message] then { |
791 set errmsg "$message (the program exited)" | 845 set errmsg "$message (the program exited)" |
792 } else { | 846 } else { |
793 set errmsg "$command (the program exited)" | 847 set errmsg "$command (the program exited)" |
794 } | 848 } |
795 fail "$errmsg" | 849 fail "$errmsg" |
796 set result -1 | 850 set result -1 |
797 } | 851 } |
798 » -re "The program is not being run.*$gdb_prompt $" { | 852 » -re "The program is not being run.*$gdb_prompt $" { |
799 if ![string match "" $message] then { | 853 if ![string match "" $message] then { |
800 set errmsg "$message (the program is no longer running)" | 854 set errmsg "$message (the program is no longer running)" |
801 } else { | 855 } else { |
802 set errmsg "$command (the program is no longer running)" | 856 set errmsg "$command (the program is no longer running)" |
803 } | 857 } |
804 fail "$errmsg" | 858 fail "$errmsg" |
805 set result -1 | 859 set result -1 |
806 } | 860 } |
807 » -re "\r\n$gdb_prompt $" { | 861 » -re "\r\n$gdb_prompt $" { |
808 if ![string match "" $message] then { | 862 if ![string match "" $message] then { |
809 fail "$message" | 863 fail "$message" |
810 } | 864 } |
811 set result 1 | 865 set result 1 |
812 } | 866 } |
813 » "<return>" { | 867 » "<return>" { |
814 send_gdb "\n" | 868 send_gdb "\n" |
815 perror "Window too small." | 869 perror "Window too small." |
816 fail "$message" | 870 » fail "$message" |
817 set result -1 | 871 set result -1 |
818 } | 872 } |
819 -re "\\((y or n|y or \\\[n\\\]|\\\[y\\\] or n)\\) " { | 873 -re "\\((y or n|y or \\\[n\\\]|\\\[y\\\] or n)\\) " { |
820 send_gdb "n\n" | 874 send_gdb "n\n" |
821 gdb_expect -re "$gdb_prompt $" | 875 gdb_expect -re "$gdb_prompt $" |
822 fail "$message (got interactive prompt)" | 876 fail "$message (got interactive prompt)" |
823 set result -1 | 877 set result -1 |
824 } | 878 } |
825 -re "\\\[0\\\] cancel\r\n\\\[1\\\] all.*\r\n> $" { | 879 -re "\\\[0\\\] cancel\r\n\\\[1\\\] all.*\r\n> $" { |
826 send_gdb "0\n" | 880 send_gdb "0\n" |
827 gdb_expect -re "$gdb_prompt $" | 881 gdb_expect -re "$gdb_prompt $" |
828 fail "$message (got breakpoint menu)" | 882 fail "$message (got breakpoint menu)" |
829 set result -1 | 883 set result -1 |
830 } | 884 } |
831 » eof { | 885 » eof { |
832 » perror "Process no longer exists" | 886 » perror "Process no longer exists" |
833 » if { $message != "" } { | 887 » if { $message != "" } { |
834 » » fail "$message" | 888 » » fail "$message" |
835 » } | 889 » } |
836 » return -1 | 890 » return -1 |
837 } | 891 } |
838 » full_buffer { | 892 » full_buffer { |
839 perror "internal buffer is full." | 893 perror "internal buffer is full." |
840 fail "$message" | 894 » fail "$message" |
841 set result -1 | 895 set result -1 |
842 } | 896 } |
843 timeout { | 897 timeout { |
844 if ![string match "" $message] then { | 898 if ![string match "" $message] then { |
845 fail "$message (timeout)" | 899 fail "$message (timeout)" |
846 } | 900 } |
847 set result 1 | 901 set result 1 |
848 } | 902 } |
849 } | 903 } |
850 | 904 |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 | 1502 |
1449 return [skip_cplus_tests] | 1503 return [skip_cplus_tests] |
1450 } | 1504 } |
1451 | 1505 |
1452 # Return a 1 if I don't even want to try to test FORTRAN. | 1506 # Return a 1 if I don't even want to try to test FORTRAN. |
1453 | 1507 |
1454 proc skip_fortran_tests {} { | 1508 proc skip_fortran_tests {} { |
1455 return 0 | 1509 return 0 |
1456 } | 1510 } |
1457 | 1511 |
error: old chunk mismatch |
None
OLD | NEW |