From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yevGB4m3VmpIgwgAWB0awg (envelope-from ) for ; Tue, 14 Jul 2026 18:26:17 -0400 Received: by simark.ca (Postfix, from userid 112) id 157251E09E; Tue, 14 Jul 2026 18:26:17 -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 65C3A1E033 for ; Tue, 14 Jul 2026 18:26:16 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 913AD4BA2E20 for ; Tue, 14 Jul 2026 22:26:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 913AD4BA2E20 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by sourceware.org (Postfix) with ESMTPS id 83C5E4BA2E20 for ; Tue, 14 Jul 2026 22:25:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 83C5E4BA2E20 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 83C5E4BA2E20 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784067946; cv=none; b=wZKEnT1GhOUobF5HjQ64YMVvnZh/3sjS+NM+gcEe6h2FNxIHfdXNx3Rp//8xDy/TeaVmiRJHezt2+dXDVwa0f3ecGt0txu6OMdbE4ASIshDxYY5It1jVb4J7L29yKIxhMNcRDRoINORjZbR/5lEbSiSaQU/TZw6Q720ap3Gr7nw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784067946; c=relaxed/simple; bh=NQXUex/55GwsgqHa3LyxP97EaZg9d/Jjrdu8RK1un2U=; h=Message-ID:Date:MIME-Version:Subject:From:To; b=u02Rnp5bF+TIRn63CosiaNbhdKV2FrbK+egPid/6E16GN1d+Vwuu1wEP5ix2jPBUQFrrNh+aq/oX+gIeR0GMpBfqXLA810KiCmo7aBaJ1osFZmU47rKJr0uKP+fKyPEKY6eJwhw4cADprpJhnfvyml8QgECKfe6Wmmfj37cHd4g= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83C5E4BA2E20 Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-47640541585so2318231f8f.1 for ; Tue, 14 Jul 2026 15:25:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784067945; x=1784672745; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:to:from: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=V/Yi0mUstISBrtpyZ01SccrozPcp9sFACOkkzBPYJL0=; b=QrulB+GcTnziJb7s1F0nZveY+1XacSqgzrhBuu/sZJmaVsci/OIYzVlmyVvdn6J3Z8 TdfZnIf8GmG51heG/TVnSH0Sx05EGdrc5dCupUFjzyOHkSRk1weQ7BC/2lVpBDr9XCMB +DlFXsZgVinWC0I1VElQwMxBNMmgWmRvQlicjK2SRS6xC9BQcFh5Fvsp8xZacAJNtUpC e/lmMwEWLh+Zq7I3DXuZk5Jq9qDq4C2YfFV8SlrtO4G2dl7SumLpUkZtK65DC1vtYlXf BTBMus7RUsIz6ui7+XlZOWTkNTdOu73gaUO7UbW2FPkyDXZRoDzlwoIY1DC+ouWehYfu ZZcQ== X-Gm-Message-State: AOJu0YzeyQC/hdOP2FldJNlRRK4DM/AQXDK8/uDy0LwooiQiCnWtEx0N X2Us+JUyg9IEDjzHCEjB0ztd3aicd+djX7tFCNt0GTOKzbErwfRUaLyL7+g+76Uv X-Gm-Gg: AfdE7cnQMTJkgHtM/CpowvnGhUJ6tcfxRF99ypiHdtx+fbodnuW4AFDviJXRLwieiVP D38IND8PkKoAF/6haWFo5zyoLY1cTOP3CX0uvRUQcQO5r5b4n6jCLQGpcspbsSi5+bEEpwLJ4d3 UZQekaYFGumXr0215XHcsgkkpSv0ieve9PNQ8vEKM2PCUjZoEUN1PJM6cugZzWR2o/zkqNM9G6G e6Sr5ubCV1SilnXzSsko2qFp9gUFS1nHQw4BISx1YeFuIxHclI/9NkEzMUy+j889BuByhX4wRAS b6NFhjtwAMNSLgw9vGJNK41MKM2Z/xl+lKdK4fs51x+c0VkIPeuciae3TPbAGvrZuzwdGfG2HZY 6CHrw/InczuLGhiqvE/NqGV47VrPY3wfnp3mGPnV1bhVLaiRa1d2NIlBSOr9HZObjfTm1AK0V/a 05v5XgFpeWPPM9sJhuJ4LkSw5Kw4ze/InuWCEdgkutpmrBPT5A1l3c0cs= X-Received: by 2002:a05:6000:2089:b0:479:190:5873 with SMTP id ffacd0b85a97d-47f4fcef63cmr263001f8f.49.1784067945246; Tue, 14 Jul 2026 15:25:45 -0700 (PDT) Received: from ?IPV6:2001:8a0:fae3:3700:4d25:7ae8:520f:e7a8? ([2001:8a0:fae3:3700:4d25:7ae8:520f:e7a8]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f4635ac2esm11718828f8f.13.2026.07.14.15.25.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jul 2026 15:25:44 -0700 (PDT) Message-ID: Date: Tue, 14 Jul 2026 23:25:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/4] gdb.base/callfuncs.exp: Adjust for Windows From: Pedro Alves To: gdb-patches@sourceware.org References: <20260714220631.1499846-1-pedro@palves.net> <20260714220631.1499846-3-pedro@palves.net> Content-Language: en-US In-Reply-To: <20260714220631.1499846-3-pedro@palves.net> 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 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. 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