This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] Try both make_relative_prefix{,ignore_links} for relocatability
- From: Pedro Alves <palves at redhat dot com>
- To: Doug Evans <dje at google dot com>, gdb-patches at sourceware dot org
- Date: Tue, 29 Sep 2015 12:01:03 +0100
- Subject: Re: [PATCH 1/2] Try both make_relative_prefix{,ignore_links} for relocatability
- Authentication-results: sourceware.org; auth=none
- References: <047d7b15fd01af6a62051d214793 at google dot com>
On 08/12/2015 07:20 PM, Doug Evans wrote:
> - }
> +/* Relocate a directory.
> + INITIAL is the default value of the directory.
> + FLAG is true if the value is relocatable, false otherwise.
Nit: why not s/FLAG/RELOCATABLE/ then?
> + If the result is a directory, it is used; otherwise, INITIAL is used.
> + The chosen directory is then canonicalized using lrealpath. This
> + function always returns a newly-allocated string. */
> +
> +char *
> +relocate_gdb_directory (const char *initial, int flag)
> +{
> + char *dir;
>
> - return dir;
> + /* Early exit if there's nothing we can do. */
> + if (initial[0] == '\0')
> + return xstrdup ("");
> + if (!flag)
> + return maybe_lrealpath (xstrdup (initial));
> +
Thanks,
Pedro Alves