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: [RFA] [patch] 'info symbol' to print more info


> Date: Sat, 15 Nov 2008 08:42:12 -0800
> From: Paul Pluzhnikov <ppluzhnikov@google.com>
> Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
> 
> On Fri, Nov 14, 2008 at 2:54 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
> > Please also fix the places in the
> > manual where these two commands are described.
> 
> Done. Ok to commit?

Yes, but please fix a minor gotcha I point out below.

> +      printf_filtered ("%s + %s",
> +		       SYMBOL_PRINT_NAME (sym),
> +		       pulongest (address - SYMBOL_VALUE_ADDRESS (sym)));
> +      if ((sect = SYMBOL_OBJ_SECTION(sym)))
> +	{
> +	  printf_filtered (_(" in section %s"), sect->the_bfd_section->name);
> +	  if (MULTI_OBJFILE_P ()
> +	      && sect->objfile && sect->objfile->name)
> +	    printf_filtered (_(" of %s"), sect->objfile->name);
> +	}
> +      printf_filtered (_("\n"));
> +    }

This partition of a phrase into fragments means trouble for
translators.  Not every language can break the sentence

  "foo + NNN in section .text of foobar.o"

into exactly these 3 parts, like you can in English.  In addition,
translating each part without seeing the whole sentence is very
difficult.

So please rewrite this part to not break the sentence, something like
this:

  if ((sect = SYMBOL_OBJ_SECTION (sym))
       && MULTI_OBJFILE_P () && sect->objfile && sect->objfile->name)
    printf_filtered ("%s + %s in section %s of %s\n",
		     SYMBOL_PRINT_NAME (sym),
		     pulongest (address - SYMBOL_VALUE_ADDRESS (sym)),
		     sect->the_bfd_section->name, sect->objfile->name);
  else if ((sect = SYMBOL_OBJ_SECTION (sym))
    printf_filtered ("%s + %s in section %s\n",
		     SYMBOL_PRINT_NAME (sym),
		     pulongest (address - SYMBOL_VALUE_ADDRESS (sym)),
		     sect->the_bfd_section->name);
  else
    printf_filtered ("%s + %s\n",
		     SYMBOL_PRINT_NAME (sym),
		     pulongest (address - SYMBOL_VALUE_ADDRESS (sym)));

>  	  printf_filtered (_("%s overlay "),
>  			   section_is_mapped (osect) ? "mapped" : "unmapped");
>  	printf_filtered (_("section %s"), osect->the_bfd_section->name);
> +	if (MULTI_OBJFILE_P ()
> +	    && osect->objfile && osect->objfile->name)
> +	  printf_filtered (_(" of %s"), osect->objfile->name);
>  	printf_filtered ("\n");

Same here.

> +If section was not specified, the section in which the symbol was found
> +is also printed. For dynamically linked executables, the name of
                  ^^
Two spaces after a period that ends a sentence, please.


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