2015-01-01 09:32:14 +00:00
|
|
|
# Copyright 2005-2015 Free Software Foundation, Inc.
|
2006-01-04 19:29:26 +00:00
|
|
|
|
|
|
|
# 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
|
2007-08-23 18:14:19 +00:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
2006-01-04 19:29:26 +00:00
|
|
|
# (at your option) any later version.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
2006-01-04 19:29:26 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
2006-01-04 19:29:26 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-23 18:14:19 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2006-01-04 19:29:26 +00:00
|
|
|
|
2007-04-29 15:48:46 +00:00
|
|
|
if { [is_remote target] || ![isnative] } then {
|
2006-01-04 19:29:26 +00:00
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
# Until "set follow-fork-mode" and "catch fork" are implemented on
|
|
|
|
# other targets...
|
|
|
|
#
|
|
|
|
if {![istarget "*-*-linux*"]} then {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
|
test suite update - gdb.base/[cd]
Convert files gdb.base/[cd]*.exp to use standard_output_file et al.
* call-ar-st.exp, call-rt-st.exp, call-sc.exp,
call-signal-resume.exp, call-strs.exp, callexit.exp,
callfuncs.exp, catch-load.exp, catch-syscall.exp, charset.exp,
checkpoint.exp, chng-syms.exp, code-expr.exp, code_elim.exp,
commands.exp, completion.exp, complex.exp, cond-expr.exp,
condbreak.exp, consecutive.exp, constvars.exp, corefile.exp,
ctxobj.exp, cursal.exp, cvexpr.exp, dbx.exp, default.exp,
define.exp, del.exp, detach.exp, dfp-test.exp, display.exp,
dmsym.exp, dump.exp, dup-sect.exp: Use standard_testfile,
standard_output_file, prepare_for_testing, clean_restart.
2013-06-27 18:49:03 +00:00
|
|
|
standard_testfile .c
|
2006-01-04 19:29:26 +00:00
|
|
|
|
2013-08-23 18:18:27 +00:00
|
|
|
set pi_txt [gdb_remote_download host ${srcdir}/${subdir}/pi.txt]
|
|
|
|
if {[is_remote host]} {
|
|
|
|
set copy1_txt copy1.txt
|
|
|
|
} else {
|
|
|
|
set copy1_txt [standard_output_file copy1.txt]
|
|
|
|
}
|
|
|
|
|
|
|
|
if {[prepare_for_testing ${testfile}.exp $testfile $srcfile \
|
|
|
|
[list debug "additional_flags=-DPI_TXT=\"$pi_txt\" -DCOPY1_TXT=\"$copy1_txt\""]]} {
|
2006-08-10 05:27:22 +00:00
|
|
|
untested checkpoint.exp
|
|
|
|
return -1
|
2006-01-04 19:29:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
global gdb_prompt
|
|
|
|
|
|
|
|
#
|
|
|
|
# This tests gdb checkpoint and restart.
|
|
|
|
#
|
|
|
|
|
|
|
|
runto_main
|
|
|
|
set break1_loc [gdb_get_line_number "breakpoint 1"]
|
|
|
|
set break2_loc [gdb_get_line_number "breakpoint 2"]
|
|
|
|
set break3_loc [gdb_get_line_number "breakpoint 3"]
|
|
|
|
set break4_loc [gdb_get_line_number "breakpoint 4"]
|
|
|
|
|
|
|
|
gdb_breakpoint $break1_loc
|
|
|
|
gdb_test "continue" "breakpoint 1.*" "break1 start"
|
|
|
|
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "checkpoint" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue 10" "breakpoint 1.*" "break1 two"
|
|
|
|
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "checkpoint" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue 10" "breakpoint 1.*" "break1 three"
|
|
|
|
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "checkpoint" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue 10" "breakpoint 1.*" "break1 four"
|
|
|
|
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "checkpoint" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue 10" "breakpoint 1.*" "break1 five"
|
|
|
|
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "checkpoint" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue 10" "breakpoint 1.*" "break1 six"
|
|
|
|
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "checkpoint" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue 10" "breakpoint 1.*" "break1 seven"
|
|
|
|
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "checkpoint" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue 10" "breakpoint 1.*" "break1 eight"
|
|
|
|
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "checkpoint" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue 10" "breakpoint 1.*" "break1 nine"
|
|
|
|
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "checkpoint" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue 10" "breakpoint 1.*" "break1 ten"
|
|
|
|
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "checkpoint" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
|
|
|
|
gdb_test "info checkpoints" \
|
|
|
|
" 10 .* 9 .* 8 .* 7 .* 6 .* 5 .* 4 .* 3 .* 2 .* 1 .*" \
|
|
|
|
"info checkpoints one"
|
|
|
|
|
|
|
|
delete_breakpoints
|
|
|
|
gdb_breakpoint $break2_loc
|
|
|
|
gdb_test "continue" "breakpoint 2.*" "break2 one"
|
|
|
|
|
|
|
|
gdb_test "restart 1" "Switching to .*breakpoint 1.*" "restart 1 one"
|
|
|
|
gdb_test "print i" " = 78" "verify i 1 one"
|
|
|
|
gdb_test "step" "if .c == EOF.*" "step in 1 one"
|
|
|
|
gdb_test "print lines" " = 1.*" "verify lines 1 one"
|
|
|
|
|
|
|
|
gdb_test "restart 2" "Switching to .*breakpoint 1.*" "restart 2 one"
|
|
|
|
gdb_test "step" "if .c == EOF.*" "step in 2 one"
|
|
|
|
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 2 one"
|
|
|
|
gdb_test "print lines" " = 11.*" "verify lines 2 one"
|
|
|
|
|
|
|
|
gdb_test "restart 3" "Switching to .*breakpoint 1.*" "restart 3 one"
|
|
|
|
gdb_test "step" "if .c == EOF.*" "step in 3 one"
|
|
|
|
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 3 one"
|
|
|
|
gdb_test "print lines" " = 21.*" "verify lines 3 one"
|
|
|
|
|
|
|
|
gdb_test "restart 4" "Switching to .*breakpoint 1.*" "restart 4 one"
|
|
|
|
gdb_test "step" "if .c == EOF.*" "step in 4 one"
|
|
|
|
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 4 one"
|
|
|
|
gdb_test "print lines" " = 31.*" "verify lines 4 one"
|
|
|
|
|
|
|
|
gdb_test "restart 5" "Switching to .*breakpoint 1.*" "restart 5 one"
|
|
|
|
gdb_test "step" "if .c == EOF.*" "step in 5 one"
|
|
|
|
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 5 one"
|
|
|
|
gdb_test "print lines" " = 41.*" "verify lines 5 one"
|
|
|
|
|
|
|
|
gdb_test "restart 6" "Switching to .*breakpoint 1.*" "restart 6 one"
|
|
|
|
gdb_test "step" "if .c == EOF.*" "step in 6 one"
|
|
|
|
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 6 one"
|
|
|
|
gdb_test "print lines" " = 51.*" "verify lines 6 one"
|
|
|
|
|
|
|
|
gdb_test "restart 7" "Switching to .*breakpoint 1.*" "restart 7 one"
|
|
|
|
gdb_test "step" "if .c == EOF.*" "step in 7 one"
|
|
|
|
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 7 one"
|
|
|
|
gdb_test "print lines" " = 61.*" "verify lines 7 one"
|
|
|
|
|
|
|
|
gdb_test "restart 8" "Switching to .*breakpoint 1.*" "restart 8 one"
|
|
|
|
gdb_test "step" "if .c == EOF.*" "step in 8 one"
|
|
|
|
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 8 one"
|
|
|
|
gdb_test "print lines" " = 71.*" "verify lines 8 one"
|
|
|
|
|
|
|
|
gdb_test "restart 9" "Switching to .*breakpoint 1.*" "restart 9 one"
|
|
|
|
gdb_test "step" "if .c == EOF.*" "step in 9 one"
|
|
|
|
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 9 one"
|
|
|
|
gdb_test "print lines" " = 81.*" "verify lines 9 one"
|
|
|
|
|
|
|
|
gdb_test "restart 10" "Switching to .*breakpoint 1.*" "restart 10 one"
|
|
|
|
gdb_test "step" "if .c == EOF.*" "step in 10 one"
|
|
|
|
gdb_test "print i + 1 == lines * 79" " = 1" "verify i 10 one"
|
|
|
|
gdb_test "print lines" " = 91.*" "verify lines 10 one"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Now let the files be closed by the original process,
|
|
|
|
# and diff them.
|
|
|
|
|
|
|
|
gdb_test "restart 0" "Switching to .*breakpoint 2.*" "restart 0 one"
|
|
|
|
gdb_breakpoint $break3_loc
|
|
|
|
gdb_test "continue" "breakpoint 3.*" "break3 one"
|
|
|
|
|
2013-08-23 18:18:27 +00:00
|
|
|
gdb_test "shell diff -s $pi_txt $copy1_txt" \
|
|
|
|
"Files .*pi.txt and .*copy1.txt are identical.*" \
|
2006-01-04 19:29:26 +00:00
|
|
|
"Diff input and output one"
|
|
|
|
|
|
|
|
#
|
|
|
|
# And now run from various checkpoints, allowing
|
|
|
|
# various amounts of input and output.
|
|
|
|
#
|
|
|
|
|
|
|
|
gdb_breakpoint $break1_loc
|
|
|
|
|
|
|
|
gdb_test "restart 1" "Switching to .*c == EOF.*" "restart 1 two"
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "continue" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
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"
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "continue" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
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"
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "continue" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
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"
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "continue" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
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"
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "continue" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
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"
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "continue" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
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"
|
2010-06-08 22:58:03 +00:00
|
|
|
gdb_test "continue" ".*" ""
|
2006-01-04 19:29:26 +00:00
|
|
|
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"
|
|
|
|
|
2013-08-23 18:18:27 +00:00
|
|
|
gdb_test "shell diff -s $pi_txt $copy1_txt" \
|
|
|
|
"Files .*pi.txt and .*copy1.txt are identical.*" \
|
2006-01-04 19:29:26 +00:00
|
|
|
"Diff input and output two"
|
|
|
|
|
|
|
|
#
|
|
|
|
# OK, now allow the original program to delete the output file,
|
|
|
|
# and verify that the checkpoints can still write to it.
|
|
|
|
#
|
|
|
|
|
|
|
|
gdb_test "restart 0" "Switching to .*breakpoint 3.*" "restart 0 one"
|
|
|
|
gdb_breakpoint $break4_loc
|
|
|
|
gdb_test "continue" "breakpoint 4.*" "break4 one"
|
|
|
|
|
2013-08-23 18:18:27 +00:00
|
|
|
gdb_test "shell diff $pi_txt $copy1_txt" \
|
|
|
|
"diff: .*copy1.txt: No such file or directory" \
|
2006-01-04 19:29:26 +00:00
|
|
|
"delete copy1"
|
|
|
|
|
|
|
|
delete_breakpoints
|
|
|
|
gdb_breakpoint $break2_loc
|
|
|
|
|
|
|
|
gdb_test "restart 1" "if .c == EOF.*" "restart 1 three"
|
|
|
|
gdb_test "continue" "breakpoint 2.*" "break2 1 one"
|
|
|
|
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 1"
|
|
|
|
|
2013-01-18 10:50:15 +00:00
|
|
|
gdb_test "restart 2" "if .c == EOF.*" "restart 2 three"
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue" "breakpoint 2.*" "break2 2 one"
|
|
|
|
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 2"
|
|
|
|
|
2013-01-18 10:50:15 +00:00
|
|
|
gdb_test "restart 3" "if .c == EOF.*" "restart 3 three"
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue" "breakpoint 2.*" "break2 3 one"
|
|
|
|
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 3"
|
|
|
|
|
2013-01-18 10:50:15 +00:00
|
|
|
gdb_test "restart 4" "if .c == EOF.*" "restart 4 three"
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue" "breakpoint 2.*" "break2 4 one"
|
|
|
|
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 4"
|
|
|
|
|
2013-01-18 10:50:15 +00:00
|
|
|
gdb_test "restart 5" "if .c == EOF.*" "restart 5 three"
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue" "breakpoint 2.*" "break2 5 one"
|
|
|
|
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 5"
|
|
|
|
|
2013-01-18 10:50:15 +00:00
|
|
|
gdb_test "restart 6" "if .c == EOF.*" "restart 6 three"
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue" "breakpoint 2.*" "break2 6 one"
|
|
|
|
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 6"
|
|
|
|
|
2013-01-18 10:50:15 +00:00
|
|
|
gdb_test "restart 7" "if .c == EOF.*" "restart 7 three"
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue" "breakpoint 2.*" "break2 7 one"
|
|
|
|
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 7"
|
|
|
|
|
2013-01-18 10:50:15 +00:00
|
|
|
gdb_test "restart 8" "if .c == EOF.*" "restart 8 three"
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue" "breakpoint 2.*" "break2 8 one"
|
|
|
|
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 8"
|
|
|
|
|
2013-01-18 10:50:15 +00:00
|
|
|
gdb_test "restart 9" "if .c == EOF.*" "restart 9 three"
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue" "breakpoint 2.*" "break2 9 one"
|
|
|
|
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 9"
|
|
|
|
|
2013-01-18 10:50:15 +00:00
|
|
|
gdb_test "restart 10" "if .c == EOF.*" "restart 10 three"
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_test "continue" "breakpoint 2.*" "break2 10 one"
|
|
|
|
gdb_test "print ftell (out) > 100000" " = 1.*" "outfile still open 10"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Now confirm that if one fork exits, we automatically switch to another one.
|
|
|
|
#
|
|
|
|
|
|
|
|
delete_breakpoints
|
|
|
|
gdb_test "continue" \
|
2011-03-07 16:03:04 +00:00
|
|
|
"Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
|
2006-01-04 19:29:26 +00:00
|
|
|
"Exit, dropped into next fork one"
|
|
|
|
|
|
|
|
gdb_test "continue" \
|
2011-03-07 16:03:04 +00:00
|
|
|
"Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
|
2006-01-04 19:29:26 +00:00
|
|
|
"Exit, dropped into next fork two"
|
|
|
|
|
|
|
|
gdb_test "continue" \
|
2011-03-07 16:03:04 +00:00
|
|
|
"Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
|
2006-01-04 19:29:26 +00:00
|
|
|
"Exit, dropped into next fork three"
|
|
|
|
|
|
|
|
gdb_test "continue" \
|
2011-03-07 16:03:04 +00:00
|
|
|
"Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
|
2006-01-04 19:29:26 +00:00
|
|
|
"Exit, dropped into next fork four"
|
|
|
|
|
|
|
|
gdb_test "continue" \
|
2011-03-07 16:03:04 +00:00
|
|
|
"Deleting copy.*$inferior_exited_re normally.*Switching to.*" \
|
2006-01-04 19:29:26 +00:00
|
|
|
"Exit, dropped into next fork five"
|
|
|
|
|
|
|
|
#
|
|
|
|
# There should be still at least five forks left
|
|
|
|
#
|
|
|
|
|
|
|
|
gdb_test "info checkpoints" " 5 .* 4 .* 3 .* 2 .* 1 .*" \
|
|
|
|
"info checkpoints two"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Kill should now terminate all of them.
|
|
|
|
#
|
|
|
|
|
|
|
|
gdb_test "kill" "" "kill all one" \
|
|
|
|
"Kill the program being debugged.*y or n. $" "y"
|
|
|
|
|
|
|
|
#
|
|
|
|
# and confirm that all are gone
|
|
|
|
#
|
|
|
|
|
|
|
|
gdb_test "restart 0" "Not found.*" "no more checkpoint 0"
|
|
|
|
gdb_test "restart 1" "Not found.*" "no more checkpoint 1"
|
|
|
|
gdb_test "restart 2" "Not found.*" "no more checkpoint 2"
|
|
|
|
gdb_test "restart 3" "Not found.*" "no more checkpoint 3"
|
|
|
|
gdb_test "restart 4" "Not found.*" "no more checkpoint 4"
|
|
|
|
gdb_test "restart 5" "Not found.*" "no more checkpoint 5"
|
|
|
|
gdb_test "restart 6" "Not found.*" "no more checkpoint 6"
|
|
|
|
gdb_test "restart 7" "Not found.*" "no more checkpoint 7"
|
|
|
|
gdb_test "restart 8" "Not found.*" "no more checkpoint 8"
|
|
|
|
gdb_test "restart 9" "Not found.*" "no more checkpoint 9"
|
|
|
|
gdb_test "restart 10" "Not found.*" "no more checkpoint 10"
|
|
|
|
|
|
|
|
#
|
2010-03-11 00:20:29 +00:00
|
|
|
# Now let's try setting a large number of checkpoints (>600)
|
2006-01-04 19:29:26 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
gdb_start
|
|
|
|
gdb_reinitialize_dir $srcdir/$subdir
|
|
|
|
gdb_load ${binfile}
|
|
|
|
|
|
|
|
runto_main
|
|
|
|
gdb_breakpoint $break1_loc
|
|
|
|
|
2010-05-24 22:03:59 +00:00
|
|
|
gdb_test "commands\nsilent\nif (lines % 2)\ncheckpoint\nend\n continue\nend" \
|
|
|
|
"" \
|
|
|
|
"set checkpoint breakpoint"
|
2006-01-04 19:29:26 +00:00
|
|
|
|
2010-03-11 00:20:29 +00:00
|
|
|
set prev_timeout $timeout
|
|
|
|
set timeout [expr $timeout + 120]
|
|
|
|
verbose "Timeout now $timeout sec."
|
|
|
|
|
2006-01-04 19:29:26 +00:00
|
|
|
gdb_breakpoint $break2_loc
|
|
|
|
gdb_test "continue" "breakpoint 2.*" "break2 with many checkpoints"
|
|
|
|
|
2007-03-09 15:20:16 +00:00
|
|
|
set count 0
|
|
|
|
set msg "info checkpoints with at least 600 checkpoints"
|
|
|
|
gdb_test_multiple "info checkpoints" $msg {
|
|
|
|
-re " $decimal process \[^\r\]*\r\n" {
|
|
|
|
incr count
|
|
|
|
exp_continue
|
|
|
|
}
|
|
|
|
-re "$gdb_prompt $" {
|
|
|
|
if { $count >= 600 } {
|
|
|
|
pass $msg
|
|
|
|
} else {
|
|
|
|
fail $msg
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-01-04 19:29:26 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# OK, kill 'em all...
|
|
|
|
#
|
|
|
|
|
2010-03-11 00:20:29 +00:00
|
|
|
gdb_test "kill" "" "kill all one with many checkpoints" \
|
2006-01-04 19:29:26 +00:00
|
|
|
"Kill the program being debugged.*y or n. $" "y"
|
|
|
|
|
2010-03-11 00:20:29 +00:00
|
|
|
# Restore old timeout
|
|
|
|
set timeout $prev_timeout
|
|
|
|
verbose "Timeout now $timeout sec."
|
|
|
|
|
2006-01-04 19:29:26 +00:00
|
|
|
#
|
|
|
|
# Finished: cleanup
|
|
|
|
#
|