Handle pending stops from the Windows kernel
[deliverable/binutils-gdb.git] / gdb / symfile.c
index f1edf2dca5dd128ee1f70c30c1801c2d9b981088..bd27a1fefef16a5723c8e50c6cf4cd8f729ea9f9 100644 (file)
@@ -1667,16 +1667,7 @@ symbol_file_command (const char *args, int from_tty)
     }
 }
 
-/* Set the initial language.
-
-   FIXME: A better solution would be to record the language in the
-   psymtab when reading partial symbols, and then use it (if known) to
-   set the language.  This would be a win for formats that encode the
-   language in an easily discoverable place, such as DWARF.  For
-   stabs, we can jump through hoops looking for specially named
-   symbols or try to intuit the language from the specific type of
-   stabs we find, but we can't do that until later when we read in
-   full symbols.  */
+/* Set the initial language.  */
 
 void
 set_initial_language (void)
@@ -1684,11 +1675,15 @@ set_initial_language (void)
   if (language_mode == language_mode_manual)
     return;
   enum language lang = main_language ();
+  /* Make C the default language.  */
+  enum language default_lang = language_c;
 
   if (lang == language_unknown)
     {
       const char *name = main_name ();
-      struct symbol *sym = lookup_symbol (name, NULL, VAR_DOMAIN, NULL).symbol;
+      struct symbol *sym
+       = lookup_symbol_in_language (name, NULL, VAR_DOMAIN, default_lang,
+                                    NULL).symbol;
 
       if (sym != NULL)
        lang = sym->language ();
@@ -1696,8 +1691,7 @@ set_initial_language (void)
 
   if (lang == language_unknown)
     {
-      /* Make C the default language */
-      lang = language_c;
+      lang = default_lang;
     }
 
   set_language (lang);
@@ -2780,9 +2774,7 @@ allocate_symtab (struct compunit_symtab *cust, const char *filename)
   struct symtab *symtab
     = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct symtab);
 
-  symtab->filename
-    = ((const char *) objfile->per_bfd->filename_cache.insert
-       (filename, strlen (filename) + 1));
+  symtab->filename = objfile->intern (filename);
   symtab->fullname = NULL;
   symtab->language = deduce_language_from_filename (filename);
 
This page took 0.034824 seconds and 4 git commands to generate.