This is the mail archive of the gdb-patches@sources.redhat.com 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: [RFC/RFA] Set current language when dumping symtab


(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


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