[commit] Fix checkpoint.exp buffer overflow

Daniel Jacobowitz
2007-03-09T15:21:21Z

Related to Ulrich's fix for all-registers yesterday; this should
prevent expect internal errors during checkpoint.exp. I haven't seen
one since I started testing the patch.

--
Daniel Jacobowitz
CodeSourcery

2007-03-09 Daniel Jacobowitz <dan@codesourcery.com>

* gdb.base/checkpoint.exp: Rewrite 600 checkpoint test to
collect output incrementally.

Index: checkpoint.exp
===================================================================
RCS file: /home/gcc/repos/src/src/gdb/testsuite/gdb.base/checkpoint.exp,v
retrieving revision 1.4
diff -u -p -r1.4 checkpoint.exp
--- checkpoint.exp 9 Jan 2007 17:59:09 -0000 1.4
+++ checkpoint.exp 9 Mar 2007 13:25:11 -0000
@@ -359,8 +359,21 @@ gdb_expect {
gdb_breakpoint $break2_loc
gdb_test "continue" "breakpoint 2.*" "break2 with many checkpoints"

-gdb_test "info checkpoints" " 600 .* 0 .*" \
- "info checkpoints with at least 600 checkpoints"
+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
+ }
+ }
+}

#
# OK, kill 'em all...