set attempt 1
set passes 1
while { $passes < 3 && $attempt <= $attempts } {
- set stoppedtry 0
- while { $stoppedtry < 10 } {
- with_test_prefix "stoppedtry $stoppedtry" {
- if [catch {open /proc/${testpid}/status r} fileid] {
- set stoppedtry 10
- break
- }
- gets $fileid line1
- gets $fileid line2
- close $fileid
-
- if {![string match "*(stopped)*" $line2]} {
- # No PASS message as we may be looping in multiple
- # attempts.
- break
- }
- sleep 1
- set stoppedtry [expr $stoppedtry + 1]
- }
- }
- if { $stoppedtry >= 10 } {
- verbose -log $line2
- set test "process is still running on the attempt # $attempt of $attempts"
- break
- }
-
- # Main test:
set test "attach (pass $passes), pending signal catch"
if {[gdb_test_multiple "attach $testpid" $test {
-re "Attaching to program.*`?$escapedbinfile'?, process $testpid.* received signal SIGALRM.*$gdb_prompt $" {