From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cROgHQyzVmpEfwgAWB0awg (envelope-from ) for ; Tue, 14 Jul 2026 18:07:08 -0400 Received: by simark.ca (Postfix, from userid 112) id 753C71E033; Tue, 14 Jul 2026 18:07:08 -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 [38.145.34.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 0DAB31E033 for ; Tue, 14 Jul 2026 18:07:08 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BD9CA4BA79A0 for ; Tue, 14 Jul 2026 22:07:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD9CA4BA79A0 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by sourceware.org (Postfix) with ESMTPS id C3A114BA2E32 for ; Tue, 14 Jul 2026 22:06:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C3A114BA2E32 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 C3A114BA2E32 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784066802; cv=none; b=rLoQfIwuSJ7iSejiDk+AuRVBbM44XcQh9mPEtTfLd7QPSsAiGlfxF7jccrPsYC2Kb2viGHpqkUXM0Hm51n2eoj8zR28sAfD1SdsdMlbH/oMwaq2uycLgz1DgwyVwquKYl20h5wSqnYLbNeGo8YGe4pcNGXXJP/jxawNclEJ0nSk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784066802; c=relaxed/simple; bh=AvKkV5FlK9DB1Ld4csAU9jpYsO2GZ/XFAG9+/KH78uA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=vnDw7MHO9LbQbs9EJn7rpd4yJUCHjLUg7gi8oet0xpKv8Do8F+IPb0evLtrI75U/8T9HPXfkDG55+3BafoDtmxu0dMbaK0IJKELnuYjDO8FaoaPim6vvOyuZyN4Xu3cqd9TfDBcY3nc3M+1NyFkhR2dwhSCKM7fv8KcZDjgBgVg= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3A114BA2E32 Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-472326ca506so3918165f8f.2 for ; Tue, 14 Jul 2026 15:06:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784066801; x=1784671601; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=cdHKG3JI+2ReApB7KUsjQv6CekTdqO1GNW8kgvwSf94=; b=I0PIp/58PNS3qNfRXm+vDSet4Re2b9t+0hIWBA6xUETwzeZJifaIj+MrezRdsD2GKa emMoQGmB1jMM1BF/vLmPaDthbiydiTr6NKGeGaHsJDCKWFkGNSBFm+Dq8/4O5E+R8xWu uhj6Iw8O3wQG5nIoRfWYwWSidB/QxRa0gAHmCizLDZlQPwCQWsZT++c/hBRJuVhFKtt1 m1I0UlKYddx4jE+T7e4aSPDPSl76KfyJsr3t1VJy1eVLpZco6mUe8IZzqKisbXLdBGO0 jO9f7nDVmd3BVvx8iLmyvHP+VwMyAHWNbD1EgIZ7E/fI9C4k2YJhITGrSE2eJZADogO1 v1NQ== X-Gm-Message-State: AOJu0YyRnRGB/6M9aSt7fY0lFlUZecwK8oDrQn7gdsqSX84dXqK/CtZh SRCc4FRt0t65DVDo1CvcdD4t0d97us1Hdz5GG1ucDeZtXNb4BVQpyvGGqoeU0nCk X-Gm-Gg: AfdE7ckMDYNAmImbMcaUfLMghfVfq+uO6f5GDjiUsnRutgNMIRhE21NavMi50yLJ6Ud 2xEBvlErfcfagoc9K/NGno+/9qVTfRSr8Q6RXf8UbjNfgyuYWzAYFbehjJA24Df51ivjbuXrldD hIf/WZnnrylv76yJy0ns9w81lxeJ+0KYnrVCJSK+oI/mWQ2FWSvVzkKQ7mGEmgTtVsm/iuiALMS SbPgqzV+ZlviylzQ88oDaSZNVqN39Dx2SxsfzLfNpEe1hCXwYyn6vgwIXuMjB6MuZ0I1Uh8r+/l 1PE4PWk1wNloXMQNNw9k6klmT1aLrBbEvIos6WvudHsuF0ZDeckKFRjD/36nzXn3XBl7H7/82a/ I8vwtssU0SOIHMBrGIkvzoABP4vKnASRc+SAD5lrpscobFtbMHUm2g3xfenSmnXcfRfT5cFtaJj eO2sAIS4vS+Jk= X-Received: by 2002:a05:600c:283:b0:490:688b:f9f8 with SMTP id 5b1f17b1804b1-49518306db9mr43023555e9.27.1784066800526; Tue, 14 Jul 2026 15:06:40 -0700 (PDT) Received: from localhost ([2001:8a0:fae3:3700:4d25:7ae8:520f:e7a8]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-4950a322c86sm96144765e9.11.2026.07.14.15.06.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jul 2026 15:06:40 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 2/4] gdb.base/callfuncs.exp: Adjust for Windows Date: Tue, 14 Jul 2026 23:06:29 +0100 Message-ID: <20260714220631.1499846-3-pedro@palves.net> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260714220631.1499846-1-pedro@palves.net> References: <20260714220631.1499846-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 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..f020100ce8b 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 { ![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 } -- 2.54.0