-# Copyright 2005, 2007, 2008 Free Software Foundation, Inc.
+# Copyright 2005, 2007-2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
continue
}
-set prms_id 0
-set bug_id 0
set testfile "checkpoint"
set srcfile ${testfile}.c
gdb_breakpoint $break1_loc
gdb_test "continue" "breakpoint 1.*" "break1 start"
-gdb_test "checkpoint" "" ""
+gdb_test "checkpoint" ".*" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 two"
-gdb_test "checkpoint" "" ""
+gdb_test "checkpoint" ".*" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 three"
-gdb_test "checkpoint" "" ""
+gdb_test "checkpoint" ".*" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 four"
-gdb_test "checkpoint" "" ""
+gdb_test "checkpoint" ".*" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 five"
-gdb_test "checkpoint" "" ""
+gdb_test "checkpoint" ".*" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 six"
-gdb_test "checkpoint" "" ""
+gdb_test "checkpoint" ".*" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 seven"
-gdb_test "checkpoint" "" ""
+gdb_test "checkpoint" ".*" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 eight"
-gdb_test "checkpoint" "" ""
+gdb_test "checkpoint" ".*" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 nine"
-gdb_test "checkpoint" "" ""
+gdb_test "checkpoint" ".*" ""
gdb_test "continue 10" "breakpoint 1.*" "break1 ten"
-gdb_test "checkpoint" "" ""
+gdb_test "checkpoint" ".*" ""
gdb_test "info checkpoints" \
" 10 .* 9 .* 8 .* 7 .* 6 .* 5 .* 4 .* 3 .* 2 .* 1 .*" \
gdb_breakpoint $break1_loc
gdb_test "restart 1" "Switching to .*c == EOF.*" "restart 1 two"
-gdb_test "continue" "" ""
+gdb_test "continue" ".*" ""
gdb_test "continue 100" "breakpoint 1.*" "breakpoint 1 1 one"
gdb_test "step" "if .c == EOF.*" "step in 1 two"
gdb_test "print lines" " = 102.*" "verify lines 1 two"
gdb_test "restart 2" "Switching to .*c == EOF.*" "restart 2 two"
-gdb_test "continue" "" ""
+gdb_test "continue" ".*" ""
gdb_test "continue 100" "breakpoint 1.*" "breakpoint 1 2 one"
gdb_test "step" "if .c == EOF.*" "step in 2 two"
gdb_test "print lines" " = 112.*" "verify lines 2 two"
gdb_test "restart 3" "Switching to .*c == EOF.*" "restart 3 two"
-gdb_test "continue" "" ""
+gdb_test "continue" ".*" ""
gdb_test "continue 500" "breakpoint 1.*" "breakpoint 1 3 one"
gdb_test "step" "if .c == EOF.*" "step in 3 two"
gdb_test "print lines" " = 522.*" "verify lines 3 two"
gdb_test "restart 4" "Switching to .*c == EOF.*" "restart 4 two"
-gdb_test "continue" "" ""
+gdb_test "continue" ".*" ""
gdb_test "continue 500" "breakpoint 1.*" "breakpoint 1 4 one"
gdb_test "step" "if .c == EOF.*" "step in 4 two"
gdb_test "print lines" " = 532.*" "verify lines 4 two"
gdb_test "restart 5" "Switching to .*c == EOF.*" "restart 5 two"
-gdb_test "continue" "" ""
+gdb_test "continue" ".*" ""
gdb_test "continue 1000" "breakpoint 1.*" "breakpoint 1 5 one"
gdb_test "step" "if .c == EOF.*" "step in 5 two"
gdb_test "print lines" " = 1042.*" "verify lines 5 two"
gdb_test "restart 6" "Switching to .*c == EOF.*" "restart 6 two"
-gdb_test "continue" "" ""
+gdb_test "continue" ".*" ""
gdb_test "continue 1000" "breakpoint 1.*" "breakpoint 1 6 one"
gdb_test "step" "if .c == EOF.*" "step in 6 two"
gdb_test "print lines" " = 1052.*" "verify lines 5 two"
gdb_test "restart 7" "Switching to .*c == EOF.*" "restart 7 two"
-gdb_test "continue" "" ""
+gdb_test "continue" ".*" ""
gdb_test "continue 1100" "breakpoint 1.*" "breakpoint 1 7 one"
gdb_test "step" "if .c == EOF.*" "step in 7 two"
gdb_test "print lines" " = 1162.*" "verify lines 7 two"
delete_breakpoints
gdb_test "continue" \
- "Deleting copy.*Program exited normally.*Switching to.*" \
+ "Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
"Exit, dropped into next fork one"
gdb_test "continue" \
- "Deleting copy.*Program exited normally.*Switching to.*" \
+ "Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
"Exit, dropped into next fork two"
gdb_test "continue" \
- "Deleting copy.*Program exited normally.*Switching to.*" \
+ "Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
"Exit, dropped into next fork three"
gdb_test "continue" \
- "Deleting copy.*Program exited normally.*Switching to.*" \
+ "Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
"Exit, dropped into next fork four"
gdb_test "continue" \
- "Deleting copy.*Program exited normally.*Switching to.*" \
+ "Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
"Exit, dropped into next fork five"
#
gdb_test "restart 10" "Not found.*" "no more checkpoint 10"
#
-# Now let's try setting a large number of checkpoints (>1000)
+# Now let's try setting a large number of checkpoints (>600)
#
gdb_exit
runto_main
gdb_breakpoint $break1_loc
-send_gdb "commands\n"
-send_gdb " silent\n"
-send_gdb " if (lines % 2)\n"
-send_gdb " checkpoint\n"
-send_gdb " end\n"
-send_gdb " continue\n"
-send_gdb "end\n"
-
-gdb_expect {
- -re ".*$gdb_prompt $" { pass "set checkpoint breakpoint" }
- timeout { fail "(timeout) set checkpoint breakpoint" }
-}
+gdb_test "commands\nsilent\nif (lines % 2)\ncheckpoint\nend\n continue\nend" \
+ "" \
+ "set checkpoint breakpoint"
+
+set prev_timeout $timeout
+set timeout [expr $timeout + 120]
+verbose "Timeout now $timeout sec."
gdb_breakpoint $break2_loc
gdb_test "continue" "breakpoint 2.*" "break2 with many checkpoints"
# OK, kill 'em all...
#
-gdb_test "kill" "" "kill all one" \
+gdb_test "kill" "" "kill all one with many checkpoints" \
"Kill the program being debugged.*y or n. $" "y"
+# Restore old timeout
+set timeout $prev_timeout
+verbose "Timeout now $timeout sec."
+
#
# Finished: cleanup
#