* top.h (lim_at_start): Declare.
[deliverable/binutils-gdb.git] / gdb / hpread.c
index cf5c563275b9b680feebf20569fa3f00d21b8c44..f955fb9c5536cf3aa7ae7cfc5baafa1f4fcf0fab 100644 (file)
@@ -35,6 +35,8 @@
 #include "gdb-stabs.h"
 #include "gdbtypes.h"
 #include "demangle.h"
+#include "somsolib.h"
+#include "gdb_assert.h"
 
 /* Private information attached to an objfile which we use to find
    and internalize the HP C debug symbols within that objfile.  */
@@ -87,23 +89,6 @@ struct hpread_symfile_info
 #define WITHIN_FUNCTION(o)      (HPUX_SYMFILE_INFO(o)->within_function)
 #define CURRENT_FUNCTION_VALUE(o) (HPUX_SYMFILE_INFO(o)->current_function_value)
 
-/* Given the native debug symbol SYM, set NAMEP to the name associated
-   with the debug symbol.  Note we may be called with a debug symbol which
-   has no associated name, in that case we return an empty string.
-
-   Also note we "know" that the name for any symbol is always in the
-   same place.  Hence we don't have to conditionalize on the symbol type.  */
-#define SET_NAMESTRING(SYM, NAMEP, OBJFILE) \
-  if (! hpread_has_name ((SYM)->dblock.kind)) \
-    *NAMEP = ""; \
-  else if (((unsigned)(SYM)->dsfile.name) >= VT_SIZE (OBJFILE)) \
-    { \
-      complaint (&symfile_complaints, "bad string table offset in symbol %d", \
-                symnum); \
-      *NAMEP = ""; \
-    } \
-  else \
-    *NAMEP = (SYM)->dsfile.name + VT (OBJFILE)
 \f
 /* We put a pointer to this structure in the read_symtab_private field
    of the psymtab.  */
@@ -155,6 +140,7 @@ lbrac_mismatch_complaint (int arg1)
 
 /* Forward procedure declarations */
 
+/* Used in somread.c.  */
 void hpread_symfile_init (struct objfile *);
 
 void do_pxdb (bfd *);
@@ -163,6 +149,9 @@ void hpread_build_psymtabs (struct objfile *, int);
 
 void hpread_symfile_finish (struct objfile *);
 
+static void set_namestring (union dnttentry *sym, char **namep,
+                            struct objfile *objfile);
+
 static union dnttentry *hpread_get_gntt (int, struct objfile *);
 
 static union dnttentry *hpread_get_lntt (int index, struct objfile *objfile);
@@ -184,11 +173,11 @@ static unsigned long hpread_get_line (sltpointer, struct objfile *);
 
 static CORE_ADDR hpread_get_location (sltpointer, struct objfile *);
 
-int hpread_has_name (enum dntt_entry_type kind);
+static int hpread_has_name (enum dntt_entry_type kind);
 
 static void hpread_psymtab_to_symtab_1 (struct partial_symtab *);
 
-void hpread_psymtab_to_symtab (struct partial_symtab *);
+static void hpread_psymtab_to_symtab (struct partial_symtab *);
 
 static struct symtab *hpread_expand_symtab
   (struct objfile *, int, int, CORE_ADDR, int,
@@ -273,7 +262,7 @@ static struct type *fixup_method = NULL;
 #include "gdb_string.h"
 
 /* check for the existence of a file, given its full pathname */
-int
+static int
 file_exists (char *filename)
 {
   if (filename)
@@ -302,6 +291,28 @@ trans_lang (enum hp_language in_lang)
 
 static char main_string[] = "main";
 \f
+
+/* Given the native debug symbol SYM, set NAMEP to the name associated
+   with the debug symbol.  Note we may be called with a debug symbol which
+   has no associated name, in that case we return an empty string.  */
+
+static void
+set_namestring (union dnttentry *sym, char **namep, struct objfile *objfile)
+{
+  /* Note that we "know" that the name for any symbol is always in the same
+     place.  Hence we don't have to conditionalize on the symbol type.  */
+  if (! hpread_has_name (sym->dblock.kind))
+    *namep = "";
+  else if ((unsigned) sym->dsfile.name >= VT_SIZE (objfile))
+    {
+      complaint (&symfile_complaints, "bad string table offset in symbol %d",
+                symnum);
+      *namep = "";
+    }
+  else
+    *namep = sym->dsfile.name + VT (objfile);
+}
+
 /* Call PXDB to process our file.
 
    Approach copied from DDE's "dbgk_run_pxdb".  Note: we
@@ -311,7 +322,7 @@ static char main_string[] = "main";
    NOTE: uses system function and string functions directly.
 
    Return value: 1 if ok, 0 if not */
-int
+static int
 hpread_call_pxdb (const char *file_name)
 {
   char *p;
@@ -344,7 +355,7 @@ hpread_call_pxdb (const char *file_name)
    by PXDB, and we have thus called PXDB to do this processing
    and the file therefore needs to be re-loaded.  Otherwise
    return 0. */
-int
+static int
 hpread_pxdb_needed (bfd *sym_bfd)
 {
   asection *pinfo_section, *debug_section, *header_section;
@@ -779,7 +790,7 @@ scan_procs (int *curr_pd_p, quick_procedure_entry *qPD, int max_procs,
                                           strlen (rtn_name),
                                           rtn_dem_name,
                                           strlen (rtn_dem_name),
-                                          VAR_NAMESPACE,
+                                          VAR_DOMAIN,
                                           LOC_BLOCK,   /* "I am a routine"        */
                                           &objfile->global_psymbols,
                                           (qPD[curr_pd].adrStart +     /* Starting address of rtn */
@@ -792,7 +803,7 @@ scan_procs (int *curr_pd_p, quick_procedure_entry *qPD, int max_procs,
                                           strlen (rtn_name),
                                           rtn_dem_name,
                                           strlen (rtn_dem_name),
-                                          VAR_NAMESPACE,
+                                          VAR_DOMAIN,
                                           LOC_BLOCK,   /* "I am a routine"        */
                                           &objfile->static_psymbols,
                                           (qPD[curr_pd].adrStart +     /* Starting address of rtn */
@@ -827,7 +838,7 @@ scan_procs (int *curr_pd_p, quick_procedure_entry *qPD, int max_procs,
    a file can result in a compiled object which does not have a module
    entry for it, so in such cases we create a psymtab for the file.  */
 
-int
+static int
 hpread_quick_traverse (struct objfile *objfile, char *gntt_bits,
                       char *vt_bits, PXDB_header_ptr pxdb_header_p)
 {
@@ -1016,7 +1027,7 @@ hpread_quick_traverse (struct objfile *objfile, char *gntt_bits,
   while (VALID_CURR_FILE || VALID_CURR_MODULE)
     {
 
-      char *mod_name_string;
+      char *mod_name_string = NULL;
       char *full_name_string;
 
       /* First check for modules like "version.c", which have no code
@@ -1532,7 +1543,7 @@ hpread_quick_traverse (struct objfile *objfile, char *gntt_bits,
 
 /* Get appropriate header, based on pxdb type. 
    Return value: 1 if ok, 0 if not */
-int
+static int
 hpread_get_header (struct objfile *objfile, PXDB_header_ptr pxdb_header_p)
 {
   asection *pinfo_section, *debug_section, *header_section;
@@ -1656,7 +1667,7 @@ hpread_symfile_init (struct objfile *objfile)
   asection *vt_section, *slt_section, *lntt_section, *gntt_section;
 
   /* Allocate struct to keep track of the symfile */
-  objfile->sym_private = (PTR)
+  objfile->sym_private =
     xmmalloc (objfile->md, sizeof (struct hpread_symfile_info));
   memset (objfile->sym_private, 0, sizeof (struct hpread_symfile_info));
 
@@ -1917,7 +1928,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
 
                /* A source file of some kind.  Note this may simply
                   be an included file.  */
-               SET_NAMESTRING (dn_bufp, &namestring, objfile);
+               set_namestring (dn_bufp, &namestring, objfile);
 
                /* Check if this is the source file we are already working
                   with.  */
@@ -1951,7 +1962,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
                        psymtab_include_list = (char **)
                          alloca ((includes_allocated *= 2) *
                                  sizeof (char *));
-                       memcpy ((PTR) psymtab_include_list, (PTR) orig,
+                       memcpy (psymtab_include_list, orig,
                                includes_used * sizeof (char *));
                      }
                    continue;
@@ -2022,7 +2033,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
                }
 
              /* Now begin a new module and a new psymtab for it */
-             SET_NAMESTRING (dn_bufp, &namestring, objfile);
+             set_namestring (dn_bufp, &namestring, objfile);
              valu = hpread_get_textlow (i, hp_symnum, objfile, symcount);
              valu += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
              if (!pst)
@@ -2048,15 +2059,15 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
                texthigh = valu;
              valu = dn_bufp->dfunc.lowaddr +
                ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
-             SET_NAMESTRING (dn_bufp, &namestring, objfile);
+             set_namestring (dn_bufp, &namestring, objfile);
              if (dn_bufp->dfunc.global)
                add_psymbol_to_list (namestring, strlen (namestring),
-                                    VAR_NAMESPACE, LOC_BLOCK,
+                                    VAR_DOMAIN, LOC_BLOCK,
                                     &objfile->global_psymbols, valu,
                                     0, language_unknown, objfile);
              else
                add_psymbol_to_list (namestring, strlen (namestring),
-                                    VAR_NAMESPACE, LOC_BLOCK,
+                                    VAR_DOMAIN, LOC_BLOCK,
                                     &objfile->static_psymbols, valu,
                                     0, language_unknown, objfile);
              within_function = 1;
@@ -2069,15 +2080,15 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
                texthigh = valu;
              valu = dn_bufp->ddocfunc.lowaddr +
                ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
-             SET_NAMESTRING (dn_bufp, &namestring, objfile);
+             set_namestring (dn_bufp, &namestring, objfile);
              if (dn_bufp->ddocfunc.global)
                add_psymbol_to_list (namestring, strlen (namestring),
-                                    VAR_NAMESPACE, LOC_BLOCK,
+                                    VAR_DOMAIN, LOC_BLOCK,
                                     &objfile->global_psymbols, valu,
                                     0, language_unknown, objfile);
              else
                add_psymbol_to_list (namestring, strlen (namestring),
-                                    VAR_NAMESPACE, LOC_BLOCK,
+                                    VAR_DOMAIN, LOC_BLOCK,
                                     &objfile->static_psymbols, valu,
                                     0, language_unknown, objfile);
              within_function = 1;
@@ -2118,7 +2129,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
              {
                /* Variables, typedefs an the like.  */
                enum address_class storage;
-               namespace_enum namespace;
+               domain_enum domain;
 
                /* Don't add locals to the partial symbol table.  */
                if (within_function
@@ -2126,11 +2137,11 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
                        || dn_bufp->dblock.kind == DNTT_TYPE_DVAR))
                  continue;
 
-               /* TAGDEFs go into the structure namespace.  */
+               /* TAGDEFs go into the structure domain.  */
                if (dn_bufp->dblock.kind == DNTT_TYPE_TAGDEF)
-                 namespace = STRUCT_NAMESPACE;
+                 domain = STRUCT_DOMAIN;
                else
-                 namespace = VAR_NAMESPACE;
+                 domain = VAR_DOMAIN;
 
                /* What kind of "storage" does this use?  */
                if (dn_bufp->dblock.kind == DNTT_TYPE_SVAR)
@@ -2143,7 +2154,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
                else
                  storage = LOC_UNDEF;
 
-               SET_NAMESTRING (dn_bufp, &namestring, objfile);
+               set_namestring (dn_bufp, &namestring, objfile);
                if (!pst)
                  {
                    pst = hpread_start_psymtab (objfile,
@@ -2168,7 +2179,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
                if (dn_bufp->dsvar.global)
                  {
                    add_psymbol_to_list (namestring, strlen (namestring),
-                                        namespace, storage,
+                                        domain, storage,
                                         &objfile->global_psymbols,
                                         valu,
                                         0, language_unknown, objfile);
@@ -2176,18 +2187,18 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
                else
                  {
                    add_psymbol_to_list (namestring, strlen (namestring),
-                                        namespace, storage,
+                                        domain, storage,
                                         &objfile->static_psymbols,
                                         valu,
                                         0, language_unknown, objfile);
                  }
 
                /* For TAGDEF's, the above code added the tagname to the
-                  struct namespace. This will cause tag "t" to be found
+                  struct domain. This will cause tag "t" to be found
                   on a reference of the form "(struct t) x". But for
                   C++ classes, "t" will also be a typename, which we
                   want to find on a reference of the form "ptype t".
-                  Therefore, we also add "t" to the var namespace.
+                  Therefore, we also add "t" to the var domain.
                   Do the same for enum's due to the way aCC generates
                   debug info for these (see more extended comment
                   in hp-symtab-read.c).
@@ -2206,7 +2217,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
                        if (global)
                          {
                            add_psymbol_to_list (namestring, strlen (namestring),
-                                                VAR_NAMESPACE, storage,
+                                                VAR_DOMAIN, storage,
                                                 &objfile->global_psymbols,
                                                 dn_bufp->dsvar.location,
                                              0, language_unknown, objfile);
@@ -2214,7 +2225,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
                        else
                          {
                            add_psymbol_to_list (namestring, strlen (namestring),
-                                                VAR_NAMESPACE, storage,
+                                                VAR_DOMAIN, storage,
                                                 &objfile->static_psymbols,
                                                 dn_bufp->dsvar.location,
                                              0, language_unknown, objfile);
@@ -2227,7 +2238,7 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
            case DNTT_TYPE_MEMENUM:
            case DNTT_TYPE_CONST:
              /* Constants and members of enumerated types.  */
-             SET_NAMESTRING (dn_bufp, &namestring, objfile);
+             set_namestring (dn_bufp, &namestring, objfile);
              if (!pst)
                {
                  pst = hpread_start_psymtab (objfile,
@@ -2239,12 +2250,12 @@ hpread_build_psymtabs (struct objfile *objfile, int mainline)
                }
              if (dn_bufp->dconst.global)
                add_psymbol_to_list (namestring, strlen (namestring),
-                                    VAR_NAMESPACE, LOC_CONST,
+                                    VAR_DOMAIN, LOC_CONST,
                                     &objfile->global_psymbols, 0,
                                     0, language_unknown, objfile);
              else
                add_psymbol_to_list (namestring, strlen (namestring),
-                                    VAR_NAMESPACE, LOC_CONST,
+                                    VAR_DOMAIN, LOC_CONST,
                                     &objfile->static_psymbols, 0,
                                     0, language_unknown, objfile);
              continue;
@@ -2284,7 +2295,7 @@ hpread_symfile_finish (struct objfile *objfile)
 
 /* Various small functions to get entries in the debug symbol sections.  */
 
-union dnttentry *
+static union dnttentry *
 hpread_get_lntt (int index, struct objfile *objfile)
 {
   return (union dnttentry *)
@@ -2298,7 +2309,7 @@ hpread_get_gntt (int index, struct objfile *objfile)
     &(GNTT (objfile)[(index * sizeof (struct dntt_type_block))]);
 }
 
-union sltentry *
+static union sltentry *
 hpread_get_slt (int index, struct objfile *objfile)
 {
   return (union sltentry *) &(SLT (objfile)[index * sizeof (union sltentry)]);
@@ -2313,7 +2324,7 @@ static unsigned long
 hpread_get_textlow (int global, int index, struct objfile *objfile,
                    int symcount)
 {
-  union dnttentry *dn_bufp;
+  union dnttentry *dn_bufp = NULL;
   struct minimal_symbol *msymbol;
 
   /* Look for a DNTT_TYPE_FUNCTION symbol.  */
@@ -2332,6 +2343,11 @@ hpread_get_textlow (int global, int index, struct objfile *objfile,
             && index < symcount);
     }
 
+  /* NOTE: cagney/2003-03-29: If !(index < symcount), dn_bufp is left
+     undefined and that means that the test below is using a garbage
+     pointer from the stack.  */
+  gdb_assert (dn_bufp != NULL);
+
   /* Avoid going past a DNTT_TYPE_END when looking for a DNTT_TYPE_FUNCTION.  This
      might happen when a sourcefile has no functions.  */
   if (dn_bufp->dblock.kind == DNTT_TYPE_END)
@@ -2573,7 +2589,7 @@ hpread_get_location (sltpointer index, struct objfile *objfile)
  * leave it here in case it proves useful later on. - RT).
  */
 
-int
+static int
 hpread_has_name (enum dntt_entry_type kind)
 {
   switch (kind)
@@ -2706,7 +2722,7 @@ hpread_psymtab_to_symtab_1 (struct partial_symtab *pst)
 /* Read in all of the symbols for a given psymtab for real.
    Be verbose about it if the user wants that.  */
 
-void
+static void
 hpread_psymtab_to_symtab (struct partial_symtab *pst)
 {
   /* Get out quick if given junk.  */
@@ -2827,8 +2843,8 @@ hpread_expand_symtab (struct objfile *objfile, int sym_offset, int sym_size,
       if (dn_bufp->dblock.extension)
        continue;
 
-      /* Yow!  We call SET_NAMESTRING on things without names!  */
-      SET_NAMESTRING (dn_bufp, &namestring, objfile);
+      /* Yow!  We call set_namestring on things without names!  */
+      set_namestring (dn_bufp, &namestring, objfile);
 
       hpread_process_one_debug_symbol (dn_bufp, namestring, section_offsets,
                                       objfile, text_offset, text_size,
@@ -3115,10 +3131,10 @@ hpread_read_enum_type (dnttpointer hp_type, union dnttentry *dn_bufp,
       sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
                                             sizeof (struct symbol));
       memset (sym, 0, sizeof (struct symbol));
-      SYMBOL_NAME (sym) = obsavestring (name, strlen (name),
+      DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name),
                                        &objfile->symbol_obstack);
       SYMBOL_CLASS (sym) = LOC_CONST;
-      SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+      SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
       SYMBOL_VALUE (sym) = memp->dmember.value;
       add_symbol_to_list (sym, symlist);
       nsyms++;
@@ -3149,7 +3165,7 @@ hpread_read_enum_type (dnttpointer hp_type, union dnttentry *dn_bufp,
        {
          struct symbol *xsym = syms->symbol[j];
          SYMBOL_TYPE (xsym) = type;
-         TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym);
+         TYPE_FIELD_NAME (type, n) = DEPRECATED_SYMBOL_NAME (xsym);
          TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym);
          TYPE_FIELD_BITSIZE (type, n) = 0;
          TYPE_FIELD_STATIC_KIND (type, n) = 0;
@@ -3223,7 +3239,7 @@ hpread_read_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
       sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
                                             sizeof (struct symbol));
       (void) memset (sym, 0, sizeof (struct symbol));
-      SYMBOL_NAME (sym) = obsavestring (name, strlen (name),
+      DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name),
                                        &objfile->symbol_obstack);
 
       /* Figure out where it lives.  */
@@ -3233,7 +3249,7 @@ hpread_read_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
        SYMBOL_CLASS (sym) = LOC_REF_ARG;
       else
        SYMBOL_CLASS (sym) = LOC_ARG;
-      SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+      SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
       if (paramp->dfparam.copyparam)
        {
          SYMBOL_VALUE (sym) = paramp->dfparam.location;
@@ -3310,7 +3326,7 @@ hpread_read_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
       for (j = 0; j < syms->nsyms; j++, n++)
        {
          struct symbol *xsym = syms->symbol[j];
-         TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym);
+         TYPE_FIELD_NAME (type, n) = DEPRECATED_SYMBOL_NAME (xsym);
          TYPE_FIELD_TYPE (type, n) = SYMBOL_TYPE (xsym);
          TYPE_FIELD_ARTIFICIAL (type, n) = 0;
          TYPE_FIELD_BITSIZE (type, n) = 0;
@@ -3351,10 +3367,10 @@ static struct type *
 hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
                               struct objfile *objfile, int newblock)
 {
-  struct type *type, *type1;
   struct pending *syms;
   struct pending *local_list = NULL;
   int nsyms = 0;
+  struct type *type;
   dnttpointer param;
   union dnttentry *paramp;
   char *name;
@@ -3370,11 +3386,17 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
     }
   else
     {
+      struct type *type1 = NULL;
       /* Nope, so read it in and store it away.  */
       if (dn_bufp->dblock.kind == DNTT_TYPE_DOC_FUNCTION ||
          dn_bufp->dblock.kind == DNTT_TYPE_DOC_MEMFUNC)
        type1 = lookup_function_type (hpread_type_lookup (dn_bufp->ddocfunc.retval,
                                                          objfile));
+      /* NOTE: cagney/2003-03-29: Oh, no not again.  TYPE1 is
+         potentially left undefined here.  Assert it isn't and hope
+         the assert never fails ...  */
+      gdb_assert (type1 != NULL);
+
       replace_type (type, type1);
 
       /* Mark it -- in the middle of processing */
@@ -3397,7 +3419,7 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
       sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
                                             sizeof (struct symbol));
       (void) memset (sym, 0, sizeof (struct symbol));
-      SYMBOL_NAME (sym) = name;
+      DEPRECATED_SYMBOL_NAME (sym) = name;
 
       /* Figure out where it lives.  */
       if (paramp->dfparam.regparam)
@@ -3406,7 +3428,7 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
        SYMBOL_CLASS (sym) = LOC_REF_ARG;
       else
        SYMBOL_CLASS (sym) = LOC_ARG;
-      SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+      SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
       if (paramp->dfparam.copyparam)
        {
          SYMBOL_VALUE (sym) = paramp->dfparam.location;
@@ -3484,7 +3506,7 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
       for (j = 0; j < syms->nsyms; j++, n++)
        {
          struct symbol *xsym = syms->symbol[j];
-         TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym);
+         TYPE_FIELD_NAME (type, n) = DEPRECATED_SYMBOL_NAME (xsym);
          TYPE_FIELD_TYPE (type, n) = SYMBOL_TYPE (xsym);
          TYPE_FIELD_ARTIFICIAL (type, n) = 0;
          TYPE_FIELD_BITSIZE (type, n) = 0;
@@ -4995,7 +5017,7 @@ hpread_record_lines (struct subfile *subfile, sltpointer s_idx,
  * Called from hpread_process_one_debug_symbol()
  * If "f" is not a member function, return NULL.
  */
-char *
+static char *
 class_of (struct type *functype)
 {
   struct type *first_param_type;
@@ -5077,9 +5099,9 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
   sym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
                                         sizeof (struct symbol));
   memset (sym, 0, sizeof (struct symbol));
-  SYMBOL_NAME (sym) = obsavestring (name, strlen (name), &objfile->symbol_obstack);
+  DEPRECATED_SYMBOL_NAME (sym) = obsavestring (name, strlen (name), &objfile->symbol_obstack);
   SYMBOL_LANGUAGE (sym) = language_auto;
-  SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+  SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
   SYMBOL_LINE (sym) = 0;
   SYMBOL_VALUE (sym) = 0;
   SYMBOL_CLASS (sym) = LOC_TYPEDEF;
@@ -5247,22 +5269,22 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
       if (SYMBOL_LANGUAGE (sym) == language_cplus)
        TYPE_FLAGS (SYMBOL_TYPE (sym)) |= TYPE_FLAG_PROTOTYPED;
 
-      /* The "SYMBOL_NAME" field is expected to be the mangled name
+      /* The "DEPRECATED_SYMBOL_NAME" field is expected to be the mangled name
        * (if any), which we get from the "alias" field of the SOM record
        * if that exists.
        */
       if ((dn_bufp->dfunc.language == HP_LANGUAGE_CPLUSPLUS) &&
          dn_bufp->dfunc.alias &&       /* has an alias */
          *(char *) (VT (objfile) + dn_bufp->dfunc.alias))      /* not a null string */
-       SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.alias;
+       DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.alias;
       else
-       SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name;
+       DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name;
 
       /* Special hack to get around HP compilers' insistence on
        * reporting "main" as "_MAIN_" for C/C++ */
-      if ((strcmp (SYMBOL_NAME (sym), "_MAIN_") == 0) &&
+      if ((strcmp (DEPRECATED_SYMBOL_NAME (sym), "_MAIN_") == 0) &&
          (strcmp (VT (objfile) + dn_bufp->dfunc.name, "main") == 0))
-       SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name;
+       DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->dfunc.name;
 
       /* The SYMBOL_CPLUS_DEMANGLED_NAME field is expected to
        * be the demangled name.
@@ -5281,7 +5303,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
           * working around the issue in stack.c. - RT
           */
          SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack);
-         if ((SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->dfunc.alias) &&
+         if ((DEPRECATED_SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->dfunc.alias) &&
              (!SYMBOL_CPLUS_DEMANGLED_NAME (sym)))
            {
 
@@ -5365,22 +5387,22 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
       SYMBOL_CLASS (sym) = LOC_BLOCK;
       SYMBOL_TYPE (sym) = hpread_read_doc_function_type (hp_type, dn_bufp, objfile, 1);
 
-      /* The "SYMBOL_NAME" field is expected to be the mangled name
+      /* The "DEPRECATED_SYMBOL_NAME" field is expected to be the mangled name
        * (if any), which we get from the "alias" field of the SOM record
        * if that exists.
        */
       if ((dn_bufp->ddocfunc.language == HP_LANGUAGE_CPLUSPLUS) &&
          dn_bufp->ddocfunc.alias &&    /* has an alias */
          *(char *) (VT (objfile) + dn_bufp->ddocfunc.alias))   /* not a null string */
-       SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.alias;
+       DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.alias;
       else
-       SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name;
+       DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name;
 
       /* Special hack to get around HP compilers' insistence on
        * reporting "main" as "_MAIN_" for C/C++ */
-      if ((strcmp (SYMBOL_NAME (sym), "_MAIN_") == 0) &&
+      if ((strcmp (DEPRECATED_SYMBOL_NAME (sym), "_MAIN_") == 0) &&
          (strcmp (VT (objfile) + dn_bufp->ddocfunc.name, "main") == 0))
-       SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name;
+       DEPRECATED_SYMBOL_NAME (sym) = VT (objfile) + dn_bufp->ddocfunc.name;
 
       if (dn_bufp->ddocfunc.language == HP_LANGUAGE_CPLUSPLUS)
        {
@@ -5398,7 +5420,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
           */
          SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack);
 
-         if ((SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->ddocfunc.alias) &&
+         if ((DEPRECATED_SYMBOL_NAME (sym) == VT (objfile) + dn_bufp->ddocfunc.alias) &&
              (!SYMBOL_CPLUS_DEMANGLED_NAME (sym)))
            {
 
@@ -5639,7 +5661,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
       /* DNTT_TYPE_IMPORT is not handled */
 
     case DNTT_TYPE_LABEL:
-      SYMBOL_NAMESPACE (sym) = LABEL_NAMESPACE;
+      SYMBOL_DOMAIN (sym) = LABEL_DOMAIN;
       break;
 
     case DNTT_TYPE_FPARAM:
@@ -5674,7 +5696,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
        SYMBOL_CLASS (sym) = LOC_REF_ARG;
       else
        SYMBOL_CLASS (sym) = LOC_ARG;
-      SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+      SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
       if (dn_bufp->dfparam.copyparam)
        {
          SYMBOL_VALUE (sym) = dn_bufp->dfparam.location;
@@ -5703,7 +5725,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
        * in the symbol table contains a pointer to the real "g".
        * We use the storage class LOC_INDIRECT to indicate this. RT
        */
-      if (is_in_import_list (SYMBOL_NAME (sym), objfile))
+      if (is_in_import_list (DEPRECATED_SYMBOL_NAME (sym), objfile))
        SYMBOL_CLASS (sym) = LOC_INDIRECT;
 
       SYMBOL_VALUE_ADDRESS (sym) = dn_bufp->dsvar.location + data_offset;
@@ -5790,9 +5812,9 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
 
     case DNTT_TYPE_TYPEDEF:
       /* A typedef. We do want to process these, since a name is
-       * added to the namespace for the typedef'ed name.
+       * added to the domain for the typedef'ed name.
        */
-      SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+      SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
       SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->dtype.type, objfile);
       if (dn_bufp->dtype.global)
        add_symbol_to_list (sym, &global_symbols);
@@ -5807,10 +5829,10 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
        int global = dn_bufp->dtag.global;
        /* Structure, union, enum, template, or class tag definition */
        /* We do want to process these, since a name is
-        * added to the namespace for the tag name (and if C++ class,
+        * added to the domain for the tag name (and if C++ class,
         * for the typename also).
         */
-       SYMBOL_NAMESPACE (sym) = STRUCT_NAMESPACE;
+       SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
 
        /* The tag contains in its "type" field a pointer to the
         * DNTT_TYPE_STRUCT, DNTT_TYPE_UNION, DNTT_TYPE_ENUM, 
@@ -5818,8 +5840,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
         * record that actually defines the type.
         */
        SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->dtype.type, objfile);
-       TYPE_NAME (sym->type) = SYMBOL_NAME (sym);
-       TYPE_TAG_NAME (sym->type) = SYMBOL_NAME (sym);
+       TYPE_NAME (sym->type) = DEPRECATED_SYMBOL_NAME (sym);
+       TYPE_TAG_NAME (sym->type) = DEPRECATED_SYMBOL_NAME (sym);
        if (dn_bufp->dtag.global)
          add_symbol_to_list (sym, &global_symbols);
        else if (WITHIN_FUNCTION (objfile))
@@ -5865,9 +5887,9 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
            newsym = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
                                                    sizeof (struct symbol));
            memset (newsym, 0, sizeof (struct symbol));
-           SYMBOL_NAME (newsym) = name;
+           DEPRECATED_SYMBOL_NAME (newsym) = name;
            SYMBOL_LANGUAGE (newsym) = language_auto;
-           SYMBOL_NAMESPACE (newsym) = VAR_NAMESPACE;
+           SYMBOL_DOMAIN (newsym) = VAR_DOMAIN;
            SYMBOL_LINE (newsym) = 0;
            SYMBOL_VALUE (newsym) = 0;
            SYMBOL_CLASS (newsym) = LOC_TYPEDEF;
This page took 0.033996 seconds and 4 git commands to generate.