This is the mail archive of the gdb-patches@sources.redhat.com 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]

[PATCH] tweak for gdb.threads/linux-dp.exp testcase


2001-05-24  Michael Snyder  <msnyder@redhat.com>

	* gdb.threads/linux-dp.exp: Remove assumptions about thread ordering.
	Don't require that the main thread and the manager thread are the
	first in the list.

Index: linux-dp.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/linux-dp.exp,v
retrieving revision 1.3
diff -c -3 -p -r1.3 linux-dp.exp
*** linux-dp.exp	2001/03/20 15:54:34	1.3
--- linux-dp.exp	2001/05/25 01:26:05
*************** proc select_thread {thread} {
*** 146,154 ****
--- 146,160 ----
  ### Return true if the thread had a stack which was not only
  ### acceptable, but interesting.  SEEN should be an array in which
  ### SEEN(N) exists iff we have found philosopher number N before.
+ 
+ set main_seen 0
+ set manager_seen 0
+ 
  proc check_philosopher_stack {thread seen_name} {
      global gdb_prompt
      upvar $seen_name seen
+     global main_seen
+     global manager_seen
  
      set name "philosopher is distinct: $thread"
      set interesting 0
*************** proc check_philosopher_stack {thread see
*** 170,175 ****
--- 176,199 ----
  	    ## Maybe the thread hasn't started yet.
  	    pass $name
  	}
+ 	-re ".* in main \\(.*$gdb_prompt $" {
+ 	    if {$main_seen == 1} {
+ 		fail "main is distinct: $thread"
+ 	    } else {
+ 		set main_seen 1
+ 		pass "main is distinct: $thread"
+ 	    }
+ 	    set interesting 1
+ 	}
+ 	-re ".* in __pthread_manager \\(.*$gdb_prompt $" {
+ 	    if {$manager_seen == 1} {
+ 		fail "manager thread is distinct: $thread"
+ 	    } else {
+ 		set manager_seen 1
+ 		pass "manager thread is distinct: $thread"
+ 	    }
+ 	    set interesting 1
+ 	}
  	-re " in \\?\\?.*\r\n$gdb_prompt $" {
  	    ## Sometimes we can't get a backtrace.  I'm going to call
  	    ## this a pass, since we do verify that at least one
*************** proc check_philosopher_stack {thread see
*** 191,197 ****
  
  set any_interesting 0
  array set seen {}
! for {set i 3} {$i <= 7} {incr i} {
      if [check_philosopher_stack $i seen] {
  	set any_interesting 1
      }
--- 215,221 ----
  
  set any_interesting 0
  array set seen {}
! for {set i 1} {$i <= 7} {incr i} {
      if [check_philosopher_stack $i seen] {
  	set any_interesting 1
      }


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