public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: pedro@palves.net, gdb-patches@sourceware.org, simon.marchi@efficios.com
Subject: Re: [PATCH v2] gdbsupport: add path_join function
Date: Wed, 20 Apr 2022 12:11:20 -0400	[thread overview]
Message-ID: <58f0aaff-0df0-a4b9-46f3-69f0458ff2b6@polymtl.ca> (raw)
In-Reply-To: <83wnfjsq6f.fsf@gnu.org>

On 2022-04-20 11:57, Eli Zaretskii wrote:
>> Date: Wed, 20 Apr 2022 10:45:07 -0400
>> Cc: gdb-patches@sourceware.org, simon.marchi@efficios.com
>> From: Simon Marchi <simon.marchi@polymtl.ca>
>>
>>>   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?

>>> IOW, do we really want this function to become as complex as
>>> expand-file-name in Emacs?
>>
>> On top of what Pedro already said, I just want to note that I'm not
>> looking to support all possible edge cases here, especially with Windows
>> makings things quite complex.
>>
>> The original intent here is to have a slightly smart join function that
>> avoids the double slash issue (to avoid leading double slashes, as you
>> pointed out) and also for esthetic reasons, should the paths be printed
>> to the user.  If we do want more, then let's just backport
>> std::filesystem::path or require C++17, there's no point in
>> reimplementing std::filesystem::path.
> 
> 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.

Simon

  reply	other threads:[~2022-04-20 16:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20  0:20 Simon Marchi
2022-04-20  6:08 ` Eli Zaretskii
2022-04-20 11:52 ` Pedro Alves
2022-04-20 12:35   ` Eli Zaretskii
2022-04-20 12:38     ` Pedro Alves
2022-04-20 12:45       ` Eli Zaretskii
2022-04-20 13:12         ` Pedro Alves
2022-04-20 14:45         ` Simon Marchi
2022-04-20 15:57           ` Eli Zaretskii
2022-04-20 16:11             ` Simon Marchi [this message]
2022-04-20 16:47               ` Eli Zaretskii
2022-04-20 17:31               ` Pedro Alves
2022-04-20 17:22           ` Pedro Alves
2022-04-20 17:35             ` Simon Marchi
2022-04-20 17:44               ` Pedro Alves
2022-04-20 14:55   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58f0aaff-0df0-a4b9-46f3-69f0458ff2b6@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    --cc=simon.marchi@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).