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]

adjust linux-dp test


My recent change to linux-dp.exp wasn't robust because (a) some thread ids can be negative numbers and (b) sometimes you'd get a 'cannot access memory' error in printing out a prototype, and that would mess up the \n placement.

This patch fixes those two problems, and renames the tests to be unique.

tested on i686-pc-linux-gnu, ok?

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2006-11-29  Nathan Sidwell  <nathan@codesourcery.com>

	* gdb.threads/linux-dp.exp: Adjust regexps used to scan thread
	info.  Adjust test names.

Index: testsuite/gdb.threads/linux-dp.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/linux-dp.exp,v
retrieving revision 1.12
diff -c -3 -p -r1.12 linux-dp.exp
*** testsuite/gdb.threads/linux-dp.exp	28 Nov 2006 15:16:48 -0000	1.12
--- testsuite/gdb.threads/linux-dp.exp	29 Nov 2006 14:51:12 -0000
*************** for {set i 0} {$i < 5} {incr i} {
*** 73,79 ****
  	-re "info threads\r\n" {
  	    exp_continue
  	}
! 	-re "^\\*? +(\[0-9\]+ Thread \[0-9\]+) \[^\n\]*\n" {
  	    verbose -log "found thread $expect_out(1,string)" 2
  	    lappend threads_before $expect_out(1,string)
  	    exp_continue
--- 73,79 ----
  	-re "info threads\r\n" {
  	    exp_continue
  	}
! 	-re "^. +(\[0-9\]+ Thread \[-0-9\]+) (\[^\n\]|Cannot access memory \[^\n\]*\n)*\n" {
  	    verbose -log "found thread $expect_out(1,string)" 2
  	    lappend threads_before $expect_out(1,string)
  	    exp_continue
*************** for {set i 0} {$i < 5} {incr i} {
*** 81,87 ****
  	-re "^$gdb_prompt $" {
  	}
  	timeout {
! 	    fail "(timeout) info threads"
  	}
      }
      send_gdb "next\n"
--- 81,87 ----
  	-re "^$gdb_prompt $" {
  	}
  	timeout {
! 	    fail "(timeout) info threads before: $i"
  	}
      }
      send_gdb "next\n"
*************** for {set i 0} {$i < 5} {incr i} {
*** 139,145 ****
  	-re "info threads\r\n" {
  	    exp_continue
  	}
! 	-re "^\\*? +(\[0-9\]+ Thread \[0-9\]+) \[^\n\]+\n" {
  	    set name $expect_out(1,string)
  	    for {set j 0} {$j != [llength $threads_before] } {incr j} {
  		if {$name == [lindex $threads_before $j]} {
--- 139,145 ----
  	-re "info threads\r\n" {
  	    exp_continue
  	}
! 	-re "^. +(\[0-9\]+ Thread \[-0-9\]+) (\[^\n\]|Cannot access memory \[^\n\]*\n)*\n" {
  	    set name $expect_out(1,string)
  	    for {set j 0} {$j != [llength $threads_before] } {incr j} {
  		if {$name == [lindex $threads_before $j]} {
*************** for {set i 0} {$i < 5} {incr i} {
*** 155,175 ****
  	}
  	-re "^$gdb_prompt $" {
  	    if { [llength $threads_before] != 0 } {
! 		fail "create philosopher: $i"
  	    } elseif { !$i && [llength $threads_after] == 2 } {
  		set expect_manager 1
! 		pass "create philosopher: $i"
  	    } elseif { [llength $threads_after] == 1 } {
  		if { $expect_manager < 0 } {
  		    set expect_manager 0
  		}
! 		pass "create philosopher: $i"
  	    } else {
! 		fail "create philosopher: $i"
  	    }
  	}
  	timeout {
! 	    fail "(timeout) info threads"
  	}
      }
      
--- 155,175 ----
  	}
  	-re "^$gdb_prompt $" {
  	    if { [llength $threads_before] != 0 } {
! 		fail "info threads after: $i"
  	    } elseif { !$i && [llength $threads_after] == 2 } {
  		set expect_manager 1
! 		pass "info threads after: $i"
  	    } elseif { [llength $threads_after] == 1 } {
  		if { $expect_manager < 0 } {
  		    set expect_manager 0
  		}
! 		pass "info threads after: $i"
  	    } else {
! 		fail "info threads after: $i"
  	    }
  	}
  	timeout {
! 	    fail "(timeout) info threads after: $i"
  	}
      }
      

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