This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC] gdb_realpath causes problems with GVD
- From: Joel Brobecker <brobecker at ACT-Europe dot FR>
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 19 Mar 2002 23:27:59 +0100
- Subject: Re: [RFC] gdb_realpath causes problems with GVD
- References: <20020319171236.D6465@act-europe.fr> <3C978395.9040306@cygnus.com>
> I think gdb_realpath() needs a re-name - it no longer implements
> realpath() semantics. xfullpath() comes to mind (`x' for `xmalloc',
> `fullpath' cos it is close to realpath :-) (Better ideas? Does libiberty
> already provide an equivalent?)
I agree. I will wait to make sure everybody agrees to the change, and
to see if any other suggestion arises. I'll then perform the name
change.
> I don't think trying to rewriting the gdb_realpath() autoconfigury magic
> is a good idea (the rewrite as two comile errors). Instead just assume
> that gdb_realpath() works and use that, concat() and xfree().
Here is how I understand your suggestion: Rewrite gdb_realpath which
will always "work", ie return a path.
And then implement xfullpath to use it in all cases:
char *
xfullpath (const char *filename)
{
const char *base_name = [...];
char *dir_name;
char *rp;
char *temp_result;
char *result;
dir_name = [...];
rp = gdb_realpath (dir_name); /* rp will always be non-null */
temp_result = concat (rp, SLASH_CHAR, base_name);
result = xstrdup (temp_result);
xfree (rp);
xfree (temp_result);
return result;
}
--
Joel