public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Carl Love <cel@us.ibm.com>
To: Tom de Vries <tdevries@suse.de>, Pedro Alves <pedro@palves.net>,
	gdb-patches@sourceware.org
Cc: cel@us.ibm.com, Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	Rogerio Alves <rogealve@br.ibm.com>
Subject: [PATCH Fixup] PowerPC: bp-permanent.exp, kill-after-signal fix
Date: Mon, 09 May 2022 13:43:25 -0700	[thread overview]
Message-ID: <38196ba62680cc3292e920705624c1b5e1085842.camel@us.ibm.com> (raw)
In-Reply-To: <0e7c3026-3a42-5db7-8046-b0133718218e@suse.de>

Tom:

I took a look at the issue.  I retested gdb.base/kill-after-signal.exp
on PowerPC and my Intel x86-64 machine.  I don't see the failure when I
run the test as follows:
 
  make check RUNTESTFLAGS='GDB=/home/carll/bin/gdb   gdb.base/kill-after-signal.exp '

But I was able to reproduce the issue on Intel when I ran with taskset
-c 0 as follows:

 taskset -c 0 make check  RUNTESTFLAGS='GDB=/home/carll/bin/gdb   gdb.base/kill-after-signal.exp '

The -wrap fix you suggested takes care of the issue.  I find it curious
that it requires taskset -c 0 to trigger the issue.

I made the same -wrap fix to gdb.base/bp-permanent.exp.

I have added the fix to the patch that I was working on to fixup my
previous commit with changes that got missed in that commit.

I re-tested gdb.base/kill-after-signal.exp and bp-permanent.exp with
and without taskset -c 0.  The tests run correctly on PowerPC and x86-
64.

Please let me know if the patch looks OK and runs correctly on your
system as well.  Thanks for letting me know about the issue.

                  Carl Love

------------------------------------------------------------------

PowerPC: bp-permanent.exp, kill-after-signal fix

Fix changes that didn't make it into commit:
dd9cd55e990bcc9f8448cac38d242d53974b3604.

Fix missing -wrap on gdb_test_multiple in gdb.base/kill-after-signal.exp
that is causing regression test on x86_64-linux with taskset -c 0.  Also
added the -wrap to gdb.base/bp-permanent.exp.
---
 gdb/testsuite/gdb.base/bp-permanent.exp      | 17 ++++++++++-------
 gdb/testsuite/gdb.base/kill-after-signal.exp | 15 +++++++++------
 2 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/gdb/testsuite/gdb.base/bp-permanent.exp b/gdb/testsuite/gdb.base/bp-permanent.exp
index 21b0bc7bb2d..ede25ce39aa 100644
--- a/gdb/testsuite/gdb.base/bp-permanent.exp
+++ b/gdb/testsuite/gdb.base/bp-permanent.exp
@@ -257,31 +257,34 @@ proc test {always_inserted sw_watchpoint} {
 
 		set test "single-step to handler"
 		gdb_test_multiple "stepi" $test {
-		    -re "Program received signal SIGTRAP.*$gdb_prompt $" {
+		    -re -wrap "Program received signal SIGTRAP.*$gdb_prompt $" {
 			fail $test
 		    }
-		    -re ".*signal handler called.*$gdb_prompt $" {
-			# PowerPC Linux kernel patchs:
+		    -re "signal handler called.*$gdb_prompt $" {
+			# After PowerPC Linux kernel commit:
+			#
 			#   commit: 0138ba5783ae0dcc799ad401a1e8ac8333790df9
 			#   powerpc/64/signal: Balance return predictor
 			#   stack in signal trampoline.
 			#
 			# The kernel places an additional brctl instruction
-			# in the vdso to call the user hadler.
+			# in the vdso to call the user handler.
+			#
+			# And then this commit:
 			#
 			#   commit 24321ac668e452a4942598533d267805f291fdc9
 			#   powerpc/64/signal: Fix regression in
 			#   __kernel_sigtramp_rt64() semantics
 			#
-			# Updates the semantics of __kernel_sigtramp_rt64().
-			# It adds a new symbol to serve as a jump target from
+			# updates the semantics of __kernel_sigtramp_rt64().
+			# It added a new symbol to serve as a jump target from
 			# the kernel to the trampoline.
 			#
 			# The net result of these changes is that gdb stops
 			# at  __kernel_start_sigtramp_rt64.  Need to do one
 			# more stepi to reach the expected location in the user
 			# signal handler.
-			gdb_test "p \$pc" ".*__kernel_start_sigtramp_rt64.*" \
+			gdb_test "p \$pc" "__kernel_start_sigtramp_rt64.*" \
 			    "in kernel code"
 			gdb_test "stepi" "handler .*" $test
 		    }
diff --git a/gdb/testsuite/gdb.base/kill-after-signal.exp b/gdb/testsuite/gdb.base/kill-after-signal.exp
index fcbec9a1c2e..a3e30a67cc4 100644
--- a/gdb/testsuite/gdb.base/kill-after-signal.exp
+++ b/gdb/testsuite/gdb.base/kill-after-signal.exp
@@ -39,24 +39,27 @@ gdb_test "continue" "Program received signal SIGUSR1, .*"
 
 set test "handler"
 gdb_test_multiple "stepi" $test {
-    -re "\r\nhandler .*" {
+    -re -wrap "\r\nhandler .*" {
 	pass $test
     }
-    -re ".*signal handler called.*$gdb_prompt $" {
-	# PowerPC Linux kernel patchs:
+    -re "signal handler called.*$gdb_prompt $" {
+	# After PowerPC Linux kernel commit:
+	#
 	#   commit: 0138ba5783ae0dcc799ad401a1e8ac8333790df9
 	#   powerpc/64/signal: Balance return predictor
 	#   stack in signal trampoline.
 	#
 	# The kernel places an additional brctl instruction
-	# in the vdso to call the user hadler.
+	# in the vdso to call the user handler.
+	#
+	# And then this commit:
 	#
 	#   commit 24321ac668e452a4942598533d267805f291fdc9
 	#   powerpc/64/signal: Fix regression in
 	#   __kernel_sigtramp_rt64() semantics
 	#
-	# Updates the semantics of __kernel_sigtramp_rt64().
-	# It adds a new symbol to serve as a jump target from
+	# updates the semantics of __kernel_sigtramp_rt64().
+	# It added a new symbol to serve as a jump target from
 	# the kernel to the trampoline.
 	#
 	# The net result of these changes is that gdb stops
-- 
2.32.0



  parent reply	other threads:[~2022-05-09 20:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29  1:06 [PATCH] " Carl Love
2022-05-02 14:09 ` Ulrich Weigand
2022-05-02 14:32 ` Pedro Alves
2022-05-02 14:55   ` will schmidt
2022-05-02 15:19     ` Carl Love
2022-05-02 15:24       ` Pedro Alves
2022-05-03 20:10   ` Carl Love
2022-05-06 16:16     ` Pedro Alves
2022-05-09 17:35     ` Tom de Vries
2022-05-09 19:22       ` Carl Love
2022-05-09 20:43       ` Carl Love [this message]
2022-05-10  9:27         ` [PATCH Fixup] " Tom de Vries
2022-05-10 15:13           ` Carl Love
2022-05-10 19:07             ` [PATCH Fixup V2] " Carl Love
2022-05-16 15:46               ` [PATCH PING " Carl Love
2022-05-18  7:33                 ` Tom de Vries
2022-05-02 15:04 ` [PATCH] " will schmidt
2022-05-02 15:10   ` Ulrich Weigand
2022-05-02 17:18     ` will schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38196ba62680cc3292e920705624c1b5e1085842.camel@us.ibm.com \
    --to=cel@us.ibm.com \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    --cc=rogealve@br.ibm.com \
    --cc=tdevries@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).