From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 60BBE3858D1E for ; Wed, 20 Apr 2022 16:47:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 60BBE3858D1E Received: from fencepost.gnu.org ([2001:470:142:3::e]:39688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhDU9-00046v-83; Wed, 20 Apr 2022 12:47:21 -0400 Received: from [87.69.77.57] (port=4155 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhDU8-0001UW-EW; Wed, 20 Apr 2022 12:47:20 -0400 Date: Wed, 20 Apr 2022 19:47:13 +0300 Message-Id: <83r15rsnvy.fsf@gnu.org> From: Eli Zaretskii To: Simon Marchi Cc: pedro@palves.net, gdb-patches@sourceware.org, simon.marchi@efficios.com In-Reply-To: <58f0aaff-0df0-a4b9-46f3-69f0458ff2b6@polymtl.ca> (message from Simon Marchi on Wed, 20 Apr 2022 12:11:20 -0400) Subject: Re: [PATCH v2] gdbsupport: add path_join function References: <20220420002005.226872-1-simon.marchi@polymtl.ca> <834k2oszj1.fsf@gnu.org> <831qxrudo3.fsf@gnu.org> <83wnfjsq6f.fsf@gnu.org> <58f0aaff-0df0-a4b9-46f3-69f0458ff2b6@polymtl.ca> X-Spam-Status: No, score=1.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2022 16:47:27 -0000 > Date: Wed, 20 Apr 2022 12:11:20 -0400 > Cc: pedro@palves.net, gdb-patches@sourceware.org, simon.marchi@efficios.com > From: Simon Marchi > > >>> path_join ("d:/foo/bar", "d:quux"); > >> > >> What does d:quux mean? Should the "d:" be considered as a drive letter > >> here or not? > > > > Yes, of course. It always does in Windows file names. > > Then what does it mean? How is it different from d:/quux? It means 'quux' relative to the current directory on drive D:. On Windows, a process can have a separate directory on each drive, which you get to if you type "D:" (or "C:" or "X:") at the cmd prompt. By contrast, "d:/quux" means 'quux' relative to the root of drive D:, no matter what is the current directory there. > > I just wonder how we will be able to document what this function does > > and what it doesn't, because it seems like we are stopping halfway > > between a simple concatenation that just avoids multiple consecutive > > slashes and a much more heavy-weight functionality. We need to > > document our functionality well enough so that people know what to > > expect and what not to expect when they call this function. > > Since the problem is about absolute paths on the right hand side, maybe > we can just forbid passing absolute paths except for the first (left > hand side) operand. I don't really need that feature for my DWARF > fixes. Yes, I think we should limit "tricky" processing to the minimum, then it will be easier to document the behavior clearly and unequivocally.