[pushed] Reindent gdb.threads/attach-into-signal.exp (Re: [PATCH 6/6] Drop /proc/PID/status polling from gdb.threads/attach-into-signal.exp)

Pedro Alves palves@redhat.com
Tue Oct 24 10:00:00 GMT 2017


On 10/24/2017 08:27 AM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
> 
>> gdb/testsuite/ChangeLog:
>> yyyy-mm-dd  Pedro Alves  <palves@redhat.com>
>>
>> 	* gdb.threads/attach-into-signal.exp: Remove whole "stoppedtry"
>> 	loop.
> 
> Patch is good to me.

Thanks.  Pushed that one, and as promised, pushed the one below as well.

>From eb2bfbadc159ff1463e58daf24c4ad5d1a23796d Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Tue, 24 Oct 2017 10:43:45 +0100
Subject: [PATCH] Reindent gdb.threads/attach-into-signal.exp

A previous patch removed one nesting level.

gdb/testsuite/ChangeLog:
2017-10-24  Pedro Alves  <palves@redhat.com>

	* gdb.threads/attach-into-signal.exp (corefunc): Reindent.
---
 gdb/testsuite/ChangeLog                          |  4 ++
 gdb/testsuite/gdb.threads/attach-into-signal.exp | 76 ++++++++++++------------
 2 files changed, 42 insertions(+), 38 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 25dcd06..d9ed687 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
 2017-10-24  Pedro Alves  <palves@redhat.com>
 
+	* gdb.threads/attach-into-signal.exp (corefunc): Reindent.
+
+2017-10-24  Pedro Alves  <palves@redhat.com>
+
 	* gdb.threads/attach-into-signal.exp: Remove whole "stoppedtry"
 	loop.
 
diff --git a/gdb/testsuite/gdb.threads/attach-into-signal.exp b/gdb/testsuite/gdb.threads/attach-into-signal.exp
index ab80e82..3158b59 100644
--- a/gdb/testsuite/gdb.threads/attach-into-signal.exp
+++ b/gdb/testsuite/gdb.threads/attach-into-signal.exp
@@ -56,50 +56,50 @@ proc corefunc { threadtype executable } {
 	set attempt 1
 	set passes 1
 	while { $passes < 3 && $attempt <= $attempts } {
-		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 $" {
-			# nonthreaded:
-			pass $test
-			verbose -log "$test succeeded on the attempt # $attempt of $attempts"
-			set passes [expr $passes + 1]
-		    }
-		    -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" {
-			set ok 0
-
-			if { $threadtype == "threaded" } {
-			    # In the threaded case, the signal is left
-			    # pending on the second thread.  Check for
-			    # that by peeking at the thread's siginfo.
-			    # SIGALRM is 14, SIGSTOP is 19.
-
-			    set test2 "thread apply 2 print \$_siginfo.si_signo"
-			    gdb_test_multiple $test2 $test2 {
-				-re " = 14\r\n$gdb_prompt $" {
-				    set ok 1
-				}
-				-re " = 19\r\n$gdb_prompt $" {
-				}
+	    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 $" {
+		    # nonthreaded:
+		    pass $test
+		    verbose -log "$test succeeded on the attempt # $attempt of $attempts"
+		    set passes [expr $passes + 1]
+		}
+		-re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" {
+		    set ok 0
+
+		    if { $threadtype == "threaded" } {
+			# In the threaded case, the signal is left
+			# pending on the second thread.  Check for
+			# that by peeking at the thread's siginfo.
+			# SIGALRM is 14, SIGSTOP is 19.
+
+			set test2 "thread apply 2 print \$_siginfo.si_signo"
+			gdb_test_multiple $test2 $test2 {
+			    -re " = 14\r\n$gdb_prompt $" {
+				set ok 1
+			    }
+			    -re " = 19\r\n$gdb_prompt $" {
 			    }
-			} else {
-			    # In the nonthreaded case, GDB should tell the
-			    # user about having seen a signal.
 			}
+		    } else {
+			# In the nonthreaded case, GDB should tell the
+			# user about having seen a signal.
+		    }
 
-			if { $ok == 0} {
-			    # We just lack the luck, we should try it again.
-			    set attempt [expr $attempt + 1]
-			} else {
-			    pass $test
-			    verbose -log "$test succeeded on the attempt # $attempt of $attempts"
-			    set passes [expr $passes + 1]
-			}
+		    if { $ok == 0} {
+			# We just lack the luck, we should try it again.
+			set attempt [expr $attempt + 1]
+		    } else {
+			pass $test
+			verbose -log "$test succeeded on the attempt # $attempt of $attempts"
+			set passes [expr $passes + 1]
 		    }
-		}] != 0 } {
-		    break
 		}
+	    }] != 0 } {
+		break
+	    }
 
-		gdb_test "detach" "Detaching from.*" ""
+	    gdb_test "detach" "Detaching from.*" ""
 	}
 
 	if {$passes < 3} {
-- 
2.5.5



More information about the Gdb-patches mailing list