From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17928 invoked by alias); 1 Jun 2005 01:29:50 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 17849 invoked by uid 22791); 1 Jun 2005 01:29:40 -0000 Received: from s142-179-108-108.bc.hsia.telus.net (HELO takamaka.act-europe.fr) (142.179.108.108) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 01 Jun 2005 01:29:40 +0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id C387447959; Tue, 31 May 2005 18:29:32 -0700 (PDT) Date: Wed, 01 Jun 2005 01:29:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: Re: [RFC/RFA] Set current language when dumping symtab Message-ID: <20050601012932.GK2014@adacore.com> References: <20050504001955.GE2439@adacore.com> <20050528234905.GF22435@nevyn.them.org> <20050529021056.GF18754@adacore.com> <20050529025401.GA14380@nevyn.them.org> <20050530054538.GM18754@adacore.com> <20050530195338.GO18754@adacore.com> <20050530195458.GB31201@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050530195458.GB31201@nevyn.them.org> User-Agent: Mutt/1.4i X-SW-Source: 2005-06/txt/msg00001.txt.bz2 (back online after 24h of flight :-) On Mon, May 30, 2005 at 03:54:58PM -0400, Daniel Jacobowitz wrote: > On Tue, May 31, 2005 at 05:53:39AM +1000, Joel Brobecker wrote: > > +static void > > +dump_symtab (struct objfile *objfile, struct symtab *symtab, > > + struct ui_file *outfile) > > +{ > > + enum language saved_lang; > > + volatile struct gdb_exception except; > > + > > + /* Set the current language to the language of the symtab we're dumping > > + because certain routines used during dump_symtab() use the current > > + language to print an image of the symbol. We'll restore it later. */ > > + saved_lang = set_language (symtab->language); > > + > > + dump_symtab_1 (objfile, symtab, outfile); > > + > > + set_language (saved_lang); > > +} > > + > > Except now except is unused, Argh! I had removed it and some undo/redo manipulations put it back without me noticing... I will fix this, thanks! > and there's no reason not to fold this into dump_symtab. I tend to still prefer the folding, because I find it clearer that way. And if for any reason we change the implementation of dump_symtab_1 to have an early return somewhere in the code, we're not in danger of forgetting to reset the language. But I'm happy either way. Let me know which you prefer, and I'll submit a new patch. -- Joel