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: [RFAv2 1/3] New "info sources" args [-dirname | -basename] [--] [REGEXP]


>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:

Philippe> gdb/ChangeLog
Philippe> 2019-06-16  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

This commit probably needs a bit of intro text.

Philippe> +static void
Philippe> +print_info_sources_header (const char *symbol_msg,
Philippe> +			   const struct output_source_filename_data *data)
Philippe> +{
Philippe> +  printf_filtered ("Source files ");
Philippe> +  if (!data->regexp.empty ())
Philippe> +    {
Philippe> +      if (data->partial_match.dirname)
Philippe> +	printf_filtered ("(dirname ");
Philippe> +      else if (data->partial_match.basename)
Philippe> +	printf_filtered ("(basename ");
Philippe> +      else
Philippe> +	printf_filtered ("(filename ");
Philippe> +      printf_filtered ("matching regular expression \"%s\") ",
Philippe> +		       data->regexp.c_str ());
Philippe> +    }
Philippe> +  printf_filtered ("for which symbols %s:\n\n", symbol_msg);

This sort of approach isn't very i18n-friendly.  I think we've been
trying to avoid introducing new code like this, in hopes that maybe
somebody will provide gdb translations some day.

One idea might be to separate the main text from the parenthetical text,
so like:

  printf_filtered (_("Source files for which symbols have been read in"));
  if (blah)
    printf_filtered (_("(dirname matching regular expression \"%s\")"), dirname);
  ...
  printf_filtered (_(":\n"));

The "if"s could be factored into a helper function.

Otherwise this patch seems good to me.  Thanks for doing this.

Tom


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