From: Carl Love Date: Mon, 29 Nov 2021 16:28:42 +0000 (+0000) Subject: gdb: Powerpc mark xfail in gdb.base/catch-syscall.exp X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=408db576c98b232de0b1a1ee3495bad0d1c704cf;p=binutils-gdb.git gdb: Powerpc mark xfail in gdb.base/catch-syscall.exp Powerpc is not reporting the Catchpoint 1 (returned from syscall execve), .... as expected. The issue appears to be with the kernel not returning the expected result. This patch marks the test failure as an xfail. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28623 --- diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp index cdd5e2aec47..b0d524c1a03 100644 --- a/gdb/testsuite/gdb.base/catch-syscall.exp +++ b/gdb/testsuite/gdb.base/catch-syscall.exp @@ -127,7 +127,28 @@ proc check_return_from_syscall { syscall { pattern "" } } { } set thistest "syscall $syscall has returned" - gdb_test "continue" "Catchpoint $decimal \\(returned from syscall ${pattern}\\).*" $thistest + if { $pattern eq "execve" } { + gdb_test_multiple "continue" $thistest { + -re -wrap "Catchpoint $decimal \\(returned from syscall ${pattern}\\).*" { + pass $thistest + return 1 + } + -re -wrap ".*Breakpoint $decimal, main .*" { + # On Powerpc the kernel does not report the returned from + # syscall as expected by the test. GDB bugzilla 28623. + if { [istarget "powerpc64*-linux*"] } { + xfail $thistest + } else { + fail $thistest + } + return 0 + } + } + + } else { + gdb_test "continue" "Catchpoint $decimal \\(returned from syscall ${pattern}\\).*" $thistest + return 1 + } } # Internal procedure that performs two 'continue' commands and checks if @@ -142,7 +163,7 @@ proc check_continue { syscall { pattern "" } } { # Testing if the inferior has called the syscall. check_call_to_syscall $syscall $pattern # And now, that the syscall has returned. - check_return_from_syscall $syscall $pattern + return [check_return_from_syscall $syscall $pattern] } # Inserts a syscall catchpoint with an argument. @@ -348,11 +369,15 @@ 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" + if [check_continue "execve"] { + # The check_continue test generates an XFAIL on Powerpc. In + # that case, gdb is already at main so don't do the continue. + - # Continue to main so extended-remote can read files as needed. - # (Otherwise that "Reading" output confuses gdb_continue_to_end.) - gdb_continue "main" + # Continue to main so extended-remote can read files as needed. + # (Otherwise that "Reading" output confuses gdb_continue_to_end.) + gdb_continue "main" + } # Now can we finish? check_for_program_end