[patch] Avoid ERROR in thread-specific.exp

Daniel Jacobowitz drow@mvista.com
Mon Feb 9 22:47:00 GMT 2004


Mark Kettenis pointed this out to me.  Having found a target that has the
same problem (mips-linux, I'm working on it), I've checked in this fix.

The problem is that the following tests in this fie assume that there are
multiple threads.  If not, then a variable never gets initialized, and Tcl
gets annoyed.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2004-02-09  Daniel Jacobowitz  <drow@mvista.com>

	* gdb.threads/thread-specific.exp: Stop early if no threads are
	found.

Index: thread-specific.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/thread-specific.exp,v
retrieving revision 1.2
diff -u -p -r1.2 thread-specific.exp
--- thread-specific.exp	2 Feb 2004 01:57:56 -0000	1.2
+++ thread-specific.exp	9 Feb 2004 20:20:56 -0000
@@ -86,6 +86,11 @@ gdb_continue_to_breakpoint "all threads 
 set line [gdb_get_line_number "thread-specific.exp: thread loop"]
 set threads [get_thread_list]
 
+if {[llength $threads] == 0} {
+  # We have already issued a FAIL above.
+  return 1
+}
+
 gdb_test_multiple "break $line thread [lindex $threads 0]" \
   "breakpoint $line main thread" {
     -re "Breakpoint (\[0-9\]*) at.* file .*$srcfile, line.*$gdb_prompt $" {



More information about the Gdb-patches mailing list