2000-04-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / symfile.h
index 875f1b5dc422eec3599e457c6cd9a334c565301b..35913c08cd8cea2a089127ac178bdcc15a68d9ca 100644 (file)
@@ -54,6 +54,25 @@ struct psymbol_allocation_list
     int size;
   };
 
+/* Define an array of addresses to accommodate non-contiguous dynamic
+   loading of modules.  This is for use when entering commands, so we
+   can keep track of the section names until we read the file and
+   can map them to bfd sections.  This structure is also used by
+   solib.c to communicate the section addresses in shared objects to
+   symbol_file_add (). */
+#define MAX_SECTIONS 40
+struct section_addr_info 
+{
+  /* Sections whose names are file format dependant. */
+  struct other_sections
+  {
+    CORE_ADDR addr;
+    char *name;
+    int sectindex;
+  } other[MAX_SECTIONS];
+};
+
 /* Structure to keep track of symbol reading functions for various
    object file types.  */
 
@@ -77,12 +96,9 @@ struct sym_fns
 
     void (*sym_init) PARAMS ((struct objfile *));
 
-    /* sym_read (objfile, addr, mainline)
+    /* sym_read (objfile, mainline)
        Reads a symbol file into a psymtab (or possibly a symtab).
        OBJFILE is the objfile struct for the file we are reading.
-       SECTION_OFFSETS
-       are the offset between the file's specified section addresses and
-       their true addresses in memory.
        MAINLINE is 1 if this is the
        main symbol table being read, and 0 if a secondary
        symbol file (e.g. shared library or dynamically loaded file)
@@ -100,9 +116,9 @@ struct sym_fns
        The parameter is currently a CORE_ADDR (FIXME!) for backward compatibility
        with the higher levels of GDB.  It should probably be changed to
        a string, where NULL means the default, and others are parsed in a file
-       dependent way.  The result of this function is handed in to sym_read.  */
+       dependent way. */
 
-    struct section_offsets *(*sym_offsets) PARAMS ((struct objfile *, CORE_ADDR));
+    void (*sym_offsets) PARAMS ((struct objfile *, struct section_addr_info *));
 
     /* Finds the next struct sym_fns.  They are allocated and initialized
        in whatever module implements the functions pointed to; an 
@@ -115,8 +131,8 @@ struct sym_fns
 /* The default version of sym_fns.sym_offsets for readers that don't
    do anything special.  */
 
-extern struct section_offsets *
-default_symfile_offsets PARAMS ((struct objfile * objfile, CORE_ADDR addr));
+extern void
+default_symfile_offsets PARAMS ((struct objfile * objfile, struct section_addr_info *));
 
 
 extern void
@@ -161,11 +177,28 @@ extern void
 init_entry_point_info PARAMS ((struct objfile *));
 
 extern void
-syms_from_objfile PARAMS ((struct objfile *, CORE_ADDR, int, int));
+syms_from_objfile PARAMS ((struct objfile *, struct section_addr_info *, int, int));
 
 extern void
 new_symfile_objfile PARAMS ((struct objfile *, int, int));
 
+extern struct objfile *
+symbol_file_add PARAMS ((char *, int, struct section_addr_info *, int, int));
+
+/* Build (allocate and populate) a section_addr_info struct from
+   an existing section table. */
+
+struct section_table;
+extern struct section_addr_info *
+build_section_addr_info_from_section_table (const struct section_table *start,
+                                            const struct section_table *end);
+
+/* Free all memory allocated by build_section_addr_info_from_section_table. */
+
+extern void
+free_section_addr_info (struct section_addr_info *);
+
+
 extern struct partial_symtab *
   start_psymtab_common PARAMS ((struct objfile *, struct section_offsets *,
                                char *, CORE_ADDR,
@@ -224,9 +257,6 @@ extern void find_lowest_section PARAMS ((bfd *, asection *, PTR));
 
 extern bfd *symfile_bfd_open PARAMS ((char *));
 
-/* Remote targets may wish to use this as their load function.  */
-extern void generic_load PARAMS ((char *name, int from_tty));
-
 /* Utility functions for overlay sections: */
 extern int overlay_debugging;
 extern int overlay_cache_invalid;
@@ -270,16 +300,15 @@ extern CORE_ADDR
 /* From dwarfread.c */
 
 extern void
-dwarf_build_psymtabs PARAMS ((struct objfile *, struct section_offsets *, int,
-                          file_ptr, unsigned int, file_ptr, unsigned int));
+dwarf_build_psymtabs PARAMS ((struct objfile *, int, file_ptr, unsigned int,
+                             file_ptr, unsigned int));
 
 /* From dwarf2read.c */
 
 extern int dwarf2_has_info PARAMS ((bfd * abfd));
 
-extern void dwarf2_build_psymtabs PARAMS ((struct objfile *,
-                                          struct section_offsets *,
-                                          int));
+extern void dwarf2_build_psymtabs PARAMS ((struct objfile *, int));
+
 /* From mdebugread.c */
 
 /* Hack to force structures to exist before use in parameter list.  */
@@ -291,13 +320,11 @@ struct ecoff_debug_hack
 extern void
 mdebug_build_psymtabs PARAMS ((struct objfile *,
                               const struct ecoff_debug_swap *,
-                              struct ecoff_debug_info *,
-                              struct section_offsets *));
+                              struct ecoff_debug_info *));
 
 extern void
 elfmdebug_build_psymtabs PARAMS ((struct objfile *,
                                  const struct ecoff_debug_swap *,
-                                 asection *,
-                                 struct section_offsets *));
+                                 asection *));
 
 #endif /* !defined(SYMFILE_H) */
This page took 0.121828 seconds and 4 git commands to generate.