From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6eT/LfQRYmr2WSkAWB0awg (envelope-from ) for ; Thu, 23 Jul 2026 09:07:00 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=palves.net header.i=@palves.net header.a=rsa-sha256 header.s=dreamhost header.b=Md99QZ8y; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id A49EC1E09E; Thu, 23 Jul 2026 09:07:00 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9858A1E099 for ; Thu, 23 Jul 2026 09:06:59 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3C3624BA7993 for ; Thu, 23 Jul 2026 13:06:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C3624BA7993 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=palves.net header.i=@palves.net header.a=rsa-sha256 header.s=dreamhost header.b=Md99QZ8y Received: from cross.pear.relay.mailchannels.net (cross.pear.relay.mailchannels.net [23.83.216.46]) by sourceware.org (Postfix) with ESMTPS id B88DD4BA799A for ; Thu, 23 Jul 2026 13:06:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B88DD4BA799A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=palves.net ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B88DD4BA799A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=23.83.216.46 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784811961; cv=none; b=c2AiGaweE0+jCud8bjQXHqUI2yvVGBLVZxVBGKWX2i6N8oHuZo1zRorTuTWL5e4QJZEFPmNAuaCMnrOQ4DDbwri0as6jLWRtmis9Hmfcyhq1gpnnOeKPCi+2/xKDHKgIY3OWQsYuc8JsAXeGR6JCYX6drodKph0Kq0gG3l/AFvw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784811961; c=relaxed/simple; bh=5nSolRx5VYA49rQiaUjafQVuD6PsaYhhNhj9mZLYC9A=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=uqXaactKdjLqEt8DMoMfju2QAWY9FAq4hRg/fkyTAyrnU8VXwWOM9yDYzd5ffVmA4ixwe9PszdAZBuc4/yQE/t5wdpc1Pkc3ozCAn37YAE1EVKW4tC37GjaITJmCcUt/IVrQqdme6eQ1IyU+/lKQp3kZ9k433P/5cd9YsPjiGCE= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=palves.net header.i=@palves.net header.a=rsa-sha256 header.s=dreamhost header.b=Md99QZ8y DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B88DD4BA799A X-Sender-Id: dreamhost|x-authsender|pedro@palves.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id D211C462A9F for ; Thu, 23 Jul 2026 13:05:59 +0000 (UTC) Received: from pdx1-sub0-mail-a249.dreamhost.com (trex-green-1.trex.outbound.svc.cluster.local [100.103.88.1]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 81D184633EA for ; Thu, 23 Jul 2026 13:05:59 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|pedro@palves.net X-MC-Relay: Good X-MailChannels-SenderId: dreamhost|x-authsender|pedro@palves.net X-MailChannels-Auth-Id: dreamhost X-Madly-Attack: 47cabaa03e50b29d_1784811959765_871231635 X-MC-Loop-Signature: 1784811959765:3721054746 X-MC-Ingress-Time: 1784811959765 Received: from pdx1-sub0-mail-a249.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.103.88.1 (trex/8.0.2); Thu, 23 Jul 2026 13:05:59 +0000 Received: from localhost (bl20-181-64.dsl.telepac.pt [2.81.181.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pedro@palves.net) by pdx1-sub0-mail-a249.dreamhost.com (Postfix) with ESMTPSA id 4h5WZt5sb1z1041 for ; Thu, 23 Jul 2026 06:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=palves.net; s=dreamhost; t=1784811959; bh=1IU407M+Rj331YtW9CAxdiRKqT/OfgRTJcmIidrxRuw=; h=From:To:Subject:Date:Content-Transfer-Encoding; b=Md99QZ8yyuIQHL5RsENkhmQrXOVDk4qg9autCIP2enCTU6AI4+hJACIaSLduWpYpm yjj2NGWtwPiZJiwDu5W2w75mw31hKMCmvoT16CeeRRBCgGjHmfJQJiLcmNhcmosxnQ J43H7r0tlQRMAAfpoFWcqPNNZ4WVCRidUk19rj9D2+EHMt1ocsHC2jXRQPm4om+ael HP++ttPXhe37fcnwcYTIyNuE4afzBx+ECPXVgeVxJLCJb0Po4LsIbu/dhpqUeetUYP v2lyltJuN/n2eYY7cv5zD2BYhWOifD5SibTcLs2PkddIiKxoeOHI4FFPdtntF1gD67 ykpasB54z8mjQ== From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 22/27] gdb.base/maint-info-sections.exp: Match exec file name with optional .exe Date: Thu, 23 Jul 2026 14:01:13 +0100 Message-ID: <20260723130118.206735-23-pedro@palves.net> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260723130118.206735-1-pedro@palves.net> References: <20260723130118.206735-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Two tests of gdb.base/maint-info-sections.exp match a header line against the expected binary name: 1. The "maint info sections" test matches the "Exec file:" header with: Exec file: .*${binfile}., file type... where the trailing "." is meant to match the closing quote after the file name. 2. The "maint info sections -all-objects" test matches the "Object file:" header, expecting the closing quote immediately after $binfile. Both assume the printed name is exactly $binfile. But on a host where the executable has a ".exe" suffix that is not part of $binfile, the printed name is "$binfile.exe", so neither header matches: the single "." matches the dot instead of the quote, and the "Object file:" quote does not line up at all. The tests then fail, e.g., on x86_64-w64-mingw32: FAIL: gdb.base/maint-info-sections.exp: maint info sections FAIL: gdb.base/maint-info-sections.exp: maint info sections -all-objects Fix this by allowing for an optional ".exe" between the file name and the closing quote in both, matching the closing quote explicitly. Tested on: x86_64-pc-linux-gnu x86_64-pc-cygwin x86_64-w64-mingw32 x86_64-pc-windows-msvc Change-Id: Icce62d69d8e23a8e859639a2e4a72c6f5c24ec0e --- gdb/testsuite/gdb.base/maint-info-sections.exp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.base/maint-info-sections.exp b/gdb/testsuite/gdb.base/maint-info-sections.exp index ac712137cc6..3cc128c0ad3 100644 --- a/gdb/testsuite/gdb.base/maint-info-sections.exp +++ b/gdb/testsuite/gdb.base/maint-info-sections.exp @@ -123,19 +123,23 @@ gdb_test_multiple "maint info sections" "general output check" { set text_section ".text" set data_section ".data" +# On some hosts the executable has a ".exe" suffix that is not part of +# $binfile (e.g. a native Windows build), so allow for it between the +# file name and the closing quote. +set exec_re "Exec file: .*${binfile}(\\.exe)?', file type" gdb_test_multiple "maint info sections" "" { - -re -wrap "Exec file: .*${binfile}., file type.*ER_RO.*" { + -re -wrap "${exec_re}.*ER_RO.*" { # Looks like RealView which uses different section names. set text_section ER_RO set data_section ER_RW pass "maint info sections" } - -re -wrap "Exec file: .*${binfile}., file type.*neardata.*" { + -re -wrap "${exec_re}.*neardata.*" { # c6x doesn't have .data section. It has .neardata and .fardata section. set data_section ".neardata" pass "maint info sections" } - -re -wrap "Exec file: .*${binfile}., file type.*" { + -re -wrap "${exec_re}.*" { pass "maint info sections" } } @@ -207,7 +211,7 @@ gdb_test_no_output "maint info sections" \ set seen_header false set seen_a_section false gdb_test_multiple "maint info sections -all-objects" "" { - -re "Object file: `${binfile}', file type \[^.\]+\.\r\n" { + -re "Object file: `${binfile}(\\.exe)?', file type \[^.\]+\.\r\n" { set seen_header true exp_continue } -- 2.54.0