From patchwork Wed Jul 26 09:53:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 73219 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8E0693857719 for ; Wed, 26 Jul 2023 09:54:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E0693857719 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690365279; bh=ASzluBpO9gnv3wkkClGjHZx4MJwJs9CeG/K52Lk0aII=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=xX/TKYEhnfN0nStcCTrewkjTz9bRidBhiQyMz+D8wS9wnwOufveCeRrbqgWD9nk8U 8eF/ycsKBSP1DKtRokeugRWXpeEeC8bYYtpv2I8yB02cCI4E9v17da3cKEqKF05S8N zKWwJtt+sCl/wELVHd04gHd0Fp3rkWI//3B0TgoA= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id A97293858C53 for ; Wed, 26 Jul 2023 09:54:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A97293858C53 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D820221E14 for ; Wed, 26 Jul 2023 09:54:09 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C44801341F for ; Wed, 26 Jul 2023 09:54:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id HmXWLkHtwGSidQAAMHmgww (envelope-from ) for ; Wed, 26 Jul 2023 09:54:09 +0000 To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Fix regexps in gdb.base/step-over-syscall.exp Date: Wed, 26 Jul 2023 11:53:54 +0200 Message-Id: <20230726095354.14469-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" When running test-case gdb.base/step-over-syscall.exp without glibc debuginfo installed, I get: ... (gdb) continue^M Continuing.^M ^M Breakpoint 2, 0x00007ffff7d4405e in vfork () from /lib64/libc.so.6^M (gdb) PASS: gdb.base/step-over-syscall.exp: vfork: displaced=off: \ continue to vfork (1st time) ... but with glibc debuginfo installed I get instead: ... (gdb) continue^M Continuing.^M ^M Breakpoint 2, 0x00007ffff7d4405e in __libc_vfork () at \ ../sysdeps/unix/sysv/linux/x86_64/vfork.S:44^M 44 ENTRY (__vfork)^M (gdb) FAIL: gdb.base/step-over-syscall.exp: vfork: displaced=off: \ continue to vfork (1st time) ... The FAIL is due to a mismatch with regexp: ... "Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" ... because it cannot match both ".* in " and the __libc_ prefix. Fix this by using instead the regexp: ... "Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*" ... Tested on x86_64-linux. --- gdb/testsuite/gdb.base/step-over-syscall.exp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) base-commit: 477c9f2ba26ccd77016f2c97941fc8b35e332e35 diff --git a/gdb/testsuite/gdb.base/step-over-syscall.exp b/gdb/testsuite/gdb.base/step-over-syscall.exp index bc795f2423a..1f1e62296c6 100644 --- a/gdb/testsuite/gdb.base/step-over-syscall.exp +++ b/gdb/testsuite/gdb.base/step-over-syscall.exp @@ -127,13 +127,13 @@ proc setup { syscall } { gdb_test "break \*$syscall" "Breakpoint \[0-9\]* at .*" - gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \ + gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*" \ "continue to $syscall (1st time)" # Hit the breakpoint on $syscall for the first time. In this time, # we will let PLT resolution done, and the number single steps we will # do later will be reduced. - gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \ + gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*" \ "continue to $syscall (2nd time)" # Hit the breakpoint on $syscall for the second time. In this time, # the address of syscall insn and next insn of syscall are recorded. @@ -264,7 +264,7 @@ proc step_over_syscall { syscall } { return -1 } - gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \ + gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*" \ "continue to $syscall (3rd time)" # Hit the breakpoint on $syscall for the third time. In this time, we'll set @@ -332,7 +332,7 @@ proc break_cond_on_syscall { syscall follow_fork detach_on_fork } { return -1 } - gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in |__libc_|)$syscall \\(\\).*" \ + gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, (.* in )?(__libc_)?$syscall \\(\\).*" \ "continue to $syscall" # Delete breakpoint syscall insns to avoid interference with other syscalls. delete_breakpoints