Really remove file.
[deliverable/binutils-gdb.git] / gdb / mdebugread.c
index 97794dc0a7685375102a07bc0ce21256297ee45a..f00cce4225372ebe6ccd45ba615d735758f29e76 100644 (file)
@@ -1,7 +1,9 @@
 /* Read a symbol table in ECOFF format (Third-Eye).
-   Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-   1997, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+
+   Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+   Foundation, Inc.
+
    Original version contributed by Alessandro Forin (af@cs.cmu.edu) at
    CMU.  Major work by Per Bothner, John Gilmore and Ian Lance Taylor
    at Cygnus Support.
@@ -45,7 +47,6 @@
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "gdbcore.h"
-#include "symfile.h"
 #include "objfiles.h"
 #include "gdb_obstack.h"
 #include "buildsym.h"
@@ -320,10 +321,6 @@ static void handle_psymbol_enumerators (struct objfile *, FDR *, int,
 
 static char *mdebug_next_symbol_text (struct objfile *);
 \f
-/* Address bounds for the signal trampoline in inferior, if any */
-
-CORE_ADDR sigtramp_address, sigtramp_end;
-
 /* Allocate zeroed memory */
 
 static void *
@@ -426,7 +423,7 @@ mdebug_build_psymtabs (struct objfile *objfile,
       char *fdr_end;
       FDR *fdr_ptr;
 
-      info->fdr = (FDR *) obstack_alloc (&objfile->psymbol_obstack,
+      info->fdr = (FDR *) obstack_alloc (&objfile->objfile_obstack,
                                         (info->symbolic_header.ifdMax
                                          * sizeof (FDR)));
       fdr_src = info->external_fdr;
@@ -579,7 +576,7 @@ add_pending (FDR *fh, char *sh, struct type *t)
   if (!p)
     {
       p = ((struct mdebug_pending *)
-          obstack_alloc (&current_objfile->psymbol_obstack,
+          obstack_alloc (&current_objfile->objfile_obstack,
                          sizeof (struct mdebug_pending)));
       p->s = sh;
       p->t = t;
@@ -793,7 +790,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
       else
        {
          t = parse_type (cur_fd, ax, sh->index + 1, 0, bigend, name);
-         if (DEPRECATED_STREQ (name, "malloc") && TYPE_CODE (t) == TYPE_CODE_VOID)
+         if (strcmp (name, "malloc") == 0
+             && TYPE_CODE (t) == TYPE_CODE_VOID)
            {
              /* I don't know why, but, at least under Alpha GNU/Linux,
                 when linking against a malloc without debugging
@@ -1057,7 +1055,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
        if (sh->iss == 0 || name[0] == '.' || name[0] == '\0')
          TYPE_TAG_NAME (t) = NULL;
        else
-         TYPE_TAG_NAME (t) = obconcat (&current_objfile->symbol_obstack,
+         TYPE_TAG_NAME (t) = obconcat (&current_objfile->objfile_obstack,
                                        "", "", name);
 
        TYPE_CODE (t) = type_code;
@@ -1103,12 +1101,12 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
                FIELD_STATIC_KIND (*f) = 0;
 
                enum_sym = ((struct symbol *)
-                           obstack_alloc (&current_objfile->symbol_obstack,
+                           obstack_alloc (&current_objfile->objfile_obstack,
                                           sizeof (struct symbol)));
                memset (enum_sym, 0, sizeof (struct symbol));
                DEPRECATED_SYMBOL_NAME (enum_sym) =
                  obsavestring (f->name, strlen (f->name),
-                               &current_objfile->symbol_obstack);
+                               &current_objfile->objfile_obstack);
                SYMBOL_CLASS (enum_sym) = LOC_CONST;
                SYMBOL_TYPE (enum_sym) = t;
                SYMBOL_DOMAIN (enum_sym) = VAR_DOMAIN;
@@ -1201,7 +1199,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
          SYMBOL_CLASS (s) = LOC_CONST;
          SYMBOL_TYPE (s) = mdebug_type_void;
          e = ((struct mips_extra_func_info *)
-              obstack_alloc (&current_objfile->symbol_obstack,
+              obstack_alloc (&current_objfile->objfile_obstack,
                              sizeof (struct mips_extra_func_info)));
          memset (e, 0, sizeof (struct mips_extra_func_info));
          SYMBOL_VALUE (s) = (long) e;
@@ -1634,7 +1632,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
          else if (TYPE_TAG_NAME (tp) == NULL
                   || strcmp (TYPE_TAG_NAME (tp), name) != 0)
            TYPE_TAG_NAME (tp) = obsavestring (name, strlen (name),
-                                           &current_objfile->type_obstack);
+                                           &current_objfile->objfile_obstack);
        }
     }
 
@@ -1667,9 +1665,10 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
              bad_tag_guess_complaint (sym_name);
              TYPE_CODE (tp) = type_code;
            }
-         if (TYPE_NAME (tp) == NULL || !DEPRECATED_STREQ (TYPE_NAME (tp), name))
+         if (TYPE_NAME (tp) == NULL
+             || strcmp (TYPE_NAME (tp), name) != 0)
            TYPE_NAME (tp) = obsavestring (name, strlen (name),
-                                          &current_objfile->type_obstack);
+                                          &current_objfile->objfile_obstack);
        }
     }
   if (t->bt == btTypedef)
@@ -1693,11 +1692,11 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
       TYPE_FIELDS (tp) = ((struct field *)
                          TYPE_ALLOC (tp, 2 * sizeof (struct field)));
       TYPE_FIELD_NAME (tp, 0) = obsavestring ("Low", strlen ("Low"),
-                                           &current_objfile->type_obstack);
+                                           &current_objfile->objfile_obstack);
       TYPE_FIELD_BITPOS (tp, 0) = AUX_GET_DNLOW (bigend, ax);
       ax++;
       TYPE_FIELD_NAME (tp, 1) = obsavestring ("High", strlen ("High"),
-                                           &current_objfile->type_obstack);
+                                           &current_objfile->objfile_obstack);
       TYPE_FIELD_BITPOS (tp, 1) = AUX_GET_DNHIGH (bigend, ax);
       ax++;
     }
@@ -1987,7 +1986,8 @@ parse_procedure (PDR *pr, struct symtab *search_symtab,
 
       /* Correct incorrect setjmp procedure descriptor from the library
          to make backtrace through setjmp work.  */
-      if (e->pdr.pcreg == 0 && DEPRECATED_STREQ (sh_name, "setjmp"))
+      if (e->pdr.pcreg == 0
+         && strcmp (sh_name, "setjmp") == 0)
        {
          complaint (&symfile_complaints, "fixing bad setjmp PDR from libc");
          e->pdr.pcreg = RA_REGNUM;
@@ -2257,7 +2257,7 @@ parse_partial_symbols (struct objfile *objfile)
       && (bfd_get_section_flags (cur_bfd, text_sect) & SEC_RELOC))
     relocatable = 1;
 
-  extern_tab = (EXTR *) obstack_alloc (&objfile->psymbol_obstack,
+  extern_tab = (EXTR *) obstack_alloc (&objfile->objfile_obstack,
                                       sizeof (EXTR) * hdr->iextMax);
 
   includes_allocated = 30;
@@ -2301,7 +2301,7 @@ parse_partial_symbols (struct objfile *objfile)
   /* Allocate the global pending list.  */
   pending_list =
     ((struct mdebug_pending **)
-     obstack_alloc (&objfile->psymbol_obstack,
+     obstack_alloc (&objfile->objfile_obstack,
                    hdr->ifdMax * sizeof (struct mdebug_pending *)));
   memset (pending_list, 0,
          hdr->ifdMax * sizeof (struct mdebug_pending *));
@@ -2553,7 +2553,7 @@ parse_partial_symbols (struct objfile *objfile)
                                  objfile->global_psymbols.next,
                                  objfile->static_psymbols.next);
       pst->read_symtab_private = ((char *)
-                                 obstack_alloc (&objfile->psymbol_obstack,
+                                 obstack_alloc (&objfile->objfile_obstack,
                                                 sizeof (struct symloc)));
       memset (pst->read_symtab_private, 0, sizeof (struct symloc));
 
@@ -2608,7 +2608,8 @@ parse_partial_symbols (struct objfile *objfile)
                          ((char *) debug_info->external_sym
                           + (fh->isymBase + 1) * external_sym_size),
                          &sh);
-         if (DEPRECATED_STREQ (debug_info->ss + fh->issBase + sh.iss, stabs_symbol))
+         if (strcmp (debug_info->ss + fh->issBase + sh.iss,
+                     stabs_symbol) == 0)
            processing_gcc_compilation = 2;
        }
 
@@ -2929,12 +2930,13 @@ parse_partial_symbols (struct objfile *objfile)
                         things like "break c-exp.y:435" need to work (I
                         suppose the psymtab_include_list could be hashed or put
                         in a binary tree, if profiling shows this is a major hog).  */
-                     if (pst && DEPRECATED_STREQ (namestring, pst->filename))
+                     if (pst && strcmp (namestring, pst->filename) == 0)
                        continue;
                      {
                        int i;
                        for (i = 0; i < includes_used; i++)
-                         if (DEPRECATED_STREQ (namestring, psymtab_include_list[i]))
+                         if (strcmp (namestring,
+                                     psymtab_include_list[i]) == 0)
                            {
                              i = -1;
                              break;
@@ -3654,7 +3656,7 @@ parse_partial_symbols (struct objfile *objfile)
       pst->number_of_dependencies = 0;
       pst->dependencies =
        ((struct partial_symtab **)
-        obstack_alloc (&objfile->psymbol_obstack,
+        obstack_alloc (&objfile->objfile_obstack,
                        ((fh->crfd - 1)
                         * sizeof (struct partial_symtab *))));
       for (s_idx = 1; s_idx < fh->crfd; s_idx++)
@@ -3861,8 +3863,8 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename)
                      ((char *) debug_info->external_sym
                       + (fh->isymBase + 1) * external_sym_size),
                      &sh);
-      if (DEPRECATED_STREQ (debug_info->ss + fh->issBase + sh.iss,
-                stabs_symbol))
+      if (strcmp (debug_info->ss + fh->issBase + sh.iss,
+                 stabs_symbol) == 0)
        {
          /* We indicate that this is a GCC compilation so that certain
             features will be enabled in stabsread/dbxread.  */
@@ -3941,7 +3943,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename)
                     procedure specific info */
                  struct mips_extra_func_info *e =
                  ((struct mips_extra_func_info *)
-                  obstack_alloc (&current_objfile->symbol_obstack,
+                  obstack_alloc (&current_objfile->objfile_obstack,
                                  sizeof (struct mips_extra_func_info)));
                  struct symbol *s = new_symbol (MIPS_EFI_SYMBOL_NAME);
 
@@ -4502,7 +4504,7 @@ add_line (struct linetable *lt, int lineno, CORE_ADDR adr, int last)
 static int
 compare_blocks (const void *arg1, const void *arg2)
 {
-  int addr_diff;
+  LONGEST addr_diff;
   struct block **b1 = (struct block **) arg1;
   struct block **b2 = (struct block **) arg2;
 
@@ -4585,7 +4587,7 @@ new_symtab (char *name, int maxlines, struct objfile *objfile)
 
   s->free_code = free_linetable;
   s->debugformat = obsavestring ("ECOFF", 5,
-                                &objfile->symbol_obstack);
+                                &objfile->objfile_obstack);
   return (s);
 }
 
@@ -4602,7 +4604,7 @@ new_psymtab (char *name, struct objfile *objfile)
   /* Keep a backpointer to the file's symbols */
 
   psymtab->read_symtab_private = ((char *)
-                                 obstack_alloc (&objfile->psymbol_obstack,
+                                 obstack_alloc (&objfile->objfile_obstack,
                                                 sizeof (struct symloc)));
   memset (psymtab->read_symtab_private, 0, sizeof (struct symloc));
   CUR_BFD (psymtab) = cur_bfd;
@@ -4690,7 +4692,7 @@ static struct symbol *
 new_symbol (char *name)
 {
   struct symbol *s = ((struct symbol *)
-                     obstack_alloc (&current_objfile->symbol_obstack,
+                     obstack_alloc (&current_objfile->objfile_obstack,
                                     sizeof (struct symbol)));
 
   memset (s, 0, sizeof (*s));
@@ -4733,7 +4735,7 @@ elfmdebug_build_psymtabs (struct objfile *objfile,
   back_to = make_cleanup_discard_minimal_symbols ();
 
   info = ((struct ecoff_debug_info *)
-         obstack_alloc (&objfile->psymbol_obstack,
+         obstack_alloc (&objfile->objfile_obstack,
                         sizeof (struct ecoff_debug_info)));
 
   if (!(*swap->read_debug_info) (abfd, sec, info))
@@ -4745,126 +4747,6 @@ elfmdebug_build_psymtabs (struct objfile *objfile,
   install_minimal_symbols (objfile);
   do_cleanups (back_to);
 }
-\f
-
-/* Things used for calling functions in the inferior.
-   These functions are exported to our companion
-   mips-tdep.c file and are here because they play
-   with the symbol-table explicitly. */
-
-/* Sigtramp: make sure we have all the necessary information
-   about the signal trampoline code. Since the official code
-   from MIPS does not do so, we make up that information ourselves.
-   If they fix the library (unlikely) this code will neutralize itself. */
-
-/* FIXME: This function is called only by mips-tdep.c.  It needs to be
-   here because it calls functions defined in this file, but perhaps
-   this could be handled in a better way.  Only compile it in when
-   tm-mips.h is included. */
-
-#ifdef TM_MIPS_H
-
-void
-fixup_sigtramp (void)
-{
-  struct symbol *s;
-  struct symtab *st;
-  struct block *b, *b0 = NULL;
-
-  sigtramp_address = -1;
-
-  /* We have to handle the following cases here:
-     a) The Mips library has a sigtramp label within sigvec.
-     b) Irix has a _sigtramp which we want to use, but it also has sigvec.  */
-  s = lookup_symbol ("sigvec", 0, VAR_DOMAIN, 0, NULL);
-  if (s != 0)
-    {
-      b0 = SYMBOL_BLOCK_VALUE (s);
-      s = lookup_symbol ("sigtramp", b0, VAR_DOMAIN, 0, NULL);
-    }
-  if (s == 0)
-    {
-      /* No sigvec or no sigtramp inside sigvec, try _sigtramp.  */
-      s = lookup_symbol ("_sigtramp", 0, VAR_DOMAIN, 0, NULL);
-    }
-
-  /* But maybe this program uses its own version of sigvec */
-  if (s == 0)
-    return;
-
-  /* Did we or MIPSco fix the library ? */
-  if (SYMBOL_CLASS (s) == LOC_BLOCK)
-    {
-      sigtramp_address = BLOCK_START (SYMBOL_BLOCK_VALUE (s));
-      sigtramp_end = BLOCK_END (SYMBOL_BLOCK_VALUE (s));
-      return;
-    }
-
-  sigtramp_address = SYMBOL_VALUE (s);
-  sigtramp_end = sigtramp_address + 0x88;      /* black magic */
-
-  /* But what symtab does it live in ? */
-  st = find_pc_symtab (SYMBOL_VALUE (s));
-
-  /*
-   * Ok, there goes the fix: turn it into a procedure, with all the
-   * needed info.  Note we make it a nested procedure of sigvec,
-   * which is the way the (assembly) code is actually written.
-   */
-  SYMBOL_DOMAIN (s) = VAR_DOMAIN;
-  SYMBOL_CLASS (s) = LOC_BLOCK;
-  SYMBOL_TYPE (s) = init_type (TYPE_CODE_FUNC, 4, 0, (char *) NULL,
-                              st->objfile);
-  TYPE_TARGET_TYPE (SYMBOL_TYPE (s)) = mdebug_type_void;
-
-  /* Need a block to allocate MIPS_EFI_SYMBOL_NAME in */
-  b = new_block (NON_FUNCTION_BLOCK);
-  SYMBOL_BLOCK_VALUE (s) = b;
-  BLOCK_START (b) = sigtramp_address;
-  BLOCK_END (b) = sigtramp_end;
-  BLOCK_FUNCTION (b) = s;
-  BLOCK_SUPERBLOCK (b) = BLOCK_SUPERBLOCK (b0);
-  add_block (b, st);
-  sort_blocks (st);
-
-  /* Make a MIPS_EFI_SYMBOL_NAME entry for it */
-  {
-    struct mips_extra_func_info *e =
-    ((struct mips_extra_func_info *)
-     xzalloc (sizeof (struct mips_extra_func_info)));
-
-    e->numargs = 0;            /* the kernel thinks otherwise */
-    e->pdr.frameoffset = 32;
-    e->pdr.framereg = SP_REGNUM;
-    /* Note that setting pcreg is no longer strictly necessary as
-       mips_frame_saved_pc is now aware of signal handler frames.  */
-    e->pdr.pcreg = PC_REGNUM;
-    e->pdr.regmask = -2;
-    /* Offset to saved r31, in the sigtramp case the saved registers
-       are above the frame in the sigcontext.
-       We have 4 alignment bytes, 12 bytes for onstack, mask and pc,
-       32 * 4 bytes for the general registers, 12 bytes for mdhi, mdlo, ownedfp
-       and 32 * 4 bytes for the floating point registers.  */
-    e->pdr.regoffset = 4 + 12 + 31 * 4;
-    e->pdr.fregmask = -1;
-    /* Offset to saved f30 (first saved *double* register).  */
-    e->pdr.fregoffset = 4 + 12 + 32 * 4 + 12 + 30 * 4;
-    e->pdr.isym = (long) s;
-    e->pdr.adr = sigtramp_address;
-
-    current_objfile = st->objfile;     /* Keep new_symbol happy */
-    s = new_symbol (MIPS_EFI_SYMBOL_NAME);
-    SYMBOL_VALUE (s) = (long) e;
-    SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
-    SYMBOL_CLASS (s) = LOC_CONST;
-    SYMBOL_TYPE (s) = mdebug_type_void;
-    current_objfile = NULL;
-  }
-
-  dict_add_symbol (BLOCK_DICT (b), s);
-}
-
-#endif /* TM_MIPS_H */
 
 void
 _initialize_mdebugread (void)
This page took 0.029134 seconds and 4 git commands to generate.