* doc/binutils.texi: Fix typos.
[deliverable/binutils-gdb.git] / gdb / hpread.c
index 4cc5f18c4771e3caf4f8581ac7877786f052b4e8..d64b4cae62da76a63ef3fee23d48f463de5caf1c 100644 (file)
@@ -98,7 +98,8 @@ struct hpread_symfile_info
     *NAMEP = ""; \
   else if (((unsigned)(SYM)->dsfile.name) >= VT_SIZE (OBJFILE)) \
     { \
-      complain (&string_table_offset_complaint, (char *) symnum); \
+      complaint (&symfile_complaints, "bad string table offset in symbol %d", \
+                (char *) symnum); \
       *NAMEP = ""; \
     } \
   else \
@@ -127,57 +128,20 @@ struct symloc
 #define LDSYMLEN(p) (((struct symloc *)((p)->read_symtab_private))->ldsymlen)
 #define SYMLOC(p) ((struct symloc *)((p)->read_symtab_private))
 \f
-/* FIXME: Shouldn't this stuff be in a .h file somewhere?  */
 /* Complaints about the symbols we have encountered.  */
-extern struct complaint string_table_offset_complaint;
-extern struct complaint lbrac_unmatched_complaint;
-extern struct complaint lbrac_mismatch_complaint;
-\f
-static struct complaint hpread_unhandled_end_common_complaint =
-{
-  "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_COMMON/DNTT_TYPE_END.\n", 0, 0
-};
-
-static struct complaint hpread_unhandled_type_complaint =
-{
-  "hpread_type_translate: unhandled type code.", 0, 0
-};
-
-static struct complaint hpread_struct_complaint =
-{
-  "hpread_read_struct_type: expected SVAR type...", 0, 0
-};
-
-static struct complaint hpread_array_complaint =
-{
-  "error in hpread_array_type.", 0, 0
-};
-
-static struct complaint hpread_type_lookup_complaint =
-{
-  "error in hpread_type_lookup().", 0, 0
-};
-
-
-static struct complaint hpread_unexpected_end_complaint =
-{
-  "internal error in hp-symtab-read.c: Unexpected DNTT_TYPE_END kind.", 0, 0
-};
-
-static struct complaint hpread_tagdef_complaint =
-{
-  "error processing class tagdef", 0, 0
-};
-
-static struct complaint hpread_unhandled_common_complaint =
+static void
+lbrac_unmatched_complaint (int arg1)
 {
-  "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_COMMON.", 0, 0
-};
+  complaint (&symfile_complaints, "unmatched N_LBRAC before symtab pos %d",
+            arg1);
+}
 
-static struct complaint hpread_unhandled_blockdata_complaint =
+static void
+lbrac_mismatch_complaint (int arg1)
 {
-  "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_BLOCKDATA.", 0, 0
-};
+  complaint (&symfile_complaints,
+            "N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d", arg1);
+}
 
 /* To generate dumping code, uncomment this define.  The dumping
    itself is controlled by routine-local statics called "dumping". */
@@ -220,6 +184,8 @@ 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 void hpread_psymtab_to_symtab_1 (struct partial_symtab *);
 
 void hpread_psymtab_to_symtab (struct partial_symtab *);
@@ -596,11 +562,11 @@ pst_syms_struct;
 
 static pst_syms_struct *pst_syms_array = 0;
 
-static pst_syms_count = 0;
-static pst_syms_size = 0;
+static int pst_syms_count = 0;
+static int pst_syms_size = 0;
 
 /* used by the TELL_OBJFILE macro */
-static boolean told_objfile = 0;
+static int told_objfile = 0;
 
 /* Set up psymtab symbol index stuff */
 static void
@@ -3186,6 +3152,7 @@ hpread_read_enum_type (dnttpointer hp_type, union dnttentry *dn_bufp,
          TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (xsym);
          TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym);
          TYPE_FIELD_BITSIZE (type, n) = 0;
+         TYPE_FIELD_STATIC_KIND (type, n) = 0;
        }
       if (syms == osyms)
        break;
@@ -3347,6 +3314,7 @@ hpread_read_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
          TYPE_FIELD_TYPE (type, n) = SYMBOL_TYPE (xsym);
          TYPE_FIELD_ARTIFICIAL (type, n) = 0;
          TYPE_FIELD_BITSIZE (type, n) = 0;
+         TYPE_FIELD_STATIC_KIND (type, n) = 0;
        }
     }
   /* Mark it as having been processed */
@@ -3520,6 +3488,7 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp,
          TYPE_FIELD_TYPE (type, n) = SYMBOL_TYPE (xsym);
          TYPE_FIELD_ARTIFICIAL (type, n) = 0;
          TYPE_FIELD_BITSIZE (type, n) = 0;
+         TYPE_FIELD_STATIC_KIND (type, n) = 0;
        }
     }
 
@@ -3704,6 +3673,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
          list = new;
 
          FIELD_BITSIZE (list->field) = 0;
+         FIELD_STATIC_KIND (list->field) = 0;
 
          /* The "classname" field is actually a DNTT pointer to the base class */
          baseclass = hpread_type_lookup (parentp->dinheritance.classname,
@@ -4101,6 +4071,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
              list->field.name = VT (objfile) + fn_fieldp->dsvar.name;
              FIELD_BITPOS (list->field) = 0;   /* FIXME is this always true? */
              FIELD_BITSIZE (list->field) = 0;  /* use length from type */
+             FIELD_STATIC_KIND (list->field) = 0;
              memtype = hpread_type_lookup (fn_fieldp->dsvar.type, objfile);
              list->field.type = memtype;
              list->attributes = 0;
@@ -4120,6 +4091,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
              list->field.name = VT (objfile) + fn_fieldp->ddvar.name;
              FIELD_BITPOS (list->field) = 0;   /* FIXME is this always true? */
              FIELD_BITSIZE (list->field) = 0;  /* use length from type */
+             FIELD_STATIC_KIND (list->field) = 0;
              memtype = hpread_type_lookup (fn_fieldp->ddvar.type, objfile);
              list->field.type = memtype;
              list->attributes = 0;
@@ -4168,6 +4140,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
 
 
          /* A FIELD by itself (without a GENFIELD) can also be a static member */
+         FIELD_STATIC_KIND (list->field) = 0;
          if (fieldp->dfield.staticmem)
            {
              FIELD_BITPOS (list->field) = -1;
@@ -4766,7 +4739,7 @@ hpread_type_lookup (dnttpointer hp_type, struct objfile *objfile)
          dn_bufp = hpread_get_lntt (dn_bufp->dtype.type.dnttp.index, objfile);
        else
          {
-           complain (&hpread_type_lookup_complaint);
+           complaint (&symfile_complaints, "error in hpread_type_lookup().");
            return NULL;
          }
 
@@ -5260,7 +5233,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
 
       /* Stack must be empty now.  */
       if (context_stack_depth != 0)
-       complain (&lbrac_unmatched_complaint, (char *) symnum);
+       lbrac_unmatched_complaint ((char *) symnum);
       new = push_context (0, valu);
 
       /* Built a type for the function. This includes processing
@@ -5378,7 +5351,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
       CURRENT_FUNCTION_VALUE (objfile) = valu;
       /* Stack must be empty now.  */
       if (context_stack_depth != 0)
-       complain (&lbrac_unmatched_complaint, (char *) symnum);
+       lbrac_unmatched_complaint ((char *) symnum);
       new = push_context (0, valu);
 
       /* Built a type for the function. This includes processing
@@ -5606,7 +5579,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
              new = pop_context ();
              desc = dn_bufp->dend.beginscope.dnttp.index;
              if (desc != new->depth)
-               complain (&lbrac_mismatch_complaint, (char *) symnum);
+               lbrac_mismatch_complaint ((char *) symnum);
 
              /* Make a block for the local symbols within.  */
              finish_block (new->name, &local_symbols, new->old_blocks,
@@ -5624,7 +5597,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
 
        case DNTT_TYPE_COMMON:
          /* End a FORTRAN common block. We don't currently handle these */
-         complain (&hpread_unhandled_end_common_complaint);
+         complaint (&symfile_complaints,
+                    "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_COMMON/DNTT_TYPE_END.\n");
          break;
 
        case DNTT_TYPE_CLASS_SCOPE:
@@ -5641,7 +5615,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
          new = pop_context ();
          desc = dn_bufp->dend.beginscope.dnttp.index;
          if (desc != new->depth)
-           complain (&lbrac_mismatch_complaint, (char *) symnum);
+           lbrac_mismatch_complaint ((char *) symnum);
          /* Make a block for the local symbols within.  */
          finish_block (new->name, &local_symbols, new->old_blocks,
                        new->start_addr, valu, objfile);
@@ -5651,7 +5625,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
          break;
 
        default:
-         complain (&hpread_unexpected_end_complaint);
+         complaint (&symfile_complaints,
+                    "internal error in hp-symtab-read.c: Unexpected DNTT_TYPE_END kind.");
          break;
        }
       break;
@@ -5742,7 +5717,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
        {
          /* Thread-local variable.
           */
-         SYMBOL_CLASS (sym) = LOC_THREAD_LOCAL_STATIC;
+         SYMBOL_CLASS (sym) = LOC_HP_THREAD_LOCAL_STATIC;
          SYMBOL_BASEREG (sym) = CR27_REGNUM;
 
          if (objfile->flags & OBJF_SHARED)
@@ -5873,7 +5848,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
          dn_bufp = hpread_get_lntt (dn_bufp->dtag.type.dnttp.index, objfile);
        else
          {
-           complain (&hpread_tagdef_complaint);
+           complaint (&symfile_complaints, "error processing class tagdef");
            return;
          }
        if (dn_bufp->dblock.kind == DNTT_TYPE_CLASS ||
@@ -5981,7 +5956,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
 
     case DNTT_TYPE_COMMON:
       /* FORTRAN common. Not yet handled. */
-      complain (&hpread_unhandled_common_complaint);
+      complaint (&symfile_complaints,
+                "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_COMMON.");
       break;
 
       /* DNTT_TYPE_COBSTRUCT is not handled by GDB.  */
@@ -5993,7 +5969,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name,
       /* Not sure what this is - part of FORTRAN support maybe? 
        * Anyway, not yet handled.
        */
-      complain (&hpread_unhandled_blockdata_complaint);
+      complaint (&symfile_complaints,
+                "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_BLOCKDATA.");
       break;
 
     case DNTT_TYPE_CLASS_SCOPE:
This page took 0.026661 seconds and 4 git commands to generate.