From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id CDAC0387703F; Wed, 11 May 2022 13:48:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CDAC0387703F Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.base/catch-syscall.exp with --with-expat=no X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: aa02037b08312eece5c06e1e98b2ce8b30993c5c X-Git-Newrev: 32412d8e48b156c387383833a97a649fce2f05a1 Message-Id: <20220511134826.CDAC0387703F@sourceware.org> Date: Wed, 11 May 2022 13:48:26 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2022 13:48:26 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D32412d8e48b1= 56c387383833a97a649fce2f05a1 commit 32412d8e48b156c387383833a97a649fce2f05a1 Author: Tom de Vries Date: Wed May 11 15:48:23 2022 +0200 [gdb/testsuite] Fix gdb.base/catch-syscall.exp with --with-expat=3Dno =20 When doing a gdb build with --with-expat=3Dno, I run into: ... (gdb) PASS: gdb.base/catch-syscall.exp: determine pipe syscall: \ continue to breakpoint: before pipe call catch syscall pipe^M Unknown syscall name 'pipe'.^M (gdb) PASS: gdb.base/catch-syscall.exp: determine pipe syscall: \ catch syscall pipe catch syscall pipe2^M Unknown syscall name 'pipe2'.^M (gdb) PASS: gdb.base/catch-syscall.exp: determine pipe syscall: \ catch syscall pipe2 continue^M Continuing.^M [Detaching after vfork from child process 18538]^M [Inferior 1 (process 18537) exited normally]^M (gdb) FAIL: gdb.base/catch-syscall.exp: determine pipe syscall: continue ... =20 This is a regression since recent commit 5463a15c18b ("[gdb/testsuite] = Handle pipe2 syscall in gdb.base/catch-syscall.exp"). =20 Fix this by using pipe/pipe2 syscall numbers instead. =20 Tested on x86_64-linux. Diff: --- gdb/testsuite/gdb.base/catch-syscall.exp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.b= ase/catch-syscall.exp index 1260a64270f..d8b6898b3e0 100644 --- a/gdb/testsuite/gdb.base/catch-syscall.exp +++ b/gdb/testsuite/gdb.base/catch-syscall.exp @@ -705,10 +705,12 @@ proc setup_all_syscalls {} { # SYS_pipe doesn't exist on aarch64 kernel. set test "check SYS_pipe" set have_SYS_pipe 0 + set SYS_pipe -1 gdb_test_multiple "p pipe_syscall" $test { - -re -wrap " =3D $decimal" { + -re -wrap " =3D ($decimal)" { pass $test set have_SYS_pipe 1 + set SYS_pipe $expect_out(1,string) } -re -wrap "No symbol .*" { pass $test @@ -717,10 +719,12 @@ proc setup_all_syscalls {} { =20 set test "check SYS_pipe2" set have_SYS_pipe2 0 + set SYS_pipe2 -1 gdb_test_multiple "p pipe2_syscall" $test { - -re -wrap " =3D $decimal" { + -re -wrap " =3D ($decimal)" { pass $test set have_SYS_pipe2 1 + set SYS_pipe2 $expect_out(1,string) } -re -wrap "No symbol .*" { pass $test @@ -736,19 +740,19 @@ proc setup_all_syscalls {} { gdb_test "break $line" gdb_continue_to_breakpoint "before pipe call" if { $have_SYS_pipe } { - gdb_test "catch syscall pipe" + gdb_test "catch syscall $SYS_pipe" } if { $have_SYS_pipe2 } { - gdb_test "catch syscall pipe2" + gdb_test "catch syscall $SYS_pipe2" } set ok 0 gdb_test_multiple "continue" "" { - -re -wrap "Catchpoint $decimal \\(call to syscall pipe\\).*" { + -re -wrap "Catchpoint $decimal \\(call to syscall (pipe|$SYS_pipe)\\)= .*" { lappend all_syscalls pipe pass $gdb_test_name set ok 1 } - -re -wrap "Catchpoint $decimal \\(call to syscall pipe2\\).*" { + -re -wrap "Catchpoint $decimal \\(call to syscall (pipe2|$SYS_pipe)\\= ).*" { lappend all_syscalls pipe2 pass $gdb_test_name set ok 1