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] gdb: set filename-display shortpath support


> From: Azat Khuzhin <a3at.mail@gmail.com>
> Cc: Azat Khuzhin <a3at.mail@gmail.com>
> Date: Mon,  9 Dec 2013 13:01:36 +0400
> 
> Display only non-common part of filename and compilation directory

Thanks.

> +  for (;;)
> +    {
> +      size_t min_part_len;
> +
> +      slash_name = strstr (slash_name, SLASH_STRING);
> +      slash_dir = strstr (slash_dir, SLASH_STRING);
> +      if (slash_name == NULL || slash_dir == NULL)
> +        break;

It is wrong to use SLASH_STRING to search for directory separators;
that is non-portable.  SLASH_STRING is for constructing file names
from directories and the basename.

To look for directory separators, please use lbasename, ldirname, or
similar functions, which already know about possible separators on
each supported platform.

> @@ -2093,9 +2137,11 @@ is not specified, print all substitution rules."),
>  Set how to display filenames."), _("\
>  Show how to display filenames."), _("\
>  filename-display can be:\n\
> -  basename - display only basename of a filename\n\
> -  relative - display a filename relative to the compilation directory\n\
> -  absolute - display an absolute filename\n\
> +  basename  - display only basename of a filename\n\
> +  relative  - display a filename relative to the compilation directory\n\
> +  absolute  - display an absolute filename\n\
> +  shortpath - display only non-common part of filename and compilation \
> +directory\n\

This should use "filenames", not "a filename", since the option
affects any displayed file name, not just one of them.

>  By default, relative filenames are displayed."),

This is ambiguous.  I suggest to say "The default is \"relative\"."

Sorry for not paying attention when you first posted the patch.


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