diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-10-17 18:49:47 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-10-17 18:49:47 +0000 |
commit | 01f8c46dda6579913074a1d04eca0ad7fc437f47 (patch) | |
tree | a0dfa003d324672c6b0f0cbd95c2d1c27bfc6368 /gdb/symfile.c | |
parent | 8aeb23f3648c6ef10c5715e30f04563d1cc28709 (diff) | |
download | gdb-01f8c46dda6579913074a1d04eca0ad7fc437f47.zip gdb-01f8c46dda6579913074a1d04eca0ad7fc437f47.tar.gz gdb-01f8c46dda6579913074a1d04eca0ad7fc437f47.tar.bz2 |
gdb/
Fix the `stopped language detection' testcase for gcc-4.5.
* dwarf2read.c (read_partial_die): Set also LANGUAGE_OF_MAIN.
* symfile.c (set_initial_language): Move variable filename to a more
inner block. Prefer LANGUAGE_OF_MAIN.
* symtab.c (language_of_main): New variable.
(set_main_name): Always reset LANGUAGE_OF_MAIN.
* symtab.h (language_of_main): New declaration.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index cfbfd55..f1c2941 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1568,12 +1568,18 @@ symbol_file_command (char *args, int from_tty) void set_initial_language (void) { - const char *filename; enum language lang = language_unknown; - filename = find_main_filename (); - if (filename != NULL) - lang = deduce_language_from_filename (filename); + if (language_of_main != language_unknown) + lang = language_of_main; + else + { + const char *filename; + + filename = find_main_filename (); + if (filename != NULL) + lang = deduce_language_from_filename (filename); + } if (lang == language_unknown) { |