From: Tom Tromey <tom@tromey.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Guard against 'current_directory == NULL' on gdb_abspath (PR gdb/23613)
Date: Thu, 11 Jul 2019 16:05:00 -0000 [thread overview]
Message-ID: <87h87sblqg.fsf@tromey.com> (raw)
In-Reply-To: <20190710234615.14800-1-sergiodj@redhat.com> (Sergio Durigan Junior's message of "Wed, 10 Jul 2019 19:46:15 -0400")
>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
Sergio> So I fixed the problem with the patch below. The idea is that, if
Sergio> 'current_directory' is NULL, then the final string returned should be
Sergio> just the "path".
I found other spots relying on current_directory in this way, so I
wonder if this is the best approach.
For example, corelow.c:
gdb::unique_xmalloc_ptr<char> filename (tilde_expand (arg));
if (!IS_ABSOLUTE_PATH (filename.get ()))
filename.reset (concat (current_directory, "/",
filename.get (), (char *) NULL));
I guess this should just be converted to gdb_abspath?
... but also code in source.c and some other spots.
If this approach is the right one -- and it seems like it could be --
then the function documentation should at least be updated to reflect
this error case.
Tom
next prev parent reply other threads:[~2019-07-11 16:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-10 23:46 Sergio Durigan Junior
2019-07-11 16:05 ` Tom Tromey [this message]
2019-07-12 1:21 ` Sergio Durigan Junior
2019-11-21 19:37 ` [PATCH v2] " Sergio Durigan Junior
2019-12-10 16:21 ` Sergio Durigan Junior
2019-12-13 22:23 ` Tom Tromey
2019-12-14 4:50 ` Sergio Durigan Junior
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=87h87sblqg.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=sergiodj@redhat.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).