+2009-05-23 Eli Zaretskii <eliz@gnu.org>
+
+ * symmisc.c (dump_symtab): Switch the current language to
+ the language of the symtab we are dumping only if the symtab's
+ language is neither language_auto nor language_unknown.
+
+ * coffread.c (coff_symtab_read): Set language_minimal as the
+ language for the "_globals_" pseudo-file.
+
2009-05-22 Pedro Alves <pedro@codesourcery.com>
* target.h (struct section_table): Rename to ...
coff_end_symtab (objfile);
coff_start_symtab ("_globals_");
+ /* coff_start_symtab will set the language of this symtab to
+ language_unknown, since such a ``file name'' is not
+ recognized. Override that with the minimal language to
+ allow printing values in this symtab. */
+ current_subfile->language = language_minimal;
complete_symtab ("_globals_", 0, 0);
/* done with all files, everything from here on out is globals */
}
dump_symtab (struct objfile *objfile, struct symtab *symtab,
struct ui_file *outfile)
{
- enum language saved_lang;
-
/* 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);
+ language to print an image of the symbol. We'll restore it later.
+ But use only real languages, not placeholders. */
+ if (symtab->language != language_unknown
+ && symtab->language != language_auto)
+ {
+ enum language saved_lang;
+
+ saved_lang = set_language (symtab->language);
- dump_symtab_1 (objfile, symtab, outfile);
+ dump_symtab_1 (objfile, symtab, outfile);
- set_language (saved_lang);
+ set_language (saved_lang);
+ }
+ else
+ dump_symtab_1 (objfile, symtab, outfile);
}
void