summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2009-05-23 09:26:06 +0000
committerEli Zaretskii <eliz@gnu.org>2009-05-23 09:26:06 +0000
commitc9450d295464fa7ae68f07e5e9e25a1f61ee2d34 (patch)
treef84cc01da1e487f805891cc64e39ebe96c76263e /gdb
parent7fcf9c4c3d5b0c5d46d37f1a1f6e8f719829c04e (diff)
downloadgdb-c9450d295464fa7ae68f07e5e9e25a1f61ee2d34.tar.gz
* 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/coffread.c5
-rw-r--r--gdb/symmisc.c19
3 files changed, 27 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c536c732f4d..1cfc3ee6618 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+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 ...
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 6059d68b4c8..c5b5722c7fa 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -758,6 +758,11 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
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 */
}
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 2e25c896df3..96fabc3c04c 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -496,16 +496,23 @@ static void
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