From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YIUdCYtMWWoTTQ0AWB0awg (envelope-from ) for ; Thu, 16 Jul 2026 17:26:35 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=YGk0hztc; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 13CCF1E033; Thu, 16 Jul 2026 17:26:35 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,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 79F071E033 for ; Thu, 16 Jul 2026 17:26:34 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BBE004BA2E30 for ; Thu, 16 Jul 2026 21:26:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BBE004BA2E30 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=YGk0hztc Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id D9A664BA23E2 for ; Thu, 16 Jul 2026 21:26:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D9A664BA23E2 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D9A664BA23E2 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784237168; cv=none; b=oHYoCHlHJKf/K2GOtkiSC4PDaLQSFxI9YDh+TgaqFjPYgvRvZ1DkpBzlydQPb4PNO/roMt9blzMaojMsE03ZHL0WyjsJfTqGoQ4Hra+lkAPR53QCfa9ozAxIiFzZZdA8j/EiiqahYjrMlx26QWoybxGQi4VSUWc5bPE8F17Z0Ag= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784237168; c=relaxed/simple; bh=sscLD7dnAZM4t0q5wGfTv8ROT8JAiAEWFWm8yMvs6TM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=f40Aw6Z2FAyeylmhXAoN16QJTSB2Hm2jC8HQbyaLJyNiSbS9vVREOfGtIvDdxrIZ9HPptAWLQ8gd3ZRTCg3DNEO/aoyBIDwKd9pEufoNPR4joC00iuJ/kbvLPiCJCRjESxqI/abdkf8e0t+JBnN8iaQJq1c/jlLrDXgUZKfF+tE= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=YGk0hztc DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9A664BA23E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784237167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Z0BrF5U/BpQ6L0R+UdVz7Sc27XK+VYE4VgQUaLuDa5I=; b=YGk0hztcsgDga7lIZ+TyDQLFHXimttNvaPyW/PMCEowpomKmkyBUaQzAJaON2GEk6kC/0t i+8sKAFc9MAe2ZqtVgbWKn8HON9iKQpSI/9voYEtUGPKXGhjhscrYt/jlpIGUxKrxJXVTO RSyipAhK4839cJhnYoOIKR778HhjasE= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-258-WuE_swlPPSOmllS9a3C3jg-1; Thu, 16 Jul 2026 17:26:06 -0400 X-MC-Unique: WuE_swlPPSOmllS9a3C3jg-1 X-Mimecast-MFC-AGG-ID: WuE_swlPPSOmllS9a3C3jg_1784237165 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4926fa2cb17so8084515e9.1 for ; Thu, 16 Jul 2026 14:26:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784237165; x=1784841965; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Z0BrF5U/BpQ6L0R+UdVz7Sc27XK+VYE4VgQUaLuDa5I=; b=lVtmqG2joMaiWYsKEtPYge1Ip021a5GlsSXGJUOgYQOYBd10el6MWfB+7Kf4gQrMnM Vk/4+p5ktrbzp6d0MoC7XYov59h8WP2iBmmq7ObJC4GFTUFpArKISuaPknoWbibqcSYg 9VNB05Pz/CIBVSdUqdkw0ifVvq1mKu5xCkmtf+hLeAqrDJVzX6MTjBfR5XvmTuvyGkOe FNMT73yoqh3orbQWe00guTUf6/rktSRiwRYR1tWatRm8pIC1SDUJ7+6hdtkiDH9gi/Bf li7PwVn5+Ks1VTv2XqlbwFFs0ddlm5AvKoT7GrG5pAqRkiJX9msYK+yT/0qWj321aEzt vmag== X-Forwarded-Encrypted: i=1; AHgh+Rqelt1f0k1z/jESKQlPYjlEalU55A3+MXBx+kSGqtj8DWZf9zrwSfijQKRmqBD9YmRlL+lfSmyeuqUYUg==@sourceware.org X-Gm-Message-State: AOJu0Yw+Dr6pM7PdMnEZmIKHdFq4whFxDhmU0c+EZ0kKTQvtMN/88WBB +3qzW6tVj/os9TqC07hYIfV+ClPimHV//Galjmfj9dCIEs0idE3YJeC5QJvHerLWHvHGsxnJER/ OFgoy4ukLphtL7+0OsKT66bjpTre3McultVmBHuR0r8/9lSi5GAawm4fy8YmU9H5q3qtFVd0= X-Gm-Gg: AfdE7cnPnzSrb5omNTLnHCIDl9r+QLYL/e0eR4XoMh4V+v3n1HISAXwMHlrmXLyAPuW JPYolbDJ+gh3QbvAOKK0Q3Z6UDGdvDg0TsWy4BwUsUGJGLbJmwL9yED+DG2gvUD7g95JQzTqbga 9LdE4UqyzmaGji6L0dE7D8wWzerL5Pv5xDUXMetz7mWB0jw2VPIlOug4mT9sser8SP8lVC23uGX qLbPTlesh+XQ/U7OS0Mw8Ufh125kD8EXUSdZ1B/UQ27tA/4nIsN7Vig8KjxVQ0S7cHs2eBChgTj PpsrADr1ADE/k2kJyequsNvrGkcRLqtmfdTTuL0Az3AeyW4NEmTFoioiKf55G1H9PXc+4lUp X-Received: by 2002:a05:600c:2282:b0:495:4794:f765 with SMTP id 5b1f17b1804b1-4954794f7d4mr14443655e9.12.1784237164639; Thu, 16 Jul 2026 14:26:04 -0700 (PDT) X-Received: by 2002:a05:600c:2282:b0:495:4794:f765 with SMTP id 5b1f17b1804b1-4954794f7d4mr14443455e9.12.1784237164130; Thu, 16 Jul 2026 14:26:04 -0700 (PDT) Received: from localhost ([31.111.209.233]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f464b7f09sm27469060f8f.26.2026.07.16.14.26.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2026 14:26:03 -0700 (PDT) From: Andrew Burgess To: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [PATCH 2/4] gdb.base/callfuncs.exp: Adjust for Windows In-Reply-To: References: <20260714220631.1499846-1-pedro@palves.net> <20260714220631.1499846-3-pedro@palves.net> Date: Thu, 16 Jul 2026 22:26:02 +0100 Message-ID: <87wluud3th.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: CwVS1e38JDErETCqT6eCyd9PkbC5Vl7R0hfIj1m7unQ_1784237165 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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 Pedro Alves writes: > A bit of self-review... > > I did the same mistake I did recently, again. Here: > >> -if { ![prepare_for_testing "failed to prepare" $testfile $srcfile "$compile_flags additional_flags=-DPROTOTYPES"] } { >> +if { ![prepare_for_testing "failed to prepare" $testfile-1 $srcfile "$compile_flags additional_flags=-DPROTOTYPES"] } { >> perform_all_tests 1 >> } >> >> with_test_prefix "noproto" { >> - if { ![prepare_for_testing "failed to prepare" $testfile $srcfile \ >> + if { ![prepare_for_testing "failed to prepare" $testfile-0 $srcfile \ >> "$compile_flags additional_flags=-DNO_PROTOTYPES"] } { >> perform_all_tests 0 >> } > > Since rerun_and_prepare now always restart GDB, these prepare_for_testing calls > can be turned into build_executable calls. > > I've done that now. The testcase still passes cleanly. > > From 974b26155dd4a128a0382b3b0b08d60d78f0a0de Mon Sep 17 00:00:00 2001 > From: Pedro Alves > Date: Tue, 14 Jul 2026 19:48:30 +0100 > Subject: [PATCH] gdb.base/callfuncs.exp: Adjust for Windows > > On Windows, gdb.base/callfuncs.exp currently ends up skipping the > "noproto" tests, like: > > UNTESTED: gdb.base/callfuncs.exp: noproto: failed to prepare > > This is because the testcase tries to overwrite the executable while > GDB has the executable still open, which doesn't work on Windows: > > Executing on host: x86_64-w64-mingw32-gcc ... -o .../gdb.base/callfuncs/callfuncs > .../x86_64-w64-mingw32/bin/ld.exe: cannot open output file .../gdb.base/callfuncs/callfuncs.exe: Permission denied > > Fix this with two changes: > > - Compile the prototyped and non-prototyped executables to two > separate executables. This is just what we normally do, so that > it's convenient to test manually against either of the executables. > > - Restart GDB instead of just re-running to main. > > Strictly speaking, either of the changes alone would fix it, but I > think both are useful to do. Is this true? After the first perform_all_tests call GDB is still running and has the executable file open. Without the separate filenames the second build_executable call will try to change the executable that GDB holds open. All you've done is split prepare_for_testing into build_executable and clean_restart, but the order hasn't changed (and you call clean_restart more often now). Not that I object to these changes, I just disagree with the last sentence as I don't think the clean_restart change alone will fix the problem. Reviewed-By: Andrew Burgess Thanks, Andrew > > Change-Id: I496e0da65f9d484079c5d9a1222104bec39ee98b > --- > gdb/testsuite/gdb.base/callfuncs.exp | 26 ++++++++++++++------------ > 1 file changed, 14 insertions(+), 12 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp > index f2870c577f2..0ac1c603351 100644 > --- a/gdb/testsuite/gdb.base/callfuncs.exp > +++ b/gdb/testsuite/gdb.base/callfuncs.exp > @@ -334,12 +334,18 @@ proc fetch_all_registers {test} { > # Global used by RERUN_AND_PREPARE to make test names unique. > set rerun_count 0 > > -proc rerun_and_prepare {} { > +proc rerun_and_prepare {prototypes} { > global rerun_count > > + clean_restart $::testfile-$prototypes > + > incr rerun_count > with_test_prefix "rerun number ${rerun_count}" { > > + gdb_test_no_output "set print sevenbit-strings" > + gdb_test_no_output "set print address off" > + gdb_test_no_output "set width 0" > + > if { ![runto_main] } { > return > } > @@ -359,11 +365,7 @@ proc rerun_and_prepare {} { > } > > proc perform_all_tests {prototypes} { > - gdb_test_no_output "set print sevenbit-strings" > - gdb_test_no_output "set print address off" > - gdb_test_no_output "set width 0" > - > - rerun_and_prepare > + rerun_and_prepare $prototypes > > # Save all register contents. > set old_reg_content \ > @@ -382,7 +384,7 @@ proc perform_all_tests {prototypes} { > fail "gdb function calls preserve register contents" > } > > - rerun_and_prepare > + rerun_and_prepare $prototypes > # Save all register contents. > set old_reg_content \ > [fetch_all_registers "retrieve original register contents 2"] > @@ -408,7 +410,7 @@ proc perform_all_tests {prototypes} { > } > } > > - rerun_and_prepare > + rerun_and_prepare $prototypes > # Set breakpoint at a function we will call from gdb. > gdb_breakpoint add > # Save all register contents. > @@ -434,7 +436,7 @@ proc perform_all_tests {prototypes} { > } > } > > - rerun_and_prepare > + rerun_and_prepare $prototypes > # Set breakpoint at a function we will call from gdb. > gdb_breakpoint add > # Save all register contents. > @@ -459,7 +461,7 @@ proc perform_all_tests {prototypes} { > } > } > > - rerun_and_prepare > + rerun_and_prepare $prototypes > # Set breakpoint at a function we will call from gdb. > gdb_breakpoint add > set old_reg_content \ > @@ -547,12 +549,12 @@ proc perform_all_tests {prototypes} { > > # Perform all tests with and without function prototypes. > > -if { ![prepare_for_testing "failed to prepare" $testfile $srcfile "$compile_flags additional_flags=-DPROTOTYPES"] } { > +if { ![build_executable "failed to build" $testfile-1 $srcfile "$compile_flags additional_flags=-DPROTOTYPES"] } { > perform_all_tests 1 > } > > with_test_prefix "noproto" { > - if { ![prepare_for_testing "failed to prepare" $testfile $srcfile \ > + if { ![build_executable "failed to build" $testfile-0 $srcfile \ > "$compile_flags additional_flags=-DNO_PROTOTYPES"] } { > perform_all_tests 0 > } > > base-commit: 490469846dcef89fe53668bdbba73591c64bed61 > prerequisite-patch-id: f9480ec6b27aac188161579fdec6f08d5065ac6f > -- > 2.54.0