From: Tom de Vries Date: Wed, 15 Mar 2023 15:38:03 +0000 (+0100) Subject: [gdb/testsuite] Fix gdb.arch/i386-pkru.exp for native-gdbserver X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b0d27b62f51e0997407383100dbc64b7bc5f4ef;p=binutils-gdb.git [gdb/testsuite] Fix gdb.arch/i386-pkru.exp for native-gdbserver 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. --- 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 + } + } +}