This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] Try both make_relative_prefix{,ignore_links} for relocatability


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]