From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ae34BvE7Wmotxg4AWB0awg (envelope-from ) for ; Fri, 17 Jul 2026 10:28:01 -0400 Received: by simark.ca (Postfix, from userid 112) id 178731E033; Fri, 17 Jul 2026 10:28:01 -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.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, 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 7036F1E033 for ; Fri, 17 Jul 2026 10:28:00 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 95ADD4BA2E1C for ; Fri, 17 Jul 2026 14:27:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95ADD4BA2E1C Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by sourceware.org (Postfix) with ESMTPS id AF7944BA2E0C for ; Fri, 17 Jul 2026 14:27:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF7944BA2E0C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AF7944BA2E0C Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.208.43 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784298452; cv=none; b=BWL+PcAcqn5bvLSP9D+iOu+XBcx3Xds5L50Qtnx9o6dq1X+ZZGSeq/i9m4BgpmIQvMntr3NNINvgw1z1Aodi7C8f3fJAoXaD8BpeGG7uPFfuY7l/AxlQ2+sTFhCgBUKTJtjZOQvuOhadrrW0ZpKX1Hagzg4IB2pOXuRrePSrAsA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784298452; c=relaxed/simple; bh=TcUIYNS+IUjOywzsc2erlf6irneceCdxmABTqxwvNLE=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=H53M3YKG0hYvs37jW+WOryVpOxtw/0Ys+bPA+rF3yziojWz379jlSTgddxcjfbMNpIy2Ao1ds8qCzdlug5ykRV74lJYk2hrKWBrNI0RJEMfTkC4GFvpGzLqYRUnaxTzIU0NrE+xYzkGXifpbCb42O2MjR2jIzosvsgZNnN+ityc= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF7944BA2E0C Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-6983f20a8bfso12683348a12.1 for ; Fri, 17 Jul 2026 07:27:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784298451; x=1784903251; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=DLdXhOwCMn22SczUn4TR6kJS2TqmcBKIf+kjPX4RDJo=; b=cu3UHc2iTtkT1X+5MtGtezc5uYfQJFTmOawGDs4qyLLa7u+rfn96uOTLZmR92pVO37 IWmJmjZdm0vQU/dkmLbTb5Az0XwOH7YU2h6JWXzQCY1FPRYd9hvzVYXgE1ae5Hw7z3Tp mNCvyJdnqfVmPDhvuicDhIx4jD8a5HhSK8g07KDxZnEIPZifbKQGEr8YeokUJW/bG/+t yUXVJMdIdkaqYiY7hnMuKmRu+nkW7srWGOoFcRjmj3Df+f5bDibQPGHCPNYZh2UNjB+T zf39/kQh/6+A+cNx5V84GR26TVFH/thILt+5xtTkM/3IC0O1uarF+2Neke4Zonv4Dway H/7Q== X-Forwarded-Encrypted: i=1; AHgh+RpJUj9uYNwf0TvvsKhht5PNWxKtzT0uPppsuYRUo6f91xLDMKdI83YAWRluYLGrFbHllGjC6uqvDnxtLA==@sourceware.org X-Gm-Message-State: AOJu0Yz2d0kWimwuZ7yjowHQ6PhSQ8d31GacOOSnr3cvsjl21yHuOSlE seqWKI7x1kXvgZixr9nHIOWWsW7s7SLIexHZ+Q52IhgomHfdAiFjvCQo9k5OOg== X-Gm-Gg: AfdE7cmVTQl+ZeWvfJmRfLGhLZhIW0LnZOPT4EBgpWFS45ijv4/0QlaN7htY5pA9XcD 6rnURnLATVnRn26Gi+YtfZqWb9ZpnZPILk7m222KmpoEAjoUEDJjCsUsYTYLJj0G3FyyseBKrbV xn5fUmmP+kEIg7WLBg0ac/z20QWy9KHMH2fj81W/relod7ejDxp6cI3BzwVtCbpw69fKXiF5JBU JB33sPhwYdUYuVNZPJwzBCU59JVPCy8JfxmRbJA+5syJTEjj/AWbDvJ0h3i9FLgKZ3azZREnqR/ rR2TeYSMpgtsyRWvFapjaCunwQy6dqTJI2eg8AX7U01NugVP2s8Xxxkvs6poVzHMpixKMwh0/HS V/i+NK35vdgjR41XT6qt6YZ7Nba7O0piVMjgr6YMChxZg0Fq5bQCsjSP69vvo7kKDsNtdilZP6S i0n/3o3L0SI7RhueoZofjk6SvsYCQ0g7VwoC0opULNf35m+gLgN0DwuCTAlmtx3a+sUg== X-Received: by 2002:a05:6402:4595:b0:698:3b7c:7e44 with SMTP id 4fb4d7f45d1cf-69e652dd9bdmr1083843a12.36.1784298451331; Fri, 17 Jul 2026 07:27:31 -0700 (PDT) Received: from ?IPV6:2001:8a0:fae3:3700:4cbf:5b0f:68f7:7a14? ([2001:8a0:fae3:3700:4cbf:5b0f:68f7:7a14]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-69e6ffbab34sm824061a12.14.2026.07.17.07.27.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Jul 2026 07:27:30 -0700 (PDT) Message-ID: <06c8b831-aa8c-4ed4-8a2d-29065f643f93@palves.net> Date: Fri, 17 Jul 2026 15:27:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/4] gdb.base/callfuncs.exp: Adjust for Windows To: Andrew Burgess , gdb-patches@sourceware.org References: <20260714220631.1499846-1-pedro@palves.net> <20260714220631.1499846-3-pedro@palves.net> <87wluud3th.fsf@redhat.com> From: Pedro Alves Content-Language: en-US In-Reply-To: <87wluud3th.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 On 2026-07-16 22:26, Andrew Burgess wrote: > Pedro Alves writes: >> 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. Right, that was sloppy last minute editing, didn't think it that well. Sorry about that. I was originally going to add add a gdb_exit before the second compilation, but that would end up more complicated, and I realized I might as well make the programs have different names, and clean_restart is handy to reload the new executable, and so I didn't need the gdb_exit any longer... > 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 > I've removed that last sentence, and added "to pick up the new executable." to the preceding one. >From a08b0bf87322cc11aace49407382e0f9c4e92078 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, to pick up the new executable. 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: 4252e00ad379be8852a564f351cbd3e3b8a5f0ec -- 2.54.0