1999-01-19 Fernando Nasser <fnasser@totem.to.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / partial-stab.h
index c51f091f1d45b711396d055dfc056611f979fee8..d74c1c9ca5f44d75d20b5f3598c96a3aab11d2bd 100644 (file)
@@ -1,5 +1,5 @@
 /* Shared code to pre-read a stab (dbx-style), when building a psymtab.
-   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996
+   Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998
    Free Software Foundation, Inc.
 
 This file is part of GDB.
@@ -145,7 +145,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
        case N_UNDF:
 #ifdef DBXREAD_ONLY
-         if (processing_acc_compilation && bufp->n_strx == 1) {
+         if (processing_acc_compilation && CUR_SYMBOL_STRX == 1) {
            /* Deal with relative offsets in the string table
               used in ELF+STAB under Solaris.  If we want to use the
               n_strx field, which contains the name of the file,
@@ -154,7 +154,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
            past_first_source_file = 1;
            file_string_table_offset = next_file_string_table_offset;
            next_file_string_table_offset =
-             file_string_table_offset + bufp->n_value;
+             file_string_table_offset + CUR_SYMBOL_VALUE;
            if (next_file_string_table_offset < file_string_table_offset)
              error ("string table offset backs up at %d", symnum);
   /* FIXME -- replace error() with complaint.  */
@@ -290,6 +290,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
                    || psymtab_language != language_cplus))
              psymtab_language = tmp_language;
 
+           if (pst == NULL)
+             {
+               /* FIXME: we should not get here without a PST to work on.
+                  Attempt to recover.  */
+               complain (&unclaimed_bincl_complaint, namestring, symnum);
+               continue;
+             }
            add_bincl_to_list (pst, namestring, CUR_SYMBOL_VALUE);
 
            /* Mark down an include file in the current psymtab */
@@ -382,7 +389,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifdef DBXREAD_ONLY
          /* See if this is an end of function stab.  */
-         if (CUR_SYMBOL_TYPE == N_FUN && ! strcmp (namestring, ""))
+         if (CUR_SYMBOL_TYPE == N_FUN && *namestring == '\000')
            {
              unsigned long valu;
 
@@ -594,8 +601,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #endif /* DBXREAD_ONLY */
              add_psymbol_to_list (namestring, p - namestring,
                                   VAR_NAMESPACE, LOC_BLOCK,
-                                  &objfile->static_psymbols, CUR_SYMBOL_VALUE,
-                                  0, psymtab_language, objfile);
+                                  &objfile->static_psymbols,
+                                  0, CUR_SYMBOL_VALUE,
+                                  psymtab_language, objfile);
              continue;
 
              /* Global functions were ignored here, but now they
@@ -639,8 +647,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #endif /* DBXREAD_ONLY */
              add_psymbol_to_list (namestring, p - namestring,
                                   VAR_NAMESPACE, LOC_BLOCK,
-                                  &objfile->global_psymbols, CUR_SYMBOL_VALUE,
-                                  0, psymtab_language, objfile);
+                                  &objfile->global_psymbols,
+                                  0, CUR_SYMBOL_VALUE,
+                                  psymtab_language, objfile);
              continue;
 
              /* Two things show up here (hopefully); static symbols of
@@ -659,6 +668,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
            case '8':
            case '9':
            case '-':
+           case '#':   /* for symbol identification (used in live ranges) */
           /* added to support cfront stabs strings */
            case 'Z':   /* for definition continuations */
            case 'P':   /* for prototypes */
@@ -785,6 +795,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
        case N_LBRAC:
        case N_NSYMS:           /* Ultrix 4.0: symbol count */
        case N_DEFD:            /* GNU Modula-2 */
+       case N_ALIAS:           /* SunPro F77: alias name, ignore for now.  */
 
        case N_OBJ:             /* useless types from Solaris */
        case N_OPT:
This page took 0.024969 seconds and 4 git commands to generate.