Index: symmisc.c =================================================================== RCS file: /cvs/src/src/gdb/symmisc.c,v retrieving revision 1.38 diff -u -p -r1.38 symmisc.c --- symmisc.c 14 Feb 2005 14:37:38 -0000 1.38 +++ symmisc.c 4 May 2005 00:10:06 -0000 @@ -37,6 +37,7 @@ #include "gdb_regex.h" #include "gdb_stat.h" #include "dictionary.h" +#include "ui-out.h" #include "gdb_string.h" #include "readline/readline.h" @@ -440,8 +441,8 @@ dump_psymtab (struct objfile *objfile, s } static void -dump_symtab (struct objfile *objfile, struct symtab *symtab, - struct ui_file *outfile) +dump_symtab_1 (struct objfile *objfile, struct symtab *symtab, + struct ui_file *outfile) { int i; struct dict_iterator iter; @@ -533,6 +534,26 @@ dump_symtab (struct objfile *objfile, st } } +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); + + TRY_CATCH (except, RETURN_MASK_ERROR) + { + dump_symtab_1 (objfile, symtab, outfile); + } + + set_language (saved_lang); +} + void maintenance_print_symbols (char *args, int from_tty) { Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.726 diff -u -p -r1.726 Makefile.in --- Makefile.in 2 May 2005 12:05:11 -0000 1.726 +++ Makefile.in 4 May 2005 00:10:31 -0000 @@ -2643,7 +2643,7 @@ symmisc.o: symmisc.c $(defs_h) $(symtab_ $(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \ $(gdb_obstack_h) $(exceptions_h) $(language_h) $(bcache_h) \ $(block_h) $(gdb_regex_h) $(dictionary_h) $(gdb_string_h) \ - $(readline_h) + $(readline_h) $(ui_out_h) symtab.o: symtab.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ $(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \ $(gdbcmd_h) $(call_cmds_h) $(gdb_regex_h) $(expression_h) \