OSDN Git Service

Fix the year on the following lines:
[pf3gnuchains/pf3gnuchains3x.git] / gdb / mdebugread.c
index f17dc93..f3d01b5 100644 (file)
@@ -93,11 +93,6 @@ typedef struct mips_extra_func_info
 
 extern void _initialize_mdebugread (void);
 
-/* Provide a default mapping from a ecoff register number to a gdb REGNUM.  */
-#ifndef ECOFF_REG_TO_REGNUM
-#define ECOFF_REG_TO_REGNUM(num) (num)
-#endif
-
 /* Provide a way to test if we have both ECOFF and ELF symbol tables.  
    We use this define in order to know whether we should override a 
    symbol's ECOFF section with its ELF section.  This is necessary in 
@@ -410,8 +405,7 @@ CORE_ADDR sigtramp_address, sigtramp_end;
 /* Allocate zeroed memory */
 
 static PTR
-xzalloc (size)
-     unsigned int size;
+xzalloc (unsigned int size)
 {
   PTR p = xmalloc (size);
 
@@ -425,8 +419,7 @@ xzalloc (size)
    and reorders the symtab list at the end */
 
 static void
-mdebug_psymtab_to_symtab (pst)
-     struct partial_symtab *pst;
+mdebug_psymtab_to_symtab (struct partial_symtab *pst)
 {
 
   if (!pst)
@@ -455,8 +448,7 @@ mdebug_psymtab_to_symtab (pst)
 /* Find a file descriptor given its index RF relative to a file CF */
 
 static FDR *
-get_rfd (cf, rf)
-     int cf, rf;
+get_rfd (int cf, int rf)
 {
   FDR *fdrs;
   register FDR *f;
@@ -478,8 +470,7 @@ get_rfd (cf, rf)
 /* Return a safer print NAME for a file descriptor */
 
 static char *
-fdr_name (f)
-     FDR *f;
+fdr_name (FDR *f)
 {
   if (f->rss == -1)
     return "<stripped file>";
@@ -493,10 +484,9 @@ fdr_name (f)
    different sections are relocated via the SECTION_OFFSETS.  */
 
 void
-mdebug_build_psymtabs (objfile, swap, info)
-     struct objfile *objfile;
-     const struct ecoff_debug_swap *swap;
-     struct ecoff_debug_info *info;
+mdebug_build_psymtabs (struct objfile *objfile,
+                      const struct ecoff_debug_swap *swap,
+                      struct ecoff_debug_info *info)
 {
   cur_bfd = objfile->obfd;
   debug_swap = swap;
@@ -580,7 +570,7 @@ static struct parse_stack
 /* Enter a new lexical context */
 
 static void
-push_parse_stack ()
+push_parse_stack (void)
 {
   struct parse_stack *new;
 
@@ -605,7 +595,7 @@ push_parse_stack ()
 /* Exit a lexical context */
 
 static void
-pop_parse_stack ()
+pop_parse_stack (void)
 {
   if (!top_stack)
     return;
@@ -639,9 +629,7 @@ static struct mdebug_pending **pending_list;
 /* Check whether we already saw symbol SH in file FH */
 
 static struct mdebug_pending *
-is_pending_symbol (fh, sh)
-     FDR *fh;
-     char *sh;
+is_pending_symbol (FDR *fh, char *sh)
 {
   int f_idx = fh - debug_info->fdr;
   register struct mdebug_pending *p;
@@ -656,10 +644,7 @@ is_pending_symbol (fh, sh)
 /* Add a new symbol SH of type T */
 
 static void
-add_pending (fh, sh, t)
-     FDR *fh;
-     char *sh;
-     struct type *t;
+add_pending (FDR *fh, char *sh, struct type *t)
 {
   int f_idx = fh - debug_info->fdr;
   struct mdebug_pending *p = is_pending_symbol (fh, sh);
@@ -690,17 +675,11 @@ add_pending (fh, sh, t)
    SYMR's handled (normally one).  */
 
 static int
-parse_symbol (sh, ax, ext_sh, bigend, section_offsets, objfile)
-     SYMR *sh;
-     union aux_ext *ax;
-     char *ext_sh;
-     int bigend;
-     struct section_offsets *section_offsets;
-     struct objfile *objfile;
+parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
+             struct section_offsets *section_offsets, struct objfile *objfile)
 {
   const bfd_size_type external_sym_size = debug_swap->external_sym_size;
-  void (*const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *)) =
-  debug_swap->swap_sym_in;
+  void (*const swap_sym_in) (bfd *, PTR, SYMR *) = debug_swap->swap_sym_in;
   char *name;
   struct symbol *s;
   struct block *b;
@@ -1438,13 +1417,8 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets, objfile)
    they are big-endian or little-endian (from fh->fBigendian).  */
 
 static struct type *
-parse_type (fd, ax, aux_index, bs, bigend, sym_name)
-     int fd;
-     union aux_ext *ax;
-     unsigned int aux_index;
-     int *bs;
-     int bigend;
-     char *sym_name;
+parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
+           int bigend, char *sym_name)
 {
   /* Null entries in this map are treated specially */
   static struct type **map_bt[] =
@@ -1779,13 +1753,8 @@ parse_type (fd, ax, aux_index, bs, bigend, sym_name)
    Returns the number of aux symbols we parsed. */
 
 static int
-upgrade_type (fd, tpp, tq, ax, bigend, sym_name)
-     int fd;
-     struct type **tpp;
-     int tq;
-     union aux_ext *ax;
-     int bigend;
-     char *sym_name;
+upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
+             char *sym_name)
 {
   int off;
   struct type *t;
@@ -1903,10 +1872,8 @@ upgrade_type (fd, tpp, tq, ax, bigend, sym_name)
 static void parse_procedure (PDR *, struct symtab *, struct partial_symtab *);
 
 static void
-parse_procedure (pr, search_symtab, pst)
-     PDR *pr;
-     struct symtab *search_symtab;
-     struct partial_symtab *pst;
+parse_procedure (PDR *pr, struct symtab *search_symtab,
+                struct partial_symtab *pst)
 {
   struct symbol *s, *i;
   struct block *b;
@@ -2059,9 +2026,7 @@ parse_procedure (pr, search_symtab, pst)
 /* Relocate the extra function info pointed to by the symbol table.  */
 
 void
-ecoff_relocate_efi (sym, delta)
-     struct symbol *sym;
-     CORE_ADDR delta;
+ecoff_relocate_efi (struct symbol *sym, CORE_ADDR delta)
 {
   struct mips_extra_func_info *e;
 
@@ -2080,11 +2045,8 @@ static void parse_external (EXTR *, int, struct section_offsets *,
                            struct objfile *);
 
 static void
-parse_external (es, bigend, section_offsets, objfile)
-     EXTR *es;
-     int bigend;
-     struct section_offsets *section_offsets;
-     struct objfile *objfile;
+parse_external (EXTR *es, int bigend, struct section_offsets *section_offsets,
+               struct objfile *objfile)
 {
   union aux_ext *ax;
 
@@ -2176,13 +2138,8 @@ static void parse_lines (FDR *, PDR *, struct linetable *, int,
                         struct partial_symtab *, CORE_ADDR);
 
 static void
-parse_lines (fh, pr, lt, maxlines, pst, lowest_pdr_addr)
-     FDR *fh;
-     PDR *pr;
-     struct linetable *lt;
-     int maxlines;
-     struct partial_symtab *pst;
-     CORE_ADDR lowest_pdr_addr;
+parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines,
+            struct partial_symtab *pst, CORE_ADDR lowest_pdr_addr)
 {
   unsigned char *base;
   int j, k;
@@ -2248,18 +2205,14 @@ parse_lines (fh, pr, lt, maxlines, pst, lowest_pdr_addr)
    into a partial_symtab.  */
 
 static void
-parse_partial_symbols (objfile)
-     struct objfile *objfile;
+parse_partial_symbols (struct objfile *objfile)
 {
   const bfd_size_type external_sym_size = debug_swap->external_sym_size;
   const bfd_size_type external_rfd_size = debug_swap->external_rfd_size;
   const bfd_size_type external_ext_size = debug_swap->external_ext_size;
-  void (*const swap_ext_in) PARAMS ((bfd *, PTR, EXTR *))
-  = debug_swap->swap_ext_in;
-  void (*const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *))
-  = debug_swap->swap_sym_in;
-  void (*const swap_rfd_in) PARAMS ((bfd *, PTR, RFDT *))
-  = debug_swap->swap_rfd_in;
+  void (*const swap_ext_in) (bfd *, PTR, EXTR *) = debug_swap->swap_ext_in;
+  void (*const swap_sym_in) (bfd *, PTR, SYMR *) = debug_swap->swap_sym_in;
+  void (*const swap_rfd_in) (bfd *, PTR, RFDT *) = debug_swap->swap_rfd_in;
   int f_idx, s_idx;
   HDRR *hdr = &debug_info->symbolic_header;
   /* Running pointers */
@@ -2333,7 +2286,7 @@ parse_partial_symbols (objfile)
      Minor hack: -O3 images might claim some global data belongs
      to FDR -1. We`ll go along with that */
   fdr_to_pst = (struct pst_map *) xzalloc ((hdr->ifdMax + 1) * sizeof *fdr_to_pst);
-  old_chain = make_cleanup (free, fdr_to_pst);
+  old_chain = make_cleanup (xfree, fdr_to_pst);
   fdr_to_pst++;
   {
     struct partial_symtab *pst = new_psymtab ("", objfile);
@@ -2351,7 +2304,7 @@ parse_partial_symbols (objfile)
 
   /* Pass 0 over external syms: swap them in.  */
   ext_block = (EXTR *) xmalloc (hdr->iextMax * sizeof (EXTR));
-  make_cleanup (free, ext_block);
+  make_cleanup (xfree, ext_block);
 
   ext_out = (char *) debug_info->external_ext;
   ext_out_end = ext_out + hdr->iextMax * external_ext_size;
@@ -2751,7 +2704,7 @@ parse_partial_symbols (objfile)
 
                if (stabstring
                    && stabstring != debug_info->ss + fh->issBase + sh.iss)
-                 free (stabstring);
+                 xfree (stabstring);
              }
              /* end - Handle continuation */
            }
@@ -2990,7 +2943,7 @@ parse_partial_symbols (objfile)
              CORE_ADDR svalue;
 
              if (ext_ptr->ifd != f_idx)
-               abort ();
+               internal_error (__FILE__, __LINE__, "failed internal consistency check");
              psh = &ext_ptr->asym;
 
              /* Do not add undefined symbols to the partial symbol table.  */
@@ -3160,15 +3113,11 @@ parse_partial_symbols (objfile)
    all the the enum constants to the partial symbol table.  */
 
 static void
-handle_psymbol_enumerators (objfile, fh, stype, svalue)
-     struct objfile *objfile;
-     FDR *fh;
-     int stype;
-     CORE_ADDR svalue;
+handle_psymbol_enumerators (struct objfile *objfile, FDR *fh, int stype,
+                           CORE_ADDR svalue)
 {
   const bfd_size_type external_sym_size = debug_swap->external_sym_size;
-  void (*const swap_sym_in) PARAMS ((bfd *, PTR, SYMR *))
-  = debug_swap->swap_sym_in;
+  void (*const swap_sym_in) (bfd *, PTR, SYMR *) = debug_swap->swap_sym_in;
   char *ext_sym = ((char *) debug_info->external_sym
                   + ((fh->isymBase + cur_sdx + 1) * external_sym_size));
   SYMR sh;
@@ -3228,9 +3177,10 @@ handle_psymbol_enumerators (objfile, fh, stype, svalue)
     }
 }
 
+/* Get the next symbol.  OBJFILE is unused. */
+
 static char *
-mdebug_next_symbol_text (objfile)
-     struct objfile *objfile;  /* argument objfile is currently unused */
+mdebug_next_symbol_text (struct objfile *objfile)
 {
   SYMR sh;
 
@@ -3254,14 +3204,12 @@ mdebug_next_symbol_text (objfile)
    The flow of control and even the memory allocation differs.  FIXME.  */
 
 static void
-psymtab_to_symtab_1 (pst, filename)
-     struct partial_symtab *pst;
-     char *filename;
+psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename)
 {
   bfd_size_type external_sym_size;
   bfd_size_type external_pdr_size;
-  void (*swap_sym_in) PARAMS ((bfd *, PTR, SYMR *));
-  void (*swap_pdr_in) PARAMS ((bfd *, PTR, PDR *));
+  void (*swap_sym_in) (bfd *, PTR, SYMR *);
+  void (*swap_pdr_in) (bfd *, PTR, PDR *);
   int i;
   struct symtab *st;
   FDR *fh;
@@ -3446,7 +3394,7 @@ psymtab_to_symtab_1 (pst, filename)
          PDR *pdr_in_end;
 
          pr_block = (PDR *) xmalloc (fh->cpd * sizeof (PDR));
-         old_chain = make_cleanup (free, pr_block);
+         old_chain = make_cleanup (xfree, pr_block);
 
          pdr_ptr = ((char *) debug_info->external_pdr
                     + fh->ipdFirst * external_pdr_size);
@@ -3555,7 +3503,7 @@ psymtab_to_symtab_1 (pst, filename)
 
              pr_block = (PDR *) xmalloc (fh->cpd * sizeof (PDR));
 
-             old_chain = make_cleanup (free, pr_block);
+             old_chain = make_cleanup (xfree, pr_block);
 
              pdr_ptr = ((char *) debug_info->external_pdr
                         + fh->ipdFirst * external_pdr_size);
@@ -3641,9 +3589,7 @@ psymtab_to_symtab_1 (pst, filename)
    to an opaque aggregate type, else 0.  */
 
 static int
-has_opaque_xref (fh, sh)
-     FDR *fh;
-     SYMR *sh;
+has_opaque_xref (FDR *fh, SYMR *sh)
 {
   TIR tir;
   union aux_ext *ax;
@@ -3675,14 +3621,8 @@ has_opaque_xref (fh, sh)
    Return value says how many aux symbols we ate. */
 
 static int
-cross_ref (fd, ax, tpp, type_code, pname, bigend, sym_name)
-     int fd;
-     union aux_ext *ax;
-     struct type **tpp;
-     enum type_code type_code; /* Use to alloc new type if none is found. */
-     char **pname;
-     int bigend;
-     char *sym_name;
+cross_ref (int fd, union aux_ext *ax, struct type **tpp, enum type_code type_code,     /* Use to alloc new type if none is found. */
+          char **pname, int bigend, char *sym_name)
 {
   RNDXR rn[1];
   unsigned int rf;
@@ -3879,11 +3819,8 @@ cross_ref (fd, ax, tpp, type_code, pname, bigend, sym_name)
    keeping the symtab sorted */
 
 static struct symbol *
-mylookup_symbol (name, block, namespace, class)
-     char *name;
-     register struct block *block;
-     namespace_enum namespace;
-     enum address_class class;
+mylookup_symbol (char *name, register struct block *block,
+                namespace_enum namespace, enum address_class class)
 {
   register int bot, top, inc;
   register struct symbol *sym;
@@ -3914,9 +3851,7 @@ mylookup_symbol (name, block, namespace, class)
    that's the only time we know how big the block is.  FIXME.  */
 
 static void
-add_symbol (s, b)
-     struct symbol *s;
-     struct block *b;
+add_symbol (struct symbol *s, struct block *b)
 {
   int nsyms = BLOCK_NSYMS (b)++;
   struct block *origb;
@@ -3949,9 +3884,7 @@ add_symbol (s, b)
 /* Add a new block B to a symtab S */
 
 static void
-add_block (b, s)
-     struct block *b;
-     struct symtab *s;
+add_block (struct block *b, struct symtab *s)
 {
   struct blockvector *bv = BLOCKVECTOR (s);
 
@@ -3981,11 +3914,7 @@ add_block (b, s)
    This is another reason why -ggdb debugging format is preferable.  */
 
 static int
-add_line (lt, lineno, adr, last)
-     struct linetable *lt;
-     int lineno;
-     CORE_ADDR adr;
-     int last;
+add_line (struct linetable *lt, int lineno, CORE_ADDR adr, int last)
 {
   /* DEC c89 sometimes produces zero linenos which confuse gdb.
      Change them to something sensible. */
@@ -4007,9 +3936,7 @@ add_line (lt, lineno, adr, last)
 /* Blocks with a smaller low bound should come first */
 
 static int
-compare_blocks (arg1, arg2)
-     const PTR arg1;
-     const PTR arg2;
+compare_blocks (const PTR arg1, const PTR arg2)
 {
   register int addr_diff;
   struct block **b1 = (struct block **) arg1;
@@ -4026,8 +3953,7 @@ compare_blocks (arg1, arg2)
    as required by some MI search routines */
 
 static void
-sort_blocks (s)
-     struct symtab *s;
+sort_blocks (struct symtab *s)
 {
   struct blockvector *bv = BLOCKVECTOR (s);
 
@@ -4078,11 +4004,7 @@ sort_blocks (s)
    MAXSYMS and linenumbers MAXLINES we'll put in it */
 
 static struct symtab *
-new_symtab (name, maxsyms, maxlines, objfile)
-     char *name;
-     int maxsyms;
-     int maxlines;
-     struct objfile *objfile;
+new_symtab (char *name, int maxsyms, int maxlines, struct objfile *objfile)
 {
   struct symtab *s = allocate_symtab (name, objfile);
 
@@ -4104,9 +4026,7 @@ new_symtab (name, maxsyms, maxlines, objfile)
 /* Allocate a new partial_symtab NAME */
 
 static struct partial_symtab *
-new_psymtab (name, objfile)
-     char *name;
-     struct objfile *objfile;
+new_psymtab (char *name, struct objfile *objfile)
 {
   struct partial_symtab *psymtab;
 
@@ -4135,8 +4055,7 @@ new_psymtab (name, objfile)
    proper size to allocate.  */
 
 static struct linetable *
-new_linetable (size)
-     int size;
+new_linetable (int size)
 {
   struct linetable *l;
 
@@ -4153,8 +4072,7 @@ new_linetable (size)
    calculating the proper size to allocate.  */
 
 static struct linetable *
-shrink_linetable (lt)
-     struct linetable *lt;
+shrink_linetable (struct linetable *lt)
 {
 
   return (struct linetable *) xrealloc ((PTR) lt,
@@ -4166,8 +4084,7 @@ shrink_linetable (lt)
 /* Allocate and zero a new blockvector of NBLOCKS blocks. */
 
 static struct blockvector *
-new_bvect (nblocks)
-     int nblocks;
+new_bvect (int nblocks)
 {
   struct blockvector *bv;
   int size;
@@ -4183,8 +4100,7 @@ new_bvect (nblocks)
 /* Allocate and zero a new block of MAXSYMS symbols */
 
 static struct block *
-new_block (maxsyms)
-     int maxsyms;
+new_block (int maxsyms)
 {
   int size = sizeof (struct block) + (maxsyms - 1) * sizeof (struct symbol *);
 
@@ -4195,9 +4111,7 @@ new_block (maxsyms)
    Shrink_block can also be used by add_symbol to grow a block.  */
 
 static struct block *
-shrink_block (b, s)
-     struct block *b;
-     struct symtab *s;
+shrink_block (struct block *b, struct symtab *s)
 {
   struct block *new;
   struct blockvector *bv = BLOCKVECTOR (s);
@@ -4225,8 +4139,7 @@ shrink_block (b, s)
 /* Create a new symbol with printname NAME */
 
 static struct symbol *
-new_symbol (name)
-     char *name;
+new_symbol (char *name)
 {
   struct symbol *s = ((struct symbol *)
                      obstack_alloc (&current_objfile->symbol_obstack,
@@ -4243,8 +4156,7 @@ new_symbol (name)
 /* Create a new type with printname NAME */
 
 static struct type *
-new_type (name)
-     char *name;
+new_type (char *name)
 {
   struct type *t;
 
@@ -4260,10 +4172,8 @@ new_type (name)
    it as normal.  */
 
 void
-elfmdebug_build_psymtabs (objfile, swap, sec)
-     struct objfile *objfile;
-     const struct ecoff_debug_swap *swap;
-     asection *sec;
+elfmdebug_build_psymtabs (struct objfile *objfile,
+                         const struct ecoff_debug_swap *swap, asection *sec)
 {
   bfd *abfd = objfile->obfd;
   struct ecoff_debug_info *info;
@@ -4298,7 +4208,7 @@ elfmdebug_build_psymtabs (objfile, swap, sec)
 #ifdef TM_MIPS_H
 
 void
-fixup_sigtramp ()
+fixup_sigtramp (void)
 {
   struct symbol *s;
   struct symtab *st;
@@ -4400,7 +4310,7 @@ fixup_sigtramp ()
 #endif /* TM_MIPS_H */
 
 void
-_initialize_mdebugread ()
+_initialize_mdebugread (void)
 {
   mdebug_type_void =
     init_type (TYPE_CODE_VOID, 1,