public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andrew Burgess <aburgess@redhat.com>
Cc: tom@tromey.com, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] gdb: avoid '//' in filenames when searching for debuginfo
Date: Sat, 15 Jun 2024 15:45:13 +0300	[thread overview]
Message-ID: <86plsitlwm.fsf@gnu.org> (raw)
In-Reply-To: <87sexe7bci.fsf@redhat.com> (message from Andrew Burgess on Sat, 15 Jun 2024 11:24:13 +0100)

> From: Andrew Burgess <aburgess@redhat.com>
> Cc: tom@tromey.com, gdb-patches@sourceware.org
> Date: Sat, 15 Jun 2024 11:24:13 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> Our inputs:
> 
> File we're debugging:	d:/foo/bar/file
> Debug link name:	file.debug
> DEBUG_SUBDIRECTORY:	.debug
> debug-file-directory:   x:/baz/quux/
> sysroot:                d:/foo/
> 
> Locations checked for debug, in this order:
> 
>   1. d:/foo/bar/file.debug
>   2. d:/foo/bar/.debug/file.debug
>   3. x:/baz/quux/d/foo/bar/file.debug
>   4. x:/baz/quux/bar/file.debug
>   5. d:/foo/x:/baz/quux/bar/file.debug
> 
> Of these, only (5) is obviously wrong I think as it didn't consider that
> the debug-file-directory might be an absolute path on a DOS based host.
> This code was introduced in commit:
> 
>   commit 402d2bfec425f29c5b54089d5ff98ca9a1b8ec27
>   Date:   Tue Feb 12 13:56:16 2019 -0800
>   
>       Look for separate debug files in debug directories under a sysroot.

That should be fixed, IMO.

> As far as _this_ commit is concerned the _only_ change that might impact
> DOS based hosts is that, when joining absolute paths, I convert every
> instance of "//" within a path to "/".  This only happens for paths
> after the fist one though, so if the first path starts with
> "//server/file" that will remain as it is.  But if we try to do this:
> 
>   combine_paths ("//server_a/aaa", "//server_b/bbb")
> 
> then we'd get:
> 
>   "//server_a/aaa/server_b/bbb"
> 
> which might not be what we want.

Given that we convert d:/ into d/ for the purposes of concatenation, I
think "//server_a/aaa/server_b/bbb" _is_ what we want.

> Dealing with UNC paths in general is going to require more extensive
> work I suspect.

Maybe, but right now it sounds like we are either already close or
maybe even there.

Thanks.

  reply	other threads:[~2024-06-15 12:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-13  9:56 [PATCH 0/2] find debug by debuglink minor fixes Andrew Burgess
2024-06-13  9:56 ` [PATCH 1/2] gdb: avoid '//' in filenames when searching for debuginfo Andrew Burgess
2024-06-13 16:46   ` Tom Tromey
2024-06-14  8:58     ` Andrew Burgess
2024-06-14 11:06       ` Eli Zaretskii
2024-06-14 13:29         ` Andrew Burgess
2024-06-14 14:18           ` Eli Zaretskii
2024-06-15 10:24             ` Andrew Burgess
2024-06-15 12:45               ` Eli Zaretskii [this message]
2024-06-15 15:28                 ` Andrew Burgess
2024-06-15 15:33                   ` Andrew Burgess
2024-06-15 16:11                   ` Eli Zaretskii
2024-06-14 17:48           ` Pedro Alves
2024-06-15  9:54             ` Andrew Burgess
2024-06-14 14:23       ` Tom Tromey
2024-06-15  9:53         ` Andrew Burgess
2024-06-13  9:56 ` [PATCH 2/2] gdb: fix a target: prefix issue in find_separate_debug_file Andrew Burgess

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=86plsitlwm.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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).