* dwarf2read.c (read_tag_const_type, read_tag_volatile_type):
[deliverable/binutils-gdb.git] / gdb / hpread.c
index 4da08e4927d2cb56748264b322b30eb467376906..d87edd6539a9a880ad89c1b44d65f87ac43f005c 100644 (file)
@@ -135,77 +135,69 @@ extern struct complaint lbrac_unmatched_complaint;
 extern struct complaint lbrac_mismatch_complaint;
 \f
 
-void hpread_symfile_init PARAMS ((struct objfile *));
+void hpread_symfile_init (struct objfile *);
 
-static struct type *
-  hpread_read_array_type PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
+static struct type *hpread_read_array_type (dnttpointer, union dnttentry *,
+                                           struct objfile *);
 
-static struct type *hpread_alloc_type
-  PARAMS ((dnttpointer, struct objfile *));
+static struct type *hpread_alloc_type (dnttpointer, struct objfile *);
 
-static struct type **hpread_lookup_type
-  PARAMS ((dnttpointer, struct objfile *));
+static struct type **hpread_lookup_type (dnttpointer, struct objfile *);
 
 static struct type *hpread_read_enum_type
-  PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
+  (dnttpointer, union dnttentry *, struct objfile *);
 
 static struct type *hpread_read_set_type
-  PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
+  (dnttpointer, union dnttentry *, struct objfile *);
 
 static struct type *hpread_read_subrange_type
-  PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
+  (dnttpointer, union dnttentry *, struct objfile *);
 
 static struct type *hpread_read_struct_type
-  PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
+  (dnttpointer, union dnttentry *, struct objfile *);
 
-void hpread_build_psymtabs
-  PARAMS ((struct objfile *, int));
+void hpread_build_psymtabs (struct objfile *, int);
 
-void hpread_symfile_finish PARAMS ((struct objfile *));
+void hpread_symfile_finish (struct objfile *);
 
 static struct partial_symtab *hpread_start_psymtab
-  PARAMS ((struct objfile *, char *, CORE_ADDR, int,
-          struct partial_symbol **, struct partial_symbol **));
+  (struct objfile *, char *, CORE_ADDR, int,
+   struct partial_symbol **, struct partial_symbol **);
 
 static struct partial_symtab *hpread_end_psymtab
-  PARAMS ((struct partial_symtab *, char **, int, int, CORE_ADDR,
-          struct partial_symtab **, int));
+  (struct partial_symtab *, char **, int, int, CORE_ADDR,
+   struct partial_symtab **, int);
 
 static struct symtab *hpread_expand_symtab
-  PARAMS ((struct objfile *, int, int, CORE_ADDR, int,
-          struct section_offsets *, char *));
+  (struct objfile *, int, int, CORE_ADDR, int,
+   struct section_offsets *, char *);
 
 static void hpread_process_one_debug_symbol
-  PARAMS ((union dnttentry *, char *, struct section_offsets *,
-          struct objfile *, CORE_ADDR, int, char *, int));
+  (union dnttentry *, char *, struct section_offsets *,
+   struct objfile *, CORE_ADDR, int, char *, int);
 
 static sltpointer hpread_record_lines
-  PARAMS ((struct subfile *, sltpointer, sltpointer,
-          struct objfile *, CORE_ADDR));
+  (struct subfile *, sltpointer, sltpointer, struct objfile *, CORE_ADDR);
 
 static struct type *hpread_read_function_type
-  PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
+  (dnttpointer, union dnttentry *, struct objfile *);
 
-static struct type *hpread_type_lookup
-  PARAMS ((dnttpointer, struct objfile *));
+static struct type *hpread_type_lookup (dnttpointer, struct objfile *);
 
-static unsigned long hpread_get_depth
-  PARAMS ((sltpointer, struct objfile *));
+static unsigned long hpread_get_depth (sltpointer, struct objfile *);
 
-static unsigned long hpread_get_line
-  PARAMS ((sltpointer, struct objfile *));
+static unsigned long hpread_get_line (sltpointer, struct objfile *);
 
-static CORE_ADDR hpread_get_location
-  PARAMS ((sltpointer, struct objfile *));
+static CORE_ADDR hpread_get_location (sltpointer, struct objfile *);
 
-static int hpread_type_translate PARAMS ((dnttpointer));
-static unsigned long hpread_get_textlow PARAMS ((int, int, struct objfile *));
-static union dnttentry *hpread_get_gntt PARAMS ((int, struct objfile *));
-static union dnttentry *hpread_get_lntt PARAMS ((int, struct objfile *));
-static union sltentry *hpread_get_slt PARAMS ((int, struct objfile *));
-static void hpread_psymtab_to_symtab PARAMS ((struct partial_symtab *));
-static void hpread_psymtab_to_symtab_1 PARAMS ((struct partial_symtab *));
-static int hpread_has_name PARAMS ((enum dntt_entry_type));
+static int hpread_type_translate (dnttpointer);
+static unsigned long hpread_get_textlow (int, int, struct objfile *);
+static union dnttentry *hpread_get_gntt (int, struct objfile *);
+static union dnttentry *hpread_get_lntt (int, struct objfile *);
+static union sltentry *hpread_get_slt (int, struct objfile *);
+static void hpread_psymtab_to_symtab (struct partial_symtab *);
+static void hpread_psymtab_to_symtab_1 (struct partial_symtab *);
+static int hpread_has_name (enum dntt_entry_type);
 \f
 
 /* Initialization for reading native HP C debug symbols from OBJFILE.
@@ -221,8 +213,7 @@ static int hpread_has_name PARAMS ((enum dntt_entry_type));
    FIXME, there should be a cleaner peephole into the BFD environment here.  */
 
 void
-hpread_symfile_init (objfile)
-     struct objfile *objfile;
+hpread_symfile_init (struct objfile *objfile)
 {
   asection *vt_section, *slt_section, *lntt_section, *gntt_section;
 
@@ -309,9 +300,7 @@ hpread_symfile_init (objfile)
    table (as opposed to a shared lib or dynamically loaded file).  */
 
 void
-hpread_build_psymtabs (objfile, mainline)
-     struct objfile *objfile;
-     int mainline;
+hpread_build_psymtabs (struct objfile *objfile, int mainline)
 {
   char *namestring;
   int past_first_source_file = 0;
@@ -358,7 +347,7 @@ hpread_build_psymtabs (objfile, mainline)
     (struct partial_symtab **) alloca (dependencies_allocated *
                                       sizeof (struct partial_symtab *));
 
-  old_chain = make_cleanup (free_objfile, objfile);
+  old_chain = make_cleanup_free_objfile (objfile);
 
   last_source_file = 0;
 
@@ -466,7 +455,7 @@ hpread_build_psymtabs (objfile, mainline)
                  past_first_source_file = 1;
 
                valu = hpread_get_textlow (i, hp_symnum, objfile);
-               valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
+               valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
                pst = hpread_start_psymtab (objfile,
                                            namestring, valu,
                                            (hp_symnum
@@ -484,7 +473,7 @@ hpread_build_psymtabs (objfile, mainline)
                 is supposed to be.  */
              SET_NAMESTRING (dn_bufp, &namestring, objfile);
              valu = hpread_get_textlow (i, hp_symnum, objfile);
-             valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
+             valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
              if (!pst)
                {
                  pst = hpread_start_psymtab (objfile,
@@ -502,11 +491,11 @@ hpread_build_psymtabs (objfile, mainline)
              /* The beginning of a function.  DNTT_TYPE_ENTRY may also denote
                 a secondary entry point.  */
              valu = dn_bufp->dfunc.hiaddr + ANOFFSET (objfile->section_offsets,
-                                                      SECT_OFF_TEXT);
+                                                      SECT_OFF_TEXT (objfile));
              if (valu > texthigh)
                texthigh = valu;
              valu = dn_bufp->dfunc.lowaddr +
-               ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
+               ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
              SET_NAMESTRING (dn_bufp, &namestring, objfile);
              add_psymbol_to_list (namestring, strlen (namestring),
                                   VAR_NAMESPACE, LOC_BLOCK,
@@ -634,8 +623,7 @@ hpread_build_psymtabs (objfile, mainline)
    objfile struct from the global list of known objfiles. */
 
 void
-hpread_symfile_finish (objfile)
-     struct objfile *objfile;
+hpread_symfile_finish (struct objfile *objfile)
 {
   if (objfile->sym_private != NULL)
     {
@@ -649,41 +637,32 @@ hpread_symfile_finish (objfile)
 /* Various small functions to get entries in the debug symbol sections.  */
 
 static union dnttentry *
-hpread_get_lntt (index, objfile)
-     int index;
-     struct objfile *objfile;
+hpread_get_lntt (int index, struct objfile *objfile)
 {
   return (union dnttentry *)
     &(LNTT (objfile)[(index * sizeof (struct dntt_type_block))]);
 }
 
 static union dnttentry *
-hpread_get_gntt (index, objfile)
-     int index;
-     struct objfile *objfile;
+hpread_get_gntt (int index, struct objfile *objfile)
 {
   return (union dnttentry *)
     &(GNTT (objfile)[(index * sizeof (struct dntt_type_block))]);
 }
 
 static union sltentry *
-hpread_get_slt (index, objfile)
-     int index;
-     struct objfile *objfile;
+hpread_get_slt (int index, struct objfile *objfile)
 {
   return (union sltentry *) &(SLT (objfile)[index * sizeof (union sltentry)]);
 }
 
 /* Get the low address associated with some symbol (typically the start
    of a particular source file or module).  Since that information is not
-   stored as part of the DNTT_TYPE_MODULE or DNTT_TYPE_SRCFILE symbol we must infer it from
-   the existance of DNTT_TYPE_FUNCTION symbols.  */
+   stored as part of the DNTT_TYPE_MODULE or DNTT_TYPE_SRCFILE symbol we
+   must infer it from the existence of DNTT_TYPE_FUNCTION symbols.  */
 
 static unsigned long
-hpread_get_textlow (global, index, objfile)
-     int global;
-     int index;
-     struct objfile *objfile;
+hpread_get_textlow (int global, int index, struct objfile *objfile)
 {
   union dnttentry *dn_bufp;
   struct minimal_symbol *msymbol;
@@ -716,9 +695,7 @@ hpread_get_textlow (global, index, objfile)
 /* Get the nesting depth for the source line identified by INDEX.  */
 
 static unsigned long
-hpread_get_depth (index, objfile)
-     sltpointer index;
-     struct objfile *objfile;
+hpread_get_depth (sltpointer index, struct objfile *objfile)
 {
   union sltentry *sl_bufp;
 
@@ -729,9 +706,7 @@ hpread_get_depth (index, objfile)
 /* Get the source line number the the line identified by INDEX.  */
 
 static unsigned long
-hpread_get_line (index, objfile)
-     sltpointer index;
-     struct objfile *objfile;
+hpread_get_line (sltpointer index, struct objfile *objfile)
 {
   union sltentry *sl_bufp;
 
@@ -740,9 +715,7 @@ hpread_get_line (index, objfile)
 }
 
 static CORE_ADDR
-hpread_get_location (index, objfile)
-     sltpointer index;
-     struct objfile *objfile;
+hpread_get_location (sltpointer index, struct objfile *objfile)
 {
   union sltentry *sl_bufp;
   int i;
@@ -771,8 +744,7 @@ hpread_get_location (index, objfile)
    it, else return 0.  */
 
 static int
-hpread_has_name (kind)
-     enum dntt_entry_type kind;
+hpread_has_name (enum dntt_entry_type kind)
 {
   switch (kind)
     {
@@ -823,14 +795,10 @@ hpread_has_name (kind)
    (normal). */
 
 static struct partial_symtab *
-hpread_start_psymtab (objfile, filename, textlow, ldsymoff, global_syms,
-                     static_syms)
-     struct objfile *objfile;
-     char *filename;
-     CORE_ADDR textlow;
-     int ldsymoff;
-     struct partial_symbol **global_syms;
-     struct partial_symbol **static_syms;
+hpread_start_psymtab (struct objfile *objfile, char *filename,
+                     CORE_ADDR textlow, int ldsymoff,
+                     struct partial_symbol **global_syms,
+                     struct partial_symbol **static_syms)
 {
   struct partial_symtab *result =
   start_psymtab_common (objfile, section_offsets,
@@ -851,15 +819,11 @@ hpread_start_psymtab (objfile, filename, textlow, ldsymoff, global_syms,
    FIXME:  List variables and peculiarities of same.  */
 
 static struct partial_symtab *
-hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
-                   capping_text, dependency_list, number_dependencies)
-     struct partial_symtab *pst;
-     char **include_list;
-     int num_includes;
-     int capping_symbol_offset;
-     CORE_ADDR capping_text;
-     struct partial_symtab **dependency_list;
-     int number_dependencies;
+hpread_end_psymtab (struct partial_symtab *pst, char **include_list,
+                   int num_includes, int capping_symbol_offset,
+                   CORE_ADDR capping_text,
+                   struct partial_symtab **dependency_list,
+                   int number_dependencies)
 {
   int i;
   struct objfile *objfile = pst->objfile;
@@ -949,8 +913,7 @@ hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
    table.  */
 
 static void
-hpread_psymtab_to_symtab_1 (pst)
-     struct partial_symtab *pst;
+hpread_psymtab_to_symtab_1 (struct partial_symtab *pst)
 {
   struct cleanup *old_chain;
   int i;
@@ -1008,8 +971,7 @@ hpread_psymtab_to_symtab_1 (pst)
    Be verbose about it if the user wants that.  */
 
 static void
-hpread_psymtab_to_symtab (pst)
-     struct partial_symtab *pst;
+hpread_psymtab_to_symtab (struct partial_symtab *pst)
 {
   /* Get out quick if given junk.  */
   if (!pst)
@@ -1056,15 +1018,9 @@ hpread_psymtab_to_symtab (pst)
    SECTION_OFFSETS are the relocation offsets which get added to each symbol. */
 
 static struct symtab *
-hpread_expand_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
-                     section_offsets, filename)
-     struct objfile *objfile;
-     int sym_offset;
-     int sym_size;
-     CORE_ADDR text_offset;
-     int text_size;
-     struct section_offsets *section_offsets;
-     char *filename;
+hpread_expand_symtab (struct objfile *objfile, int sym_offset, int sym_size,
+                     CORE_ADDR text_offset, int text_size,
+                     struct section_offsets *section_offsets, char *filename)
 {
   char *namestring;
   union dnttentry *dn_bufp;
@@ -1108,15 +1064,14 @@ hpread_expand_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
 
   current_objfile = NULL;
 
-  return end_symtab (text_offset + text_size, objfile, 0);
+  return end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile));
 }
 \f
 
 /* Convert basic types from HP debug format into GDB internal format.  */
 
 static int
-hpread_type_translate (typep)
-     dnttpointer typep;
+hpread_type_translate (dnttpointer typep)
 {
   if (!typep.dntti.immediate)
     abort ();
@@ -1188,9 +1143,7 @@ hpread_type_translate (typep)
 /* Return the type associated with the index found in HP_TYPE.  */
 
 static struct type **
-hpread_lookup_type (hp_type, objfile)
-     dnttpointer hp_type;
-     struct objfile *objfile;
+hpread_lookup_type (dnttpointer hp_type, struct objfile *objfile)
 {
   unsigned old_len;
   int index = hp_type.dnttp.index;
@@ -1231,9 +1184,7 @@ hpread_lookup_type (hp_type, objfile)
    have it lying around.  */
 
 static struct type *
-hpread_alloc_type (hp_type, objfile)
-     dnttpointer hp_type;
-     struct objfile *objfile;
+hpread_alloc_type (dnttpointer hp_type, struct objfile *objfile)
 {
   struct type **type_addr;
 
@@ -1249,10 +1200,8 @@ hpread_alloc_type (hp_type, objfile)
 /* Read a native enumerated type and return it in GDB internal form.  */
 
 static struct type *
-hpread_read_enum_type (hp_type, dn_bufp, objfile)
-     dnttpointer hp_type;
-     union dnttentry *dn_bufp;
-     struct objfile *objfile;
+hpread_read_enum_type (dnttpointer hp_type, union dnttentry *dn_bufp,
+                      struct objfile *objfile)
 {
   struct type *type;
   struct pending **symlist, *osyms, *syms;
@@ -1328,10 +1277,8 @@ hpread_read_enum_type (hp_type, dn_bufp, objfile)
 /* Read and internalize a native function debug symbol.  */
 
 static struct type *
-hpread_read_function_type (hp_type, dn_bufp, objfile)
-     dnttpointer hp_type;
-     union dnttentry *dn_bufp;
-     struct objfile *objfile;
+hpread_read_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
+                          struct objfile *objfile)
 {
   struct type *type, *type1;
   struct pending **symlist, *osyms, *syms;
@@ -1438,10 +1385,8 @@ hpread_read_function_type (hp_type, dn_bufp, objfile)
 /* Read in and internalize a structure definition.  */
 
 static struct type *
-hpread_read_struct_type (hp_type, dn_bufp, objfile)
-     dnttpointer hp_type;
-     union dnttentry *dn_bufp;
-     struct objfile *objfile;
+hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
+                        struct objfile *objfile)
 {
   struct nextfield
     {
@@ -1518,10 +1463,8 @@ hpread_read_struct_type (hp_type, dn_bufp, objfile)
 /* Read in and internalize a set debug symbol.  */
 
 static struct type *
-hpread_read_set_type (hp_type, dn_bufp, objfile)
-     dnttpointer hp_type;
-     union dnttentry *dn_bufp;
-     struct objfile *objfile;
+hpread_read_set_type (dnttpointer hp_type, union dnttentry *dn_bufp,
+                     struct objfile *objfile)
 {
   struct type *type;
 
@@ -1542,10 +1485,8 @@ hpread_read_set_type (hp_type, dn_bufp, objfile)
 /* Read in and internalize an array debug symbol.  */
 
 static struct type *
-hpread_read_array_type (hp_type, dn_bufp, objfile)
-     dnttpointer hp_type;
-     union dnttentry *dn_bufp;
-     struct objfile *objfile;
+hpread_read_array_type (dnttpointer hp_type, union dnttentry *dn_bufp,
+                       struct objfile *objfile)
 {
   struct type *type;
   union dnttentry save;
@@ -1584,10 +1525,8 @@ hpread_read_array_type (hp_type, dn_bufp, objfile)
 
 /* Read in and internalize a subrange debug symbol.  */
 static struct type *
-hpread_read_subrange_type (hp_type, dn_bufp, objfile)
-     dnttpointer hp_type;
-     union dnttentry *dn_bufp;
-     struct objfile *objfile;
+hpread_read_subrange_type (dnttpointer hp_type, union dnttentry *dn_bufp,
+                          struct objfile *objfile)
 {
   struct type *type;
 
@@ -1619,9 +1558,7 @@ hpread_read_subrange_type (hp_type, dn_bufp, objfile)
 }
 
 static struct type *
-hpread_type_lookup (hp_type, objfile)
-     dnttpointer hp_type;
-     struct objfile *objfile;
+hpread_type_lookup (dnttpointer hp_type, struct objfile *objfile)
 {
   union dnttentry *dn_bufp;
 
@@ -1737,11 +1674,9 @@ hpread_type_lookup (hp_type, objfile)
 }
 
 static sltpointer
-hpread_record_lines (subfile, s_idx, e_idx, objfile, offset)
-     struct subfile *subfile;
-     sltpointer s_idx, e_idx;
-     struct objfile *objfile;
-     CORE_ADDR offset;
+hpread_record_lines (struct subfile *subfile, sltpointer s_idx,
+                    sltpointer e_idx, struct objfile *objfile,
+                    CORE_ADDR offset)
 {
   union sltentry *sl_bufp;
 
@@ -1761,21 +1696,15 @@ hpread_record_lines (subfile, s_idx, e_idx, objfile, offset)
 /* Internalize one native debug symbol.  */
 
 static void
-hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
-                                text_offset, text_size, filename, index)
-     union dnttentry *dn_bufp;
-     char *name;
-     struct section_offsets *section_offsets;
-     struct objfile *objfile;
-     CORE_ADDR text_offset;
-     int text_size;
-     char *filename;
-     int index;
+hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
+                                struct section_offsets *section_offsets,
+                                struct objfile *objfile, CORE_ADDR text_offset,
+                                int text_size, char *filename, int index)
 {
   unsigned long desc;
   int type;
   CORE_ADDR valu;
-  int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT);
+  int offset = ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
   union dnttentry *dn_temp;
   dnttpointer hp_type;
   struct symbol *sym;
@@ -1893,7 +1822,7 @@ hpread_process_one_debug_symbol (dn_bufp, name, section_offsets, objfile,
        case DNTT_TYPE_MODULE:
          /* Ending a module ends the symbol table for that module.  */
          valu = text_offset + text_size + offset;
-         (void) end_symtab (valu, objfile, 0);
+         (void) end_symtab (valu, objfile, SECT_OFF_TEXT (objfile));
          break;
 
        case DNTT_TYPE_FUNCTION:
This page took 0.06262 seconds and 4 git commands to generate.