aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-30 20:05:34 -0700
committerTom Tromey <tromey@redhat.com>2014-01-15 12:06:04 -0700
commit9e6c82ad4f55d0ff125721b94fa2191f1cc1000a (patch)
tree12ef5dcf38f7ae24931ee1f2cf541cb4dc476775 /gdb/symfile.c
parent6ef55de768d4ab9065bc92aa00d828212c4af4f0 (diff)
downloadgdb-9e6c82ad4f55d0ff125721b94fa2191f1cc1000a.zip
gdb-9e6c82ad4f55d0ff125721b94fa2191f1cc1000a.tar.gz
gdb-9e6c82ad4f55d0ff125721b94fa2191f1cc1000a.tar.bz2
make language_of_main static
This makes the global language_of_main static. Now it can be set only via a new argument to set_main_name. 2014-01-15 Tom Tromey <tromey@redhat.com> * dbxread.c (process_one_symbol): Update. * dwarf2read.c (read_partial_die): Update. * symfile.c (set_initial_language): Call main_language. * symtab.c (language_of_main): Now static. (set_main_name): Add 'lang' parameter. (find_main_name): Update. (main_language): New function. (symtab_observer_executable_changed): Update. * symtab.h (set_main_name): Update. (language_of_main): Remove. (main_language): Declare.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r--gdb/symfile.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index a567f6d..06d2119 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1654,11 +1654,9 @@ symbol_file_command (char *args, int from_tty)
void
set_initial_language (void)
{
- enum language lang = language_unknown;
+ enum language lang = main_language ();
- if (language_of_main != language_unknown)
- lang = language_of_main;
- else
+ if (lang == language_unknown)
{
char *name = main_name ();
struct symbol *sym = lookup_symbol (name, NULL, VAR_DOMAIN, NULL);