From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mXpGOELXQ2oOfB8AWB0awg (envelope-from ) for ; Tue, 30 Jun 2026 10:48:34 -0400 Received: by simark.ca (Postfix, from userid 112) id E30C81E098; Tue, 30 Jun 2026 10:48:34 -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 5E0C31E024 for ; Tue, 30 Jun 2026 10:48:34 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 91E644BA23D0 for ; Tue, 30 Jun 2026 14:48:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 91E644BA23D0 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by sourceware.org (Postfix) with ESMTPS id B8F064BA23C8 for ; Tue, 30 Jun 2026 14:47:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B8F064BA23C8 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 B8F064BA23C8 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782830877; cv=none; b=DpQlBX+97NOyqWQjmxLfhEXAtwGZ/8sC7+yyQj3Cp83eswY8lfn30b2aBNs22+prWqymgPeKiy97CI47VEf1j09alQwC148pV4vzOy2bZuKsZ2j+7czBOw1KFiCUon4OoUvZQUTMURiPF5KM5osjjW06gGCGDC6z99phVjv5KkE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782830877; c=relaxed/simple; bh=TvEEok6lkZ4YPjYfhY0f6vZ3WzJE/1CydXeSL7BtFhs=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=X9I8BVot+pcqIx4LHD7qbbrLbWOkVxKryXEfrjJX2iNNlrNhq2+rN7JWKT+ePXtNVxoEZXY1aFYQ/VsGDDFaGRFmsqnkC/VHSaVDBWuKoMpBy0uK22piJoc+BBxJdBhJvpvwmbsU36of9K8AL4zuarmkpdD2CHxHuxUTqFZQf/I= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B8F064BA23C8 Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-4763b0c1dcdso497290f8f.2 for ; Tue, 30 Jun 2026 07:47:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782830876; x=1783435676; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:cc: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=ITuDx5JE35JIpTvrVp5nCHtcsKcbeZueH2lTU9l4fuY=; b=C4peCygd5eoKHtTpA6lcbdM/yfp/+/XzQNf1/r5KaC3Xppq/WvIzki1Uxd64Bt/Lzc ehlEiVJKgexfCsLuKk+BJowpYNsgwDKZKxEQr9Uv/1w7bfFaw0iJ591zm4pHquyg1rIN GJYXV98HlBr+I4vb5kQPvaBU0k24GfLsYeXejCptmyEP5NkHrTTG8xXAQ9x7QQTFsrXl NqiT2/afbbhzxHfOIqsLA82La8/gNkCypw30+Bfcn0jjndKhmvEzwrSCVAUGeWWB3SI9 EJJTTOIOAxK7KcoNkBnmV3dvVhv2CiENyNGlqxL3cpr7ZPXD8uhTPsjyseBvDpxwhiAq 4cXg== X-Gm-Message-State: AOJu0Yw+bOo0QHJ7weuHn6l8NLdIFSazxNhgFkHxVVA+JmOFfvLUY0ai UTCUf+s8KeTcJhIUCI6A/HMvEofysZUPM0giBnOVy/3KkbmB6tL90rCtQCRAQA== X-Gm-Gg: AfdE7cmVpRIoqTg3GvrgsaVXbPTASN61+LGX33DS9l/2N//YbqI6nem2eE+T9V7dVmO /LrqpVEeQ6T7aHCrNfgaoPxfJqhs0nIuAX2SmkGpw5K15mTqY6r1IHaiEjDRYTNph18miK+WIx4 IiURvb2jw8X9uFKGSxgl2X2+PgFDYBsBuDVE+PUHUnAW24i0LCY8rmAjPUiWGYduPSrz1a1IrPR 7HXzkD+Vr3WO2tXt8m3oc3FPDe2cig2EztjI6Y2JUwvDeU4R71M80le5u2Mp071p1XW3X6Yj9nz +J40YAbaD8DTiyariOOdZJ04H7mM1PJnrydDD1AE95cvzctal8bAfXwmVLCuPDhde/kSsqKQTCk R+trGyOiFjA16QbRipkmEJNjIObimFgxopa2eTMZ0We9RQVt8rEiP/V4bhnWsYD6AQ9JEyYfL1s GGUgzp3LyZ1gZePdjAMrs+eoD6tJVSHFBIx5OlevWHq7Xj9lRYXdYgONg= X-Received: by 2002:a05:6000:4028:b0:460:6a13:9131 with SMTP id ffacd0b85a97d-475511798acmr5500915f8f.19.1782830876351; Tue, 30 Jun 2026 07:47:56 -0700 (PDT) Received: from ?IPV6:2001:8a0:fac2:7700:14c0:3ecc:6c84:e1b4? ([2001:8a0:fac2:7700:14c0:3ecc:6c84:e1b4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47563d19ba6sm7744056f8f.6.2026.06.30.07.47.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Jun 2026 07:47:56 -0700 (PDT) Message-ID: Date: Tue, 30 Jun 2026 15:47:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Windows: Normalize backward slashes to forward slashes To: Eli Zaretskii Cc: gdb-patches@sourceware.org References: <20260629212430.340516-1-pedro@palves.net> <867bnge0bc.fsf@gnu.org> From: Pedro Alves Content-Language: en-US In-Reply-To: <867bnge0bc.fsf@gnu.org> 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-06-30 12:26, Eli Zaretskii wrote: >> From: Pedro Alves >> Date: Mon, 29 Jun 2026 22:24:30 +0100 >> >> Starting program: C:/msys2/home/alves/gdb/build-testsuite/outputs/gdb.rocm/simple/simple > > Are forward slashes only shown to the user, or does the code pas the > file name with forward slashes to CreateProcess? (I'm not familiar > with thecode enough to determine which one myself, sorry.) If we pass > forward slashes to CreateProcess, it could cause problems, IME; it is > much safer to use backslashes there. We now pass forward slashes down to CreateProcess. It just works on my Windows 11 machine, though. I forgot to mention, but I (painfully) ran the whole testsuite before and after this patch (that's how I discovered the need to tweak the gdb.base/set-cwd.exp testcase). Searching online, I found this: https://stackoverflow.com/questions/5652834/c-createprocess-wont-work-with-app-and-args-with-forward-slash-worked ... where someone said: "CreateProcess does work with forward-slashes on Windows 7. I'm guessing this is a version-specific feature (or bug)." And here: https://www.reddit.com/r/programmingmemes/comments/1k8ctk2/comment/mp8lvsr/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button Someone said: "At least since Windows 2000, probably since always." I asked an LLM, and got this: "That normalization is original to NT -- Windows NT 3.1 (1993). The kernel's RtlDosPathNameToNtPathName has always treated / as an alternate separator. CreateProcess itself never "added" the feature -- it just calls through to the kernel, which handles it transparently." So I wonder whether what you're recalling is something from the Windows 9x days, which we no longer support (we support WinXP and up). Do you happen to recall? If it's really a problem on supported Windows versions, it should be a matter of converting back to forward slashes before we call CreateProcess. We already do that in gdb/windows-nat.c:windows_nat_target::create_inferior, for "set cwd": /* Mirror slashes on inferior's cwd. */ std::replace (expanded_infcwd.begin (), expanded_infcwd.end (), '/', '\\'); we'd just need to do the same for exec_file. Pedro Alves