diff options
author | Daniel Jacobowitz <drow@false.org> | 2007-06-12 14:44:15 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2007-06-12 14:44:15 +0000 |
commit | 4339e69e64f47a31e706ba9c1e7c00945c1620ff (patch) | |
tree | 3fe6fc9714782376d4082a2c33a569d6c30158e0 /gdb/testsuite/gdb.threads | |
parent | 0e7f50da78982a93a4603cddbb2e0c07019e9c1a (diff) | |
download | gdb-4339e69e64f47a31e706ba9c1e7c00945c1620ff.zip gdb-4339e69e64f47a31e706ba9c1e7c00945c1620ff.tar.gz gdb-4339e69e64f47a31e706ba9c1e7c00945c1620ff.tar.bz2 |
* gdb.threads/manythreads.exp: Prevent expect buffer overflow
in info threads output.
Diffstat (limited to 'gdb/testsuite/gdb.threads')
-rw-r--r-- | gdb/testsuite/gdb.threads/manythreads.exp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.threads/manythreads.exp b/gdb/testsuite/gdb.threads/manythreads.exp index 903a3b1..0ceacf5 100644 --- a/gdb/testsuite/gdb.threads/manythreads.exp +++ b/gdb/testsuite/gdb.threads/manythreads.exp @@ -81,7 +81,25 @@ gdb_test_multiple "" "stop threads 1" { } } -gdb_test "info threads" ".*1 Thread .*" +set cmd "info threads" +set ok 0 +gdb_test_multiple $cmd $cmd { + -re " 1 Thread " { + set ok 1 + exp_continue + } + -re ".*\r\n" { + # Eat this line and continue, to prevent the buffer overflowing. + exp_continue + } + -re "$gdb_prompt $" { + if { $ok } { + pass $cmd + } else { + fail $cmd + } + } +} set message "second continue" gdb_test_multiple "continue" "second continue" { |