daily update
[deliverable/binutils-gdb.git] / gdb / objfiles.c
index 003737208fddf7b9f24a594a9b39b10ed1de61ce..923d59b2c1001b61bf96ce37c5c456b067813ee0 100644 (file)
@@ -60,8 +60,6 @@ static void *map_to_file (int);
 
 #endif /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */
 
-static void add_to_objfile_sections (bfd *, sec_ptr, void *);
-
 static void objfile_alloc_data (struct objfile *objfile);
 static void objfile_free_data (struct objfile *objfile);
 
@@ -89,7 +87,8 @@ int mapped_symbol_files;      /* Try to use mapped symbol files */
    the end of the table (objfile->sections_end). */
 
 static void
-add_to_objfile_sections (bfd *abfd, sec_ptr asect, void *objfile_p_char)
+add_to_objfile_sections (struct bfd *abfd, struct bfd_section *asect,
+                        void *objfile_p_char)
 {
   struct objfile *objfile = (struct objfile *) objfile_p_char;
   struct obj_section section;
@@ -387,6 +386,7 @@ terminate_minimal_symbol_table (struct objfile *objfile)
     DEPRECATED_SYMBOL_NAME (m) = NULL;
     SYMBOL_VALUE_ADDRESS (m) = 0;
     MSYMBOL_INFO (m) = NULL;
+    MSYMBOL_SIZE (m) = 0;
     MSYMBOL_TYPE (m) = mst_unknown;
     SYMBOL_INIT_LANGUAGE_SPECIFIC (m, language_unknown);
   }
@@ -1044,14 +1044,14 @@ map_to_file (int fd)
 
 #endif /* defined(USE_MMALLOC) && defined(HAVE_MMAP) */
 
-/* Returns a section whose range includes PC and SECTION, 
-   or NULL if none found.  Note the distinction between the return type, 
-   struct obj_section (which is defined in gdb), and the input type
-   struct sec (which is a bfd-defined data type).  The obj_section
-   contains a pointer to the bfd struct sec section.  */
+/* Returns a section whose range includes PC and SECTION, or NULL if
+   none found.  Note the distinction between the return type, struct
+   obj_section (which is defined in gdb), and the input type "struct
+   bfd_section" (which is a bfd-defined data type).  The obj_section
+   contains a pointer to the "struct bfd_section".  */
 
 struct obj_section *
-find_pc_sect_section (CORE_ADDR pc, struct sec *section)
+find_pc_sect_section (CORE_ADDR pc, struct bfd_section *section)
 {
   struct obj_section *s;
   struct objfile *objfile;
@@ -1088,7 +1088,7 @@ in_plt_section (CORE_ADDR pc, char *name)
 
   retval = (s != NULL
            && s->the_bfd_section->name != NULL
-           && STREQ (s->the_bfd_section->name, ".plt"));
+           && strcmp (s->the_bfd_section->name, ".plt") == 0);
   return (retval);
 }
 
@@ -1098,13 +1098,13 @@ in_plt_section (CORE_ADDR pc, char *name)
 int
 is_in_import_list (char *name, struct objfile *objfile)
 {
-  register int i;
+  int i;
 
   if (!objfile || !name || !*name)
     return 0;
 
   for (i = 0; i < objfile->import_list_size; i++)
-    if (objfile->import_list[i] && STREQ (name, objfile->import_list[i]))
+    if (objfile->import_list[i] && DEPRECATED_STREQ (name, objfile->import_list[i]))
       return 1;
   return 0;
 }
@@ -1165,6 +1165,13 @@ objfile_free_data (struct objfile *objfile)
   objfile->data = NULL;
 }
 
+void
+clear_objfile_data (struct objfile *objfile)
+{
+  gdb_assert (objfile->data != NULL);
+  memset (objfile->data, 0, objfile->num_data * sizeof (void *));
+}
+
 void
 set_objfile_data (struct objfile *objfile, const struct objfile_data *data,
                  void *value)
This page took 0.02721 seconds and 4 git commands to generate.