aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi/mi-pthreads.exp
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2002-09-25 16:08:43 +0000
committerKeith Seitz <keiths@redhat.com>2002-09-25 16:08:43 +0000
commit1154261b1f314f5bf6cf880256620aa9f376969d (patch)
tree5ed0bdd90551394c45fca09e207039c9237157a8 /gdb/testsuite/gdb.mi/mi-pthreads.exp
parent512217c7cc9c53b112f1a6ac78e85006eafe9ed3 (diff)
downloadbinutils-1154261b1f314f5bf6cf880256620aa9f376969d.zip
binutils-1154261b1f314f5bf6cf880256620aa9f376969d.tar.gz
binutils-1154261b1f314f5bf6cf880256620aa9f376969d.tar.bz2
* mi-pthreads.exp (get_mi_thread_list): Check if expect_out
exists before using it. (check_mi_and_console_threads): Likewise. * gdb669.exp (get_mi_thread_list): Likewise. (check_mi_and_console_threads): Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-pthreads.exp')
-rw-r--r--gdb/testsuite/gdb.mi/mi-pthreads.exp17
1 files changed, 14 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-pthreads.exp b/gdb/testsuite/gdb.mi/mi-pthreads.exp
index 900df9b..a26d434 100644
--- a/gdb/testsuite/gdb.mi/mi-pthreads.exp
+++ b/gdb/testsuite/gdb.mi/mi-pthreads.exp
@@ -52,8 +52,13 @@ proc get_mi_thread_list {name} {
{\^done,thread-ids={(thread-id="[0-9]+"(,)?)+},number-of-threads="[0-9]+"} \
"-thread_list_ids ($name)"
+ set output {}
+ if {[info exists expect_out(buffer)]} {
+ set output $expect_out(buffer)
+ }
+
set thread_list {}
- if {![regexp {thread-ids=\{(thread-id="[0-9]+"(,)?)*\}} $expect_out(buffer) threads]} {
+ if {![regexp {thread-ids=\{(thread-id="[0-9]+"(,)?)*\}} $output threads]} {
fail "finding threads in MI output ($name)"
} else {
pass "finding threads in MI output ($name)"
@@ -80,7 +85,10 @@ proc check_mi_and_console_threads {name} {
mi_gdb_test "-thread-list-ids" \
{\^done,thread-ids={(thread-id="[0-9]+"(,)*)+},number-of-threads="[0-9]+"} \
"-thread-list-ids ($name)"
- set mi_output $expect_out(buffer)
+ set mi_output {}
+ if {[info exists expect_out(buffer)]} {
+ set mi_output $expect_out(buffer)
+ }
# GDB will return a list of thread ids and some more info:
#
@@ -94,7 +102,10 @@ proc check_mi_and_console_threads {name} {
mi_gdb_test "info threads" \
{.*(~".*"[\r\n]*)+.*} \
"info threads ($name)"
- set console_output $expect_out(buffer)
+ set console_output {}
+ if {[info exists $expect_out(buffer)]} {
+ set console_output $expect_out(buffer)
+ }
# Make a list of all known threads to console (gdb's thread IDs)
set console_thread_list {}