Commit 29e339fd by Uros Bizjak

gcc-simulate-thread.exp (simulate-thread): Run on all targets.

	* lib/gcc-simulate-thread.exp (simulate-thread): Run on all targets.
	Look for simulate_thread_done to determine working gdb.  Reduce timeout
	to 10 seconds and fail when timeout occurs.  Improve error messages.

From-SVN: r181452
parent c39169c8
2011-10-17 Uros Bizjak <ubizjak@gmail.com>
* lib/gcc-simulate-thread.exp (simulate-thread): Run on all targets.
Look for simulate_thread_done to determine working gdb. Reduce timeout
to 10 seconds and fail when timeout occurs. Improve error messages.
2011-11-17 Jason Merrill <jason@redhat.com> 2011-11-17 Jason Merrill <jason@redhat.com>
PR c++/51137 PR c++/51137
...@@ -11,8 +17,7 @@ ...@@ -11,8 +17,7 @@
2011-11-17 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2011-11-17 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* lib/gcc-simulate-thread.exp (simulate-thread): Skip on * lib/gcc-simulate-thread.exp (simulate-thread): Skip on alpha*-*-*.
alpha*-*-*.
2011-10-16 Uros Bizjak <ubizjak@gmail.com> 2011-10-16 Uros Bizjak <ubizjak@gmail.com>
......
...@@ -22,15 +22,6 @@ ...@@ -22,15 +22,6 @@
# Call 'fail' if a given test printed "FAIL:", otherwise call 'pass'. # Call 'fail' if a given test printed "FAIL:", otherwise call 'pass'.
proc simulate-thread { args } { proc simulate-thread { args } {
# ??? Exit immediately if this is alpha*-*-* target, single-stepping
# executable between ldl_l and stl_c insns in gdb breaks LL/SC chaining.
if { [istarget alpha*-*-*] } { return }
# GNU gdb 6.3 on powerpc-darwin also on these (and expect does not appear
# to be able to terminate them).
if { [istarget powerpc*-*-darwin*] } { return }
if { ![isnative] || [is_remote target] } { return } if { ![isnative] || [is_remote target] } { return }
if { [llength $args] == 1 } { if { [llength $args] == 1 } {
...@@ -54,35 +45,39 @@ proc simulate-thread { args } { ...@@ -54,35 +45,39 @@ proc simulate-thread { args } {
return return
} }
set message "(thread simulation test)"
send_log "Spawning: $gdb_name -nx -nw -quiet -x $cmd_file ./$exec_file\n" send_log "Spawning: $gdb_name -nx -nw -quiet -x $cmd_file ./$exec_file\n"
set res [remote_spawn target "$gdb_name -nx -nw -x $cmd_file ./$exec_file"] set res [remote_spawn target "$gdb_name -nx -nw -x $cmd_file ./$exec_file"]
if { $res < 0 || $res == "" } { if { $res < 0 || $res == "" } {
unsupported "$testcase" unsupported "$testcase $message"
return return
} }
set gdb_worked 0 set gdb_worked 0
remote_expect target [timeout_value] {
# Set timeout to 10 seconds due to huge amount of generated log.
remote_expect target 10 {
# Too old GDB # Too old GDB
-re "Unhandled dwarf expression|Error in sourced command file" { -re "Unhandled dwarf expression|Error in sourced command file" {
unsupported "$testcase" unsupported "$testcase $message"
remote_close target remote_close target
return return
} }
-re "FAIL:" { -re "FAIL:" {
fail "$testcase" fail "$testcase $message"
remote_close target remote_close target
return return
} }
# If the gdb output contained simulate_thread_main, assume # If the gdb output contained simulate_thread_done, assume
# that at the very least, we had a working gdb that was able # that at the very least, we had a working gdb that was able
# to break in simulate_thread_main. # to break in simulate_thread_done.
-re "simulate_thread_main" { -re "simulate_thread_done" {
set gdb_worked 1 set gdb_worked 1
exp_continue exp_continue
} }
timeout { timeout {
unsupported "$testcase" fail "$testcase $message"
remote_close target remote_close target
return return
} }
...@@ -90,10 +85,10 @@ proc simulate-thread { args } { ...@@ -90,10 +85,10 @@ proc simulate-thread { args } {
remote_close target remote_close target
if {$gdb_worked} { if {$gdb_worked} {
pass "$testcase" pass "$testcase $message"
} else { } else {
# Fail in the absence of a sane GDB. # Unsupported in the absence of a sane GDB.
fail "$testcase" unsupported "$testcase $message"
} }
return return
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment