From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Bu5mH5OaS2o9uykAWB0awg (envelope-from ) for ; Mon, 06 Jul 2026 08:07:47 -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=LNNplPNa; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 6B83F1E070; Mon, 06 Jul 2026 08:07:47 -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 [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 90A891E070 for ; Mon, 06 Jul 2026 08:07:46 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F320A4BA2E17 for ; Mon, 6 Jul 2026 12:07:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F320A4BA2E17 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=LNNplPNa 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 E5BE44BA2E05 for ; Mon, 6 Jul 2026 12:07:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E5BE44BA2E05 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 E5BE44BA2E05 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=1783339642; cv=none; b=dDlKf8DOMWGEK+RiUXmXRNhIOhwt4OSfRfder52d/daeGDQGGlBD7RhSNJDoaugatd+broGpvbepvHILX4O9KRJceSw/yKWaQU/QjCQc4dslbJhCxi/opdBm6TydbMNkZJu05LbjKNvun9GbQ+kxIoLmSS4R0z/7CeJT6t9DFHA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783339642; c=relaxed/simple; bh=wGfTFKfj6n3bb2gJuVSiFNBkYtp6FmPp7z29V3ts72Y=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=wMBFgzxCTKIuwMIMe4OnUzq3ymKtyOExHQKU2h8/4leJMvVdGz/jHPHIK2y6WlfDiiR75l39IjwIez1tMZlFiX5mgnQBsrkaGYjDh6dNFLq/ZNJVozMcIzwdwEkYQ4s1I9NSrKfYBoyLreLRgkWPrk8M9OXbX/bc/cQWm97gZ18= 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=LNNplPNa DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E5BE44BA2E05 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783339641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FHvqbhlsFDJNPk+JB8NGrRu8KEF9sK8yCfAfHpnVhYc=; b=LNNplPNaf/AMQoIbmbO3FzyEaZzGJQnfWpiYgfY8mNMvIDPN0lPbZRPc1hWzM9wih8v/CV Ztftl+S6BzBFAU4whVB51GCNx0OCTkOreKAtv0i1B9i/RptykUt2IdeDE+Zh+ZNhvyeLCj ZaKr47YbkfsMuJPGFVsy27vOq2bwgnc= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-360-vIcnPXmiMiaj8MCHCrefSQ-1; Mon, 06 Jul 2026 08:07:20 -0400 X-MC-Unique: vIcnPXmiMiaj8MCHCrefSQ-1 X-Mimecast-MFC-AGG-ID: vIcnPXmiMiaj8MCHCrefSQ_1783339639 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-47162f83c75so2732264f8f.1 for ; Mon, 06 Jul 2026 05:07:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783339639; x=1783944439; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FHvqbhlsFDJNPk+JB8NGrRu8KEF9sK8yCfAfHpnVhYc=; b=PIED8tD6R9gKXw1k1wyrOSlHBBOdpLCSFmSpM87lz5mysXssGhG5n8mk5A1YzYn5Nd fF+UOOmgPabkvXZNyA3OVNUWaH2Eyrteg8HRShGU23UQy6Nd5DkL75q/nhDdjmdsGZQt uVtyP40Hn7iaWJw9W+s0Pc9MGU7sqKMtEpT+ZJrjebCsJQownwo3OVcGIBruyA0HLTvm FAE4UgE0x8FTwVauxtlijIpvtDB21QLdGCcM+LrbE8dbygpsXBpCOoaK75ON6u8R/OOa z6DGgZsPZ7qJgNyTGmL/LC31AfLiDLSv4dB2OvDBphWnTvknPDuZn59OQTLInT8zWVBF dORg== X-Gm-Message-State: AOJu0YxyIFPGbVICbW0htw1H88S6gDuCM7nNN7+o6HRiMyLv/+uUAg23 NjIRcPkQbtvEYVTCUoGYgY9i3TZxHMN1n5Xjsk1CJjzvKtXOkHuJjRrB8xeWJSwMXyrO4iT3rqm ircAyzfT7XjtZqDqQfFvOgQ4HbKNKBQxyeMyMa4JGb/AFVwtwiJPomhYBTPnw2yo= X-Gm-Gg: AfdE7cnwEwtnduUj82EQ8HKxlW8Wbneu6MjMoRyJVToC54Izd9NOcWQi0hFv6d/DKEr cpfgpsA/Hm/lsh1pJgDi5ab01Cf/AP97rCd9lu8X0XAriUKKOG1eyC27mCTcA11qdkWcf4aEy/t zqP9iNkgWox1ifOsXvFxeMbO1FFholhS83LVf5jFKaVn59urUlZcpgapVE4+D5HKb0q0stmPHU/ 4s+v0HnbofWZ0lIZIsrWqXO5YzEKnF8Yn0WovbKKlFOII0ndV/PmzfeoHzntGnAFtZvjYYPnzyi 24vX6v6i2sArvGlnBPipSwNeHd1V6MPAPbNsgjhHGoyKZCmgmD1PkzBlSe/b11f4FVqqiIPISvl TcYyN830= X-Received: by 2002:a05:600c:5805:b0:493:b36b:4933 with SMTP id 5b1f17b1804b1-493c9b3dd8cmr107848635e9.3.1783339638999; Mon, 06 Jul 2026 05:07:18 -0700 (PDT) X-Received: by 2002:a05:600c:5805:b0:493:b36b:4933 with SMTP id 5b1f17b1804b1-493c9b3dd8cmr107848335e9.3.1783339638422; Mon, 06 Jul 2026 05:07:18 -0700 (PDT) Received: from localhost ([31.111.209.233]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47a9e4d6da9sm23689125f8f.12.2026.07.06.05.07.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 05:07:15 -0700 (PDT) From: Andrew Burgess To: Pedro Alves , Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2] Windows: Normalize backward slashes to forward slashes In-Reply-To: References: <20260629212430.340516-1-pedro@palves.net> <867bnge0bc.fsf@gnu.org> <86qzlocbb4.fsf@gnu.org> Date: Mon, 06 Jul 2026 13:07:14 +0100 Message-ID: <8733xwuxsd.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Owyk1Luvkl1m3fJxqWoL8rMDwma6SNa9P8RTfyo0p4M_1783339639 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: > diff --git a/gdb/filesystem.h b/gdb/filesystem.h > index 49f8e791ec4..d48d2508c70 100644 > --- a/gdb/filesystem.h > +++ b/gdb/filesystem.h > @@ -19,6 +19,8 @@ > #ifndef GDB_FILESYSTEM_H > #define GDB_FILESYSTEM_H > > +#include "gdbsupport/pathstuff.h" > + > extern const char file_system_kind_auto[]; > extern const char file_system_kind_unix[]; > extern const char file_system_kind_dos_based[]; > @@ -55,4 +57,45 @@ extern const char *target_lbasename (const char *kind, const char *name); > result from this function. */ > extern const char *effective_target_file_system_kind (void); > > +/* Return true if GDB should normalize backslashes to forward slashes. > + This is true if GDB is running on a system with a DOS-based > + filesystem (e.g., Windows), or, if cross debugging and the target > + itself has a DOS-based filesystem (e.g., remote debugging Windows > + GDBserver from Linux). */ > +extern bool should_normalize_slashes (); > + > +/* Normalizes backslashes to forward slashes in a path string if > + necessary, extending the lifetime of the normalized copy for the > + duration of the object's scope. > + > + The constructor takes a pointer-to-pointer and updates *PATH to > + point at the normalized string when normalization is needed, so > + callers need only: > + > + scoped_normalized_path path_storage (&path); > + > + and then use PATH directly without a separate reassignment. */ > +struct scoped_normalized_path > +{ > + explicit scoped_normalized_path (const char **path) > + { > + gdb_assert (path != nullptr); It's not a problem in any of the existing code, but maybe also: gdb_assert (*path != nullptr); otherwise we end up trying to create a std::string from NULL. I looked through the rest of the changes, and it all looks reasonable to me. Reviewed-By: Andrew Burgess Thanks, Andrew