public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed 3/5] [gdb/testsuite] Fix gdb.arch/i386-pkru.exp for native-gdbserver
Date: Wed, 15 Mar 2023 16:38:35 +0100	[thread overview]
Message-ID: <20230315153837.21440-4-tdevries@suse.de> (raw)
In-Reply-To: <20230315153837.21440-1-tdevries@suse.de>

With test-case gdb.arch/i386-pkru.exp and target board native-gdbserver we run
into:
...
FAIL: gdb.arch/i386-pkru.exp: variable after reading pkru
...

This looks similar to the the problem for which there's already an xfail, so
fix this by extending the xfail matching.

Tested on x86_64-linux.

Also tested on openSUSE Tumbleweed, where all tests in the test-case pass.
---
 gdb/testsuite/gdb.arch/i386-pkru.exp | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/i386-pkru.exp b/gdb/testsuite/gdb.arch/i386-pkru.exp
index 1f047df68ef..223a8aa95f0 100644
--- a/gdb/testsuite/gdb.arch/i386-pkru.exp
+++ b/gdb/testsuite/gdb.arch/i386-pkru.exp
@@ -80,7 +80,6 @@ gdb_test "info register pkru" ".*pkru.*$val1.*" "read pkru register"
 set val2 0x44444444
 gdb_test "print /x \$pkru = $val2" "= $val2" "set pkru value"
 
-set xval $val2
 gdb_test_multiple "info register pkru" "read value after setting value" {
     -re -wrap ".*pkru.*$val2.*" {
 	pass $gdb_test_name
@@ -91,11 +90,21 @@ gdb_test_multiple "info register pkru" "read value after setting value" {
 	} else {
 	    fail $gdb_test_name
 	}
-	set xval $val1
     }
 }
 
 gdb_breakpoint [ gdb_get_line_number "break here 2" ]
 gdb_continue_to_breakpoint "break here 2" ".*break here 2.*"
 
-gdb_test "print /x rd_value" "= $xval" "variable after reading pkru"
+gdb_test_multiple "print /x rd_value" "variable after reading pkru" {
+    -re -wrap "= $val2" {
+	pass $gdb_test_name
+    }
+    -re -wrap "= $val1" {
+	if { $have_xfail } {
+	    xfail $gdb_test_name
+	} else {
+	    fail $gdb_test_name
+	}
+    }
+}
-- 
2.35.3


  parent reply	other threads:[~2023-03-15 15:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 15:38 [pushed 0/5] [gdb/testsuite] Fix remote host issues in gdb.arch tests Tom de Vries
2023-03-15 15:38 ` [pushed 1/5] [gdb/testsuite] Fix gdb.arch/amd64*.exp with local-remote-host-native.exp Tom de Vries
2023-03-15 15:38 ` [pushed 2/5] [gdb/testsuite] Unset DEBUGINFOD_URLS on remote host Tom de Vries
2023-03-15 15:38 ` Tom de Vries [this message]
2023-03-15 15:38 ` [pushed 4/5] [gdb/testsuite] Fix gdb.arch/amd64-stap-special-operands.exp for " Tom de Vries
2023-03-15 15:38 ` [pushed 5/5] [gdb/testsuite] Fix re-used exec in gdb.arch/ftrace-insn-reloc.exp Tom de Vries

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=20230315153837.21440-4-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /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).