This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix MI thread-related tests


Pedro has noticed that there are failures in MI tests when testing against
gdbserver. The reason was that with remote target, -thread-list-ids, or
any other command needing thread list, will actually query the remote side.
This is in contrast with linux native, where new threads are noted immediately
when created. As result, on remote, we can get some "New thread" messages as
result of -thread-list-id, which the tests were not prepared for. Also, the
functions for getting thread lists were duplicated, or, rather thriceplicated,
in GDB codebase, and worse, had one-character difference. This patch fixes
all that. Checked in.

- Volodya

Index: gdb/testsuite/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v
retrieving revision 1.1692
diff -u -p -r1.1692 ChangeLog
--- gdb/testsuite/ChangeLog	28 Jul 2008 20:05:58 -0000	1.1692
+++ gdb/testsuite/ChangeLog	30 Jul 2008 17:08:03 -0000
@@ -1,3 +1,12 @@
+2008-07-30  Vladimir Prus  <vladimir@codesourcery.com>
+
+	* lib/mi-support.exp (get_mi_thread_list)
+	(check_mi_and_console_threads): New, moved from ...
+	* gdb.mi/mi-pthread.exp: ...here.
+	* gdb.mi/gdb669.exp (get_mi_thread_list)
+	(check_mi_and_console_threads): Delete.
+	* gdb.mi/mi2-pthread.exp: Likewise.
+
 2008-07-28  Tom Tromey  <tromey@redhat.com>
 
 	* Makefile.in (just-check): Remove.  Move body to...
Index: gdb/testsuite/gdb.mi/gdb669.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/gdb669.exp,v
retrieving revision 1.9
diff -u -p -r1.9 gdb669.exp
--- gdb/testsuite/gdb.mi/gdb669.exp	1 Jan 2008 22:53:20 -0000	1.9
+++ gdb/testsuite/gdb.mi/gdb669.exp	30 Jul 2008 17:08:03 -0000
@@ -33,143 +33,6 @@ if {[mi_gdb_start]} {
     continue
 }
 
-# The procs below are all stolen from mi-pthreads.exp. Any updates
-# should also be made to the procs there.
-
-proc get_mi_thread_list {name} {
-  global expect_out
-
-  # MI will return a list of thread ids:
-  #
-  # -thread-list-ids
-  # ^done,thread-ids=[thread-id="1",thread-id="2",...],number-of-threads="N"
-  # (gdb)
-  mi_gdb_test "-thread-list-ids" \
-    {\^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]+"(,)?)*\}} $output threads]} {
-    fail "finding threads in MI output ($name)"
-  } else {
-    pass "finding threads in MI output ($name)"
-
-    # Make list of console threads
-    set start [expr {[string first \{ $threads] + 1}]
-    set end   [expr {[string first \} $threads] - 1}]
-    set threads [string range $threads $start $end]
-    foreach thread [split $threads ,] {
-      if {[scan $thread {thread-id="%d"} num]} {
-	lappend thread_list $num
-      }
-    }
-  }
-
-  return $thread_list
-}
-
-# Check that MI and the console know of the same threads.
-# Appends NAME to all test names.
-proc check_mi_and_console_threads {name} {
-  global expect_out
-
-  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 {}
-  if {[info exists expect_out(buffer)]} {
-    set mi_output $expect_out(buffer)
-  }
-
-  # GDB will return a list of thread ids and some more info:
-  #
-  # (gdb) 
-  # -interpreter-exec console "info threads"
-  # ~"  4 Thread 2051 (LWP 7734)  0x401166b1 in __libc_nanosleep () at __libc_nanosleep:-1"
-  # ~"  3 Thread 1026 (LWP 7733)   () at __libc_nanosleep:-1"
-  # ~"  2 Thread 2049 (LWP 7732)  0x401411f8 in __poll (fds=0x804bb24, nfds=1, timeout=2000) at ../sysdeps/unix/sysv/linux/poll.c:63"
-  # ~"* 1 Thread 1024 (LWP 7731)  main (argc=1, argv=0xbfffdd94) at ../../../src/gdb/testsuite/gdb.mi/pthreads.c:160"
-  # FIXME: kseitz/2002-09-05: Don't use the hack-cli method.
-  mi_gdb_test "info threads" \
-    {.*(~".*"[\r\n]*)+.*} \
-    "info threads ($name)"
-  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 {}
-  foreach line [split $console_output \n] {
-    if {[string index $line 0] == "~"} {
-      # This is a line from the console; trim off "~", " ", "*", and "\""
-      set line [string trim $line ~\ \"\*]
-      if {[scan $line "%d" id] == 1} {
-	lappend console_thread_list $id
-      }
-    }
-  }
-
-  # Now find the result string from MI
-  set mi_result ""
-  foreach line [split $mi_output \n] {
-    if {[string range $line 0 4] == "^done"} {
-      set mi_result $line
-    }
-  }
-  if {$mi_result == ""} {
-    fail "finding MI result string ($name)"
-  } else {
-    pass "finding MI result string ($name)"
-  }
-
-  # Finally, extract the thread ids and compare them to the console
-  set num_mi_threads_str ""
-  if {![regexp {number-of-threads="[0-9]+"} $mi_result num_mi_threads_str]} {
-    fail "finding number of threads in MI output ($name)"
-  } else {
-    pass "finding number of threads in MI output ($name)"
-
-    # Extract the number of threads from the MI result
-    if {![scan $num_mi_threads_str {number-of-threads="%d"} num_mi_threads]} {
-      fail "got number of threads from MI ($name)"
-    } else {
-      pass "got number of threads from MI ($name)"
-
-      # Check if MI and console have same number of threads
-      if {$num_mi_threads != [llength $console_thread_list]} {
-	fail "console and MI have same number of threads ($name)"
-      } else {
-	pass "console and MI have same number of threads ($name)"
-
-	# Get MI thread list
-	set mi_thread_list [get_mi_thread_list $name]
-
-	# Check if MI and console have the same threads
-	set fails 0
-	foreach ct [lsort $console_thread_list] mt [lsort $mi_thread_list] {
-	  if {$ct != $mt} {
-	    incr fails
-	  }
-	}
-	if {$fails > 0} {
-	  fail "MI and console have same threads ($name)"
-
-	  # Send a list of failures to the log
-	  send_log "Console has thread ids: $console_thread_list\n"
-	  send_log "MI has thread ids: $mi_thread_list\n"
-	} else {
-	  pass "MI and console have same threads ($name)"
-	}
-      }
-    }
-  }
-}
-
 #
 # Start here
 #
Index: gdb/testsuite/gdb.mi/mi-pthreads.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-pthreads.exp,v
retrieving revision 1.11
diff -u -p -r1.11 mi-pthreads.exp
--- gdb/testsuite/gdb.mi/mi-pthreads.exp	1 Jan 2008 22:53:20 -0000	1.11
+++ gdb/testsuite/gdb.mi/mi-pthreads.exp	30 Jul 2008 17:08:03 -0000
@@ -35,145 +35,6 @@ if {[mi_gdb_start]} {
     continue
 }
 
-# The procs below dealing with parsing cli/mi output for the threadlist
-# is duplicated in gdb669.exp. Any changes here will probably need to
-# be made there as well.
-
-proc get_mi_thread_list {name} {
-  global expect_out
-
-  # MI will return a list of thread ids:
-  #
-  # -thread-list-ids
-  # ^done,thread-ids=[thread-id="1",thread-id="2",...],number-of-threads="N"
-  # (gdb)
-  mi_gdb_test "-thread-list-ids" \
-    {\^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]+"(,)?)*\}} $output threads]} {
-    fail "finding threads in MI output ($name)"
-  } else {
-    pass "finding threads in MI output ($name)"
-
-    # Make list of console threads
-    set start [expr {[string first \{ $threads] + 1}]
-    set end   [expr {[string first \} $threads] - 1}]
-    set threads [string range $threads $start $end]
-    foreach thread [split $threads ,] {
-      if {[scan $thread {thread-id="%d"} num]} {
-	lappend thread_list $num
-      }
-    }
-  }
-
-  return $thread_list
-}
-
-# Check that MI and the console know of the same threads.
-# Appends NAME to all test names.
-proc check_mi_and_console_threads {name} {
-  global expect_out
-
-  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 {}
-  if {[info exists expect_out(buffer)]} {
-    set mi_output $expect_out(buffer)
-  }
-
-  # GDB will return a list of thread ids and some more info:
-  #
-  # (gdb) 
-  # -interpreter-exec console "info threads"
-  # ~"  4 Thread 2051 (LWP 7734)  0x401166b1 in __libc_nanosleep () at __libc_nanosleep:-1"
-  # ~"  3 Thread 1026 (LWP 7733)   () at __libc_nanosleep:-1"
-  # ~"  2 Thread 2049 (LWP 7732)  0x401411f8 in __poll (fds=0x804bb24, nfds=1, timeout=2000) at ../sysdeps/unix/sysv/linux/poll.c:63"
-  # ~"* 1 Thread 1024 (LWP 7731)  main (argc=1, argv=0xbfffdd94) at ../../../src/gdb/testsuite/gdb.mi/pthreads.c:160"
-  # FIXME: kseitz/2002-09-05: Don't use the hack-cli method.
-  mi_gdb_test "info threads" \
-    {.*(~".*"[\r\n]*)+.*} \
-    "info threads ($name)"
-  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 {}
-  foreach line [split $console_output \n] {
-    if {[string index $line 0] == "~"} {
-      # This is a line from the console; trim off "~", " ", "*", and "\""
-      set line [string trim $line ~\ \"\*]
-      if {[scan $line "%d" id] == 1} {
-	lappend console_thread_list $id
-      }
-    }
-  }
-
-  # Now find the result string from MI
-  set mi_result ""
-  foreach line [split $mi_output \n] {
-    if {[string range $line 0 4] == "^done"} {
-      set mi_result $line
-    }
-  }
-  if {$mi_result == ""} {
-    fail "finding MI result string ($name)"
-  } else {
-    pass "finding MI result string ($name)"
-  }
-
-  # Finally, extract the thread ids and compare them to the console
-  set num_mi_threads_str ""
-  if {![regexp {number-of-threads="[0-9]+"} $mi_result num_mi_threads_str]} {
-    fail "finding number of threads in MI output ($name)"
-  } else {
-    pass "finding number of threads in MI output ($name)"
-
-    # Extract the number of threads from the MI result
-    if {![scan $num_mi_threads_str {number-of-threads="%d"} num_mi_threads]} {
-      fail "got number of threads from MI ($name)"
-    } else {
-      pass "got number of threads from MI ($name)"
-
-      # Check if MI and console have same number of threads
-      if {$num_mi_threads != [llength $console_thread_list]} {
-	fail "console and MI have same number of threads ($name)"
-      } else {
-	pass "console and MI have same number of threads ($name)"
-
-	# Get MI thread list
-	set mi_thread_list [get_mi_thread_list $name]
-
-	# Check if MI and console have the same threads
-	set fails 0
-	foreach ct [lsort $console_thread_list] mt [lsort $mi_thread_list] {
-	  if {$ct != $mt} {
-	    incr fails
-	  }
-	}
-	if {$fails > 0} {
-	  fail "MI and console have same threads ($name)"
-
-	  # Send a list of failures to the log
-	  send_log "Console has thread ids: $console_thread_list\n"
-	  send_log "MI has thread ids: $mi_thread_list\n"
-	} else {
-	  pass "MI and console have same threads ($name)"
-	}
-      }
-    }
-  }
-}
-
 # This procedure tests the various thread commands in MI.
 proc check_mi_thread_command_set {} {
 
Index: gdb/testsuite/gdb.mi/mi2-pthreads.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-pthreads.exp,v
retrieving revision 1.6
diff -u -p -r1.6 mi2-pthreads.exp
--- gdb/testsuite/gdb.mi/mi2-pthreads.exp	1 Jan 2008 22:53:20 -0000	1.6
+++ gdb/testsuite/gdb.mi/mi2-pthreads.exp	30 Jul 2008 17:08:03 -0000
@@ -35,145 +35,6 @@ if {[mi_gdb_start]} {
     continue
 }
 
-# The procs below dealing with parsing cli/mi output for the threadlist
-# is duplicated in gdb669.exp. Any changes here will probably need to
-# be made there as well.
-
-proc get_mi_thread_list {name} {
-  global expect_out
-
-  # MI will return a list of thread ids:
-  #
-  # -thread-list-ids
-  # ^done,thread-ids=[thread-id="1",thread-id="2",...],number-of-threads="N"
-  # (gdb)
-  mi_gdb_test "-thread-list-ids" \
-    {\^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]+"(,)?)*\}} $output threads]} {
-    fail "finding threads in MI output ($name)"
-  } else {
-    pass "finding threads in MI output ($name)"
-
-    # Make list of console threads
-    set start [expr {[string first \{ $threads] + 1}]
-    set end   [expr {[string first \} $threads] - 1}]
-    set threads [string range $threads $start $end]
-    foreach thread [split $threads ,] {
-      if {[scan $thread {thread-id="%d"} num]} {
-	lappend thread_list $num
-      }
-    }
-  }
-
-  return $thread_list
-}
-
-# Check that MI and the console know of the same threads.
-# Appends NAME to all test names.
-proc check_mi_and_console_threads {name} {
-  global expect_out
-
-  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 {}
-  if {[info exists expect_out(buffer)]} {
-    set mi_output $expect_out(buffer)
-  }
-
-  # GDB will return a list of thread ids and some more info:
-  #
-  # (gdb) 
-  # -interpreter-exec console "info threads"
-  # ~"  4 Thread 2051 (LWP 7734)  0x401166b1 in __libc_nanosleep () at __libc_nanosleep:-1"
-  # ~"  3 Thread 1026 (LWP 7733)   () at __libc_nanosleep:-1"
-  # ~"  2 Thread 2049 (LWP 7732)  0x401411f8 in __poll (fds=0x804bb24, nfds=1, timeout=2000) at ../sysdeps/unix/sysv/linux/poll.c:63"
-  # ~"* 1 Thread 1024 (LWP 7731)  main (argc=1, argv=0xbfffdd94) at ../../../src/gdb/testsuite/gdb.mi/pthreads.c:160"
-  # FIXME: kseitz/2002-09-05: Don't use the hack-cli method.
-  mi_gdb_test "info threads" \
-    {.*(~".*"[\r\n]*)+.*} \
-    "info threads ($name)"
-  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 {}
-  foreach line [split $console_output \n] {
-    if {[string index $line 0] == "~"} {
-      # This is a line from the console; trim off "~", " ", "*", and "\""
-      set line [string trim $line ~\ \"\*]
-      if {[scan $line "%d" id] == 1} {
-	lappend console_thread_list $id
-      }
-    }
-  }
-
-  # Now find the result string from MI
-  set mi_result ""
-  foreach line [split $mi_output \n] {
-    if {[string range $line 0 4] == "^done"} {
-      set mi_result $line
-    }
-  }
-  if {$mi_result == ""} {
-    fail "finding MI result string ($name)"
-  } else {
-    pass "finding MI result string ($name)"
-  }
-
-  # Finally, extract the thread ids and compare them to the console
-  set num_mi_threads_str ""
-  if {![regexp {number-of-threads="[0-9]+"} $mi_result num_mi_threads_str]} {
-    fail "finding number of threads in MI output ($name)"
-  } else {
-    pass "finding number of threads in MI output ($name)"
-
-    # Extract the number of threads from the MI result
-    if {![scan $num_mi_threads_str {number-of-threads="%d"} num_mi_threads]} {
-      fail "got number of threads from MI ($name)"
-    } else {
-      pass "got number of threads from MI ($name)"
-
-      # Check if MI and console have same number of threads
-      if {$num_mi_threads != [llength $console_thread_list]} {
-	fail "console and MI have same number of threads ($name)"
-      } else {
-	pass "console and MI have same number of threads ($name)"
-
-	# Get MI thread list
-	set mi_thread_list [get_mi_thread_list $name]
-
-	# Check if MI and console have the same threads
-	set fails 0
-	foreach ct [lsort $console_thread_list] mt [lsort $mi_thread_list] {
-	  if {$ct != $mt} {
-	    incr fails
-	  }
-	}
-	if {$fails > 0} {
-	  fail "MI and console have same threads ($name)"
-
-	  # Send a list of failures to the log
-	  send_log "Console has thread ids: $console_thread_list\n"
-	  send_log "MI has thread ids: $mi_thread_list\n"
-	} else {
-	  pass "MI and console have same threads ($name)"
-	}
-      }
-    }
-  }
-}
-
 # This procedure tests the various thread commands in MI.
 proc check_mi_thread_command_set {} {
 
Index: gdb/testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.67
diff -u -p -r1.67 mi-support.exp
--- gdb/testsuite/lib/mi-support.exp	27 Jul 2008 20:57:43 -0000	1.67
+++ gdb/testsuite/lib/mi-support.exp	30 Jul 2008 17:08:03 -0000
@@ -640,6 +640,7 @@ proc mi_gdb_test { args } {
 	    set tmt 60;
 	}
     }
+    verbose -log "Expecting: ^($string_regex\[\r\n\]+)?($pattern\[\r\n\]+$mi_gdb_prompt\[ \]*)"
     gdb_expect $tmt {
 	 -re "\\*\\*\\* DOSEXIT code.*" {
 	     if { $message != "" } {
@@ -1545,3 +1546,138 @@ proc mi_run_inline_test { testcase } {
         eval $statements
     }
 }
+
+proc get_mi_thread_list {name} {
+  global expect_out
+
+  # MI will return a list of thread ids:
+  #
+  # -thread-list-ids
+  # ^done,thread-ids=[thread-id="1",thread-id="2",...],number-of-threads="N"
+  # (gdb)
+  mi_gdb_test "-thread-list-ids" \
+    {.*\^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]+"(,)?)*\}} $output threads]} {
+    fail "finding threads in MI output ($name)"
+  } else {
+    pass "finding threads in MI output ($name)"
+
+    # Make list of console threads
+    set start [expr {[string first \{ $threads] + 1}]
+    set end   [expr {[string first \} $threads] - 1}]
+    set threads [string range $threads $start $end]
+    foreach thread [split $threads ,] {
+      if {[scan $thread {thread-id="%d"} num]} {
+	lappend thread_list $num
+      }
+    }
+  }
+
+  return $thread_list
+}
+
+# Check that MI and the console know of the same threads.
+# Appends NAME to all test names.
+proc check_mi_and_console_threads {name} {
+  global expect_out
+
+  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 {}
+  if {[info exists expect_out(buffer)]} {
+    set mi_output $expect_out(buffer)
+  }
+
+  # GDB will return a list of thread ids and some more info:
+  #
+  # (gdb) 
+  # -interpreter-exec console "info threads"
+  # ~"  4 Thread 2051 (LWP 7734)  0x401166b1 in __libc_nanosleep () at __libc_nanosleep:-1"
+  # ~"  3 Thread 1026 (LWP 7733)   () at __libc_nanosleep:-1"
+  # ~"  2 Thread 2049 (LWP 7732)  0x401411f8 in __poll (fds=0x804bb24, nfds=1, timeout=2000) at ../sysdeps/unix/sysv/linux/poll.c:63"
+  # ~"* 1 Thread 1024 (LWP 7731)  main (argc=1, argv=0xbfffdd94) at ../../../src/gdb/testsuite/gdb.mi/pthreads.c:160"
+  # FIXME: kseitz/2002-09-05: Don't use the hack-cli method.
+  mi_gdb_test "info threads" \
+    {.*(~".*"[\r\n]*)+.*} \
+    "info threads ($name)"
+  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 {}
+  foreach line [split $console_output \n] {
+    if {[string index $line 0] == "~"} {
+      # This is a line from the console; trim off "~", " ", "*", and "\""
+      set line [string trim $line ~\ \"\*]
+      if {[scan $line "%d" id] == 1} {
+	lappend console_thread_list $id
+      }
+    }
+  }
+
+  # Now find the result string from MI
+  set mi_result ""
+  foreach line [split $mi_output \n] {
+    if {[string range $line 0 4] == "^done"} {
+      set mi_result $line
+    }
+  }
+  if {$mi_result == ""} {
+    fail "finding MI result string ($name)"
+  } else {
+    pass "finding MI result string ($name)"
+  }
+
+  # Finally, extract the thread ids and compare them to the console
+  set num_mi_threads_str ""
+  if {![regexp {number-of-threads="[0-9]+"} $mi_result num_mi_threads_str]} {
+    fail "finding number of threads in MI output ($name)"
+  } else {
+    pass "finding number of threads in MI output ($name)"
+
+    # Extract the number of threads from the MI result
+    if {![scan $num_mi_threads_str {number-of-threads="%d"} num_mi_threads]} {
+      fail "got number of threads from MI ($name)"
+    } else {
+      pass "got number of threads from MI ($name)"
+
+      # Check if MI and console have same number of threads
+      if {$num_mi_threads != [llength $console_thread_list]} {
+	fail "console and MI have same number of threads ($name)"
+      } else {
+	pass "console and MI have same number of threads ($name)"
+
+	# Get MI thread list
+	set mi_thread_list [get_mi_thread_list $name]
+
+	# Check if MI and console have the same threads
+	set fails 0
+	foreach ct [lsort $console_thread_list] mt [lsort $mi_thread_list] {
+	  if {$ct != $mt} {
+	    incr fails
+	  }
+	}
+	if {$fails > 0} {
+	  fail "MI and console have same threads ($name)"
+
+	  # Send a list of failures to the log
+	  send_log "Console has thread ids: $console_thread_list\n"
+	  send_log "MI has thread ids: $mi_thread_list\n"
+	} else {
+	  pass "MI and console have same threads ($name)"
+	}
+      }
+    }
+  }
+}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]