* mi-pthreads.exp (get_mi_thread_list): Check if expect_out
authorKeith Seitz <keiths@redhat.com>
Wed, 25 Sep 2002 16:08:43 +0000 (16:08 +0000)
committerKeith Seitz <keiths@redhat.com>
Wed, 25 Sep 2002 16:08:43 +0000 (16:08 +0000)
        exists before using it.
        (check_mi_and_console_threads): Likewise.
        * gdb669.exp (get_mi_thread_list): Likewise.
        (check_mi_and_console_threads): Likewise.

gdb/testsuite/gdb.mi/ChangeLog
gdb/testsuite/gdb.mi/gdb669.exp
gdb/testsuite/gdb.mi/mi-pthreads.exp

index 3deddd7621dcd6db0a30ee4fc9121166f8efdf02..eb9420b44f56128de3813f7575d582931b5fb9aa 100644 (file)
@@ -1,3 +1,11 @@
+2002-09-25  Keith Seitz  <keiths@redhat.com>
+
+       * 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.
+
 2002-09-24  Keith Seitz  <keiths@redhat.com>
 
        * configure.in: Add config header.
index e8c648131675bec3cbb21f48d84cad3df5d2dac2..4f294b964ea5d70663649be5e92ec5b327c725f3 100644 (file)
@@ -49,8 +49,12 @@ 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)"
@@ -77,7 +81,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:
   #
@@ -91,7 +98,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 {}
index 900df9bdfb5f4bd2753faeae3339f4ae623bf128..a26d434758cec31fbfee4dc11c4483c2d1102b4a 100644 (file)
@@ -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 {}