This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] [patch] 'info symbol' to print more info
On Sat, Nov 15, 2008 at 9:39 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 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)));
I did this; there are only 3 if/then/else cases ...
>
>> 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.
But here, the message is already built up from 3 separate conditions,
and I am adding one more. What you are proposing then leads to a
chain of 16 if/then/else clauses. I don't think that's really
appropriate ...
>> +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.
Done.
Thanks,
--
Paul Pluzhnikov