public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Andrew Burgess <aburgess@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] gdb: avoid '//' in filenames when searching for debuginfo
Date: Fri, 14 Jun 2024 08:23:58 -0600	[thread overview]
Message-ID: <87sexfd2m9.fsf@tromey.com> (raw)
In-Reply-To: <87msnn99zy.fsf@redhat.com> (Andrew Burgess's message of "Fri, 14 Jun 2024 09:58:09 +0100")

>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

Andrew> You're absolutely right.  And I see what's happened.  Somewhere along
Andrew> the line the logic has gotten reversed in my head.  The problem isn't
Andrew> that the first _must_ be absolute with path_join, it's that everything
Andrew> else _must_not_ be absolute, see these lines in path_join:

Andrew>       if (i > 0)
Andrew> 	gdb_assert (strlen (path) == 0 || !IS_ABSOLUTE_PATH (path));

Andrew> And for what we're doing here we, for example, join the path to the file
Andrew> (which is absolute) onto the debug directory, which might, or might not,
Andrew> be absolute, e.g. these lines in find_separate_debug_file:

I'm sorry to go around on this again, but what if we just remove this
restriction from path_join?  It seems to me that removing an assertion
can't break any existing callers, and it's fairly normal in other code
bases for path-joining to work this way (that is, an absolute path
causes a "start over").

Tom

  parent reply	other threads:[~2024-06-14 14:24 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
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 [this message]
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=87sexfd2m9.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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).