public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb fix for catch-syscall.exp
@ 2021-11-17 23:30 Carl Love
  2021-11-18 15:23 ` Tom Tromey
  2021-11-18 18:10 ` Simon Marchi
  0 siblings, 2 replies; 18+ messages in thread
From: Carl Love @ 2021-11-17 23:30 UTC (permalink / raw)
  To: gdb-patches; +Cc: cel, Will Schmidt, Rogerio Alves

GDB maintainers:

The following patch fixes three test failures and an expect error.  The
expect error ERROR: can't read "arch1": no such variable is the result
of the if/else statement in proc test_catch_syscall_multi_arch not
matching the power platform.  The power platform, starting with Power
8, has "le" in the platform string to indicate a Little Endian system. 
The current expect string doesn't match the "le" in the name.

The other three failures are the result of the execve instruction that
starts executing the new program.  The expect script is looking for the
return from the execve command which doesn't occur since execve
replaces the current process image.

The patch was tested on a Power 10 LE system with no regressions.

Please let me know if the patch is acceptable for mainline.  Thanks.

                       Carl 


-------------------------------------------------------------------
gdb fix for catch-syscall.exp

Remove check_continue "execve" from Proc test_catch_syscall_execve.

The check_continue proceedure checs that the command, execve, starts and
checks for the return from the command.  The execve command starts a new
program and thus the return from the command causing the test to fail.

The call to proc check_continue "execve" is removed and replaced with
just the call to check_call_to_syscall "execve" to verify the command
executed.  The next test in proc test_catch_syscall_execve verifies that
the new program started and hit the break point in main.

Update the check for the PowerPC architecture.  Power Little Endian systems
include "le" in the name.  The istarget "power64-*-linux*" check fails to
match LE sytems.  The expected string is updated to capture both Big Endian
and Little Endian systems.  Power 10 LE istarget prints as:
powerpc64le-unknown-linux-gnu.

This patch fixes three failures and the error:

    ERROR: can't read "arch1": no such variable

Patch tested on Power 10 ppc64le GNU/Linux platform.
---
 gdb/testsuite/gdb.base/catch-syscall.exp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
index 811a92b0aea..8b496712df5 100644
--- a/gdb/testsuite/gdb.base/catch-syscall.exp
+++ b/gdb/testsuite/gdb.base/catch-syscall.exp
@@ -348,7 +348,9 @@ proc test_catch_syscall_execve {} {
 	# Check for entry/return across the execve, making sure that the
 	# syscall_state isn't lost when turning into a new process.
 	insert_catch_syscall_with_arg "execve"
-	check_continue "execve"
+
+	# check that the execve is called
+	check_call_to_syscall "execve"
 
 	# Continue to main so extended-remote can read files as needed.
 	# (Otherwise that "Reading" output confuses gdb_continue_to_end.)
@@ -550,7 +552,7 @@ proc test_catch_syscall_multi_arch {} {
 	set syscall2_name "write"
 	set syscall_number 1
     } elseif { [istarget "powerpc-*-linux*"] \
-		   || [istarget "powerpc64-*-linux*"] } {
+		   || [istarget "powerpc64*-linux*"] } {
 	set arch1 "powerpc:common"
 	set arch2 "powerpc:common64"
 	set syscall1_name "openat"
-- 
2.30.2



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-12-11  0:21 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 23:30 [PATCH] gdb fix for catch-syscall.exp Carl Love
2021-11-18 15:23 ` Tom Tromey
2021-11-18 18:10 ` Simon Marchi
2021-11-20  0:27   ` Carl Love
2021-11-22  1:07     ` Simon Marchi
2021-11-22 18:16       ` Carl Love
2021-11-22 17:01     ` John Baldwin
2021-11-23 20:34       ` Simon Marchi
2021-11-23 22:34         ` John Baldwin
2021-11-24 17:46           ` Carl Love
2021-11-24 17:51             ` John Baldwin
2021-11-24  1:15         ` Carl Love
2021-11-24 19:29           ` Simon Marchi
2021-11-29 16:46             ` Carl Love
2021-12-02 16:32               ` Ping " Carl Love
2021-12-10 18:36               ` Simon Marchi
2021-12-10 19:59                 ` [PATCH v2] " Carl Love
2021-12-11  0:21                   ` Simon Marchi

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).