X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Ftestsuite%2Fgdb.threads%2Fschedlock.exp;h=8faee9fdb87bb27810fa443d109b38b4aad2a47f;hb=e09490f18a66aa4d02a2f5b7a75d2530caf09d5b;hp=f6b319cd7e8c71d04e5a90bdba092f153056fcec;hpb=9b254dd1ce46c19dde1dde5b8d1e22e862dfacce;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/testsuite/gdb.threads/schedlock.exp b/gdb/testsuite/gdb.threads/schedlock.exp index f6b319cd7e..8faee9fdb8 100644 --- a/gdb/testsuite/gdb.threads/schedlock.exp +++ b/gdb/testsuite/gdb.threads/schedlock.exp @@ -45,14 +45,25 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab proc get_args { } { global list_count global gdb_prompt + global NUM + + set pattern "(\[0-9\]+)" + for {set i 1} {[expr $i < $NUM]} {incr i} { + append pattern ", (\[0-9\]+)" + } send_gdb "print args\n" gdb_expect { - -re "\\\$\[0-9\]+ = {(\[0-9\]+), (\[0-9\]+)}.*$gdb_prompt" + -re "\\\$\[0-9\]+ = {$pattern}.*$gdb_prompt" { set list_count [expr $list_count + 1] pass "listed args ($list_count)" - return [list $expect_out(1,string) $expect_out(2,string)] + + set result "" + for {set i 1} {[expr $i <= $NUM]} {incr i} { + lappend result $expect_out($i,string) + } + return $result } -re "$gdb_prompt" { @@ -202,16 +213,16 @@ my_continue "initial" set cont_args [get_args] -set ok 1 +set bad 0 for {set i 0} {[expr $i < $NUM]} {set i [expr $i + 1]} { if {[lindex $start_args $i] == [lindex $cont_args $i]} { - set ok 0 + incr bad } } -if { $ok } { +if { $bad == 0 } { pass "all threads alive" } else { - fail "all threads alive" + fail "all threads alive ($bad/$NUM did not run)" } # We can't change threads, unfortunately, in current GDB. Use