From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5067 invoked by alias); 15 Nov 2008 18:23:14 -0000 Received: (qmail 4959 invoked by uid 22791); 15 Nov 2008 18:23:13 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 15 Nov 2008 18:22:33 +0000 Received: from wpaz33.hot.corp.google.com (wpaz33.hot.corp.google.com [172.24.198.97]) by smtp-out.google.com with ESMTP id mAFIMU0H018780 for ; Sat, 15 Nov 2008 10:22:30 -0800 Received: from wa-out-1112.google.com (wafl35.prod.google.com [10.114.188.35]) by wpaz33.hot.corp.google.com with ESMTP id mAFIMSLA010915 for ; Sat, 15 Nov 2008 10:22:29 -0800 Received: by wa-out-1112.google.com with SMTP id l35so996506waf.16 for ; Sat, 15 Nov 2008 10:22:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.131.9 with SMTP id e9mr1417351wad.0.1226773348598; Sat, 15 Nov 2008 10:22:28 -0800 (PST) In-Reply-To: References: <20081114204617.A4A533A6B15@localhost> <491DF12A.5090903@vmware.com> <8ac60eac0811141406h4bb126c0sbd898e7d612f46dd@mail.gmail.com> <491E08BF.2050609@vmware.com> <8ac60eac0811150842x78206050t435c6f8c89ddc8ae@mail.gmail.com> Date: Sun, 16 Nov 2008 01:38:00 -0000 Message-ID: <8ac60eac0811151022w13df6899v13bb321ee08aae09@mail.gmail.com> Subject: Re: [RFA] [patch] 'info symbol' to print more info From: Paul Pluzhnikov To: Eli Zaretskii Cc: msnyder@vmware.com, gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00393.txt.bz2 On Sat, Nov 15, 2008 at 9:39 AM, Eli Zaretskii 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