move the "main" data into the per-BFD object
[deliverable/binutils-gdb.git] / gdb / objfiles.h
index 620d7e8eb9e0565b190b30d46c729c085e492a40..2de2f8d01fef5f9fc9cc7dbcf5e87d1cd9848dfe 100644 (file)
@@ -109,6 +109,9 @@ struct entry_info
 
     /* Set to 1 iff ENTRY_POINT contains a valid value.  */
     unsigned entry_point_p : 1;
+
+    /* Set to 1 iff this object was initialized.  */
+    unsigned initialized : 1;
   };
 
 /* Sections in an objfile.  The section offsets are stored in the
@@ -195,6 +198,18 @@ struct objfile_per_bfd_storage
      name, and the second is the demangled name or just a zero byte
      if the name doesn't demangle.  */
   struct htab *demangled_names_hash;
+
+  /* The per-objfile information about the entry point, the scope (file/func)
+     containing the entry point, and the scope of the user's main() func.  */
+
+  struct entry_info ei;
+
+  /* The name and language of any "main" found in this objfile.  The
+     name can be NULL, which means that the information was not
+     recorded.  */
+
+  const char *name_of_main;
+  enum language language_of_main;
 };
 
 /* Master structure for keeping track of each file from which
@@ -318,11 +333,6 @@ struct objfile
 
     const struct sym_fns *sf;
 
-    /* The per-objfile information about the entry point, the scope (file/func)
-       containing the entry point, and the scope of the user's main() func.  */
-
-    struct entry_info ei;
-
     /* Per objfile data-pointers required by other GDB modules.  */
 
     REGISTRY_FIELDS;
@@ -688,4 +698,9 @@ void set_objfile_per_bfd (struct objfile *obj);
 
 const char *objfile_name (const struct objfile *objfile);
 
+/* Set the objfile's notion of the "main" name and language.  */
+
+extern void set_objfile_main_name (struct objfile *objfile,
+                                  const char *name, enum language lang);
+
 #endif /* !defined (OBJFILES_H) */
This page took 0.027615 seconds and 4 git commands to generate.