convert to_get_min_fast_tracepoint_insn_len
[deliverable/binutils-gdb.git] / gdb / objfiles.c
index a80d4c729c43dba452bc0848aecb0e49faf55b7c..eccb44adbcb91f5a1744630d3224401b00feaf5e 100644 (file)
@@ -152,6 +152,7 @@ get_objfile_bfd_data (struct objfile *objfile, struct bfd *abfd)
       obstack_init (&storage->storage_obstack);
       storage->filename_cache = bcache_xmalloc (NULL, NULL);
       storage->macro_cache = bcache_xmalloc (NULL, NULL);
+      storage->language_of_main = language_unknown;
     }
 
   return storage;
@@ -186,6 +187,20 @@ set_objfile_per_bfd (struct objfile *objfile)
   objfile->per_bfd = get_objfile_bfd_data (objfile, objfile->obfd);
 }
 
+/* Set the objfile's per-BFD notion of the "main" name and
+   language.  */
+
+void
+set_objfile_main_name (struct objfile *objfile,
+                      const char *name, enum language lang)
+{
+  if (objfile->per_bfd->name_of_main == NULL
+      || strcmp (objfile->per_bfd->name_of_main, name) != 0)
+    objfile->per_bfd->name_of_main
+      = obstack_copy0 (&objfile->per_bfd->storage_obstack, name, strlen (name));
+  objfile->per_bfd->language_of_main = lang;
+}
+
 \f
 
 /* Called via bfd_map_over_sections to build up the section table that
@@ -364,12 +379,12 @@ get_objfile_arch (struct objfile *objfile)
 int
 entry_point_address_query (CORE_ADDR *entry_p)
 {
-  if (symfile_objfile == NULL || !symfile_objfile->ei.entry_point_p)
+  if (symfile_objfile == NULL || !symfile_objfile->per_bfd->ei.entry_point_p)
     return 0;
 
-  *entry_p = (symfile_objfile->ei.entry_point
+  *entry_p = (symfile_objfile->per_bfd->ei.entry_point
              + ANOFFSET (symfile_objfile->section_offsets,
-                         symfile_objfile->ei.the_bfd_section_index));
+                         symfile_objfile->per_bfd->ei.the_bfd_section_index));
 
   return 1;
 }
This page took 0.024393 seconds and 4 git commands to generate.