* gdb.c++/psmang.exp: Doc fix.
[deliverable/binutils-gdb.git] / gdb / coffread.c
index d794a7d382a567434321511987e2d48c6771ea6b..573306d6e0a09cb16f078f9a39ebaea289ba880b 100644 (file)
@@ -122,41 +122,6 @@ static int pe_file;
 
 static struct symbol *opaque_type_chain[HASHSIZE];
 
-/* Complaints about various problems in the file being read  */
-
-struct complaint ef_complaint =
-{"Unmatched .ef symbol(s) ignored starting at symnum %d", 0, 0};
-
-struct complaint ef_stack_complaint =
-{"`.ef' symbol without matching `.bf' symbol ignored starting at symnum %d", 0, 0};
-
-struct complaint eb_stack_complaint =
-{"`.eb' symbol without matching `.bb' symbol ignored starting at symnum %d", 0, 0};
-
-struct complaint bf_no_aux_complaint =
-{"`.bf' symbol %d has no aux entry", 0, 0};
-
-struct complaint ef_no_aux_complaint =
-{"`.ef' symbol %d has no aux entry", 0, 0};
-
-struct complaint lineno_complaint =
-{"Line number pointer %d lower than start of line numbers", 0, 0};
-
-struct complaint unexpected_type_complaint =
-{"Unexpected type for symbol %s", 0, 0};
-
-struct complaint bad_sclass_complaint =
-{"Bad n_sclass for symbol %s", 0, 0};
-
-struct complaint misordered_blocks_complaint =
-{"Blocks out of order at address %x", 0, 0};
-
-struct complaint tagndx_bad_complaint =
-{"Symbol table entry for %s has bad tagndx value", 0, 0};
-
-struct complaint eb_complaint =
-{"Mismatched .eb symbol ignored starting at symnum %d", 0, 0};
-
 /* Simplified internal version of coff symbol table information */
 
 struct coff_symbol
@@ -821,7 +786,8 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
        case C_LINE:
        case C_ALIAS:
        case C_HIDDEN:
-         complain (&bad_sclass_complaint, cs->c_name);
+         complaint (&symfile_complaints, "Bad n_sclass for symbol %s",
+                    cs->c_name);
          break;
 
        case C_FILE:
@@ -987,7 +953,8 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
              /* main_aux.x_sym.x_misc.x_lnsz.x_lnno
                 contains line number of '{' } */
              if (cs->c_naux != 1)
-               complain (&bf_no_aux_complaint, cs->c_symnum);
+               complaint (&symfile_complaints,
+                          "`.bf' symbol %d has no aux entry", cs->c_symnum);
              fcn_first_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
              fcn_first_line_addr = cs->c_value;
 
@@ -1011,7 +978,9 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
 
              if (context_stack_depth <= 0)
                {               /* We attempted to pop an empty context stack */
-                 complain (&ef_stack_complaint, cs->c_symnum);
+                 complaint (&symfile_complaints,
+                            "`.ef' symbol without matching `.bf' symbol ignored starting at symnum %d",
+                            cs->c_symnum);
                  within_function = 0;
                  break;
                }
@@ -1020,13 +989,16 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
              /* Stack must be empty now.  */
              if (context_stack_depth > 0 || new == NULL)
                {
-                 complain (&ef_complaint, cs->c_symnum);
+                 complaint (&symfile_complaints,
+                            "Unmatched .ef symbol(s) ignored starting at symnum %d",
+                            cs->c_symnum);
                  within_function = 0;
                  break;
                }
              if (cs->c_naux != 1)
                {
-                 complain (&ef_no_aux_complaint, cs->c_symnum);
+                 complaint (&symfile_complaints,
+                            "`.ef' symbol %d has no aux entry", cs->c_symnum);
                  fcn_last_line = 0x7FFFFFFF;
                }
              else
@@ -1081,14 +1053,18 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
            {
              if (context_stack_depth <= 0)
                {               /* We attempted to pop an empty context stack */
-                 complain (&eb_stack_complaint, cs->c_symnum);
+                 complaint (&symfile_complaints,
+                            "`.eb' symbol without matching `.bb' symbol ignored starting at symnum %d",
+                            cs->c_symnum);
                  break;
                }
 
              new = pop_context ();
              if (depth-- != new->depth)
                {
-                 complain (&eb_complaint, symnum);
+                 complaint (&symfile_complaints,
+                            "Mismatched .eb symbol ignored starting at symnum %d",
+                            symnum);
                  break;
                }
              if (local_symbols && context_stack_depth > 0)
@@ -1367,7 +1343,9 @@ enter_linenos (long file_offset, register int first_line,
     return;
   if (file_offset < linetab_offset)
     {
-      complain (&lineno_complaint, file_offset);
+      complaint (&symfile_complaints,
+                "Line number pointer %ld lower than start of line numbers",
+                file_offset);
       if (file_offset > linetab_size)  /* Too big to be an offset? */
        return;
       file_offset += linetab_offset;   /* Try reading at that linetab offset */
@@ -1772,7 +1750,9 @@ decode_type (register struct coff_symbol *cs, unsigned int c_type,
        }
       else
        {
-         complain (&tagndx_bad_complaint, cs->c_name);
+         complaint (&symfile_complaints,
+                    "Symbol table entry for %s has bad tagndx value",
+                    cs->c_name);
          /* And fall through to decode_base_type... */
        }
     }
@@ -1938,7 +1918,7 @@ decode_base_type (register struct coff_symbol *cs, unsigned int c_type,
       else
        return lookup_fundamental_type (current_objfile, FT_UNSIGNED_LONG);
     }
-  complain (&unexpected_type_complaint, cs->c_name);
+  complaint (&symfile_complaints, "Unexpected type for symbol %s", cs->c_name);
   return lookup_fundamental_type (current_objfile, FT_VOID);
 }
 \f
@@ -1997,6 +1977,7 @@ coff_read_struct_type (int index, int length, int lastsym)
          FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux);
          FIELD_BITPOS (list->field) = 8 * ms->c_value;
          FIELD_BITSIZE (list->field) = 0;
+         FIELD_STATIC_KIND (list->field) = 0;
          nfields++;
          break;
 
@@ -2015,6 +1996,7 @@ coff_read_struct_type (int index, int length, int lastsym)
          FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux);
          FIELD_BITPOS (list->field) = ms->c_value;
          FIELD_BITSIZE (list->field) = sub_aux.x_sym.x_misc.x_lnsz.x_size;
+         FIELD_STATIC_KIND (list->field) = 0;
          nfields++;
          break;
 
@@ -2135,6 +2117,7 @@ coff_read_enum_type (int index, int length, int lastsym)
          if (SYMBOL_VALUE (xsym) < 0)
            unsigned_enum = 0;
          TYPE_FIELD_BITSIZE (type, n) = 0;
+         TYPE_FIELD_STATIC_KIND (type, n) = 0;
        }
       if (syms == osyms)
        break;
This page took 0.026949 seconds and 4 git commands to generate.