+2002-12-16 Kevin Buettner <kevinb@redhat.com>
+
+ * buildsym.c (block_end_complaint, anon_block_end_complaint)
+ (innerblock_complaint, innerblock_anon_complaint)
+ (blockvector_complaint): Delete deprecated complaint structs.
+ (finish_block, make_blockvector, end_symtab): Replace calls
+ to complain() with calls to complaint().
+ * coffread.c (ef_complaint, ef_stack_complaint, eb_stack_complaint)
+ (bf_no_aux_complaint, ef_no_aux_complaint, lineno_complaint)
+ (unexpected_type_complaint, bad_sclass_complaint)
+ (misordered_blocks_complaint, tagndx_bad_complaint, eb_complaint):
+ Delete deprecated complaint structs.
+ (coff_symtab_read, enter_linenos, decode_type, decode_base_type):
+ Replace calls to complain() with calls to complaint().
+ * dbxread.c (lbrac_complaint, string_table_offset_complaint)
+ (unknown_symtype_complaint, unknown_symchar_complaint)
+ (lbrac_rbrac_complaint, lbrac_unmatched_complaint)
+ (lbrac_mismatch_complaint, repeated_header_complaint)
+ (unclaimed_bincl_complaint, discarding_local_symbols_complaint):
+ Delete deprecated complaint structs.
+ (unknown_symtype_complaint, lbrac_mismatch_complaint)
+ (repeated_header_complaint)
+ (function_outside_compiliation_unit_complaint): New functions.
+ (add_old_header_file, find_corresponding_bincl_psymtab)
+ (set_namestring, find_stab_function_addr, read_dbx_symtab)
+ (process_one_symbol): Replace calls to complain() with, possibly
+ indirect, calls to complaint().
+ * dwarfread.c (no_bfd_get_N, malformed_die, bad_die_ref)
+ (unknown_attribute_form, unknown_attribute_length)
+ (unexpected_fund_type, unknown_type_modifier, volatile_ignored)
+ (const_ignored, botched_modified_type, op_deref2, op_deref4)
+ (basereg_not_handled, dup_user_type_allocation)
+ (dup_user_type_definition, missing_tag, bad_array_element_type)
+ (subscript_data_items, unhandled_array_subscript_format)
+ (unknown_array_subscript_format, not_row_major)
+ (missing_at_name): Delete deprecated complaint structs.
+ (bad_die_ref_complaint, unknown_attribute_form_complaint)
+ (dup_user_type_definition_complaint)
+ (bad_array_element_type_complaint): New functions.
+ (lookup_utype, alloc_utype, struct_type, decode_array_element_type)
+ (decode_subscript_data_item, dwarf_read_array_type)
+ (read_tag_string_type, read_subroutine_type, read_func_scope)
+ (locval, scan_partial_symbols, decode_modified_type)
+ (decode_func_type, basicdieinfo, completeddieinfo, target_to_host)
+ (attribute_size): Replace calls to complain() with, possibly
+ indirect, calls to complaint().
+ * elfread.c (section_info_complaint, section_info_dup_complaint)
+ (stab_info_mismatch_complaint, stab_info_questionable_complaint):
+ Delete deprecated complaint structs.
+ (elf_symtab_read, elfstab_offset_sections): Replace calls to
+ complain() with calls to complaint().
+ * gdbtypes.c (stub_noname_complaint): Delete deprecated complaint
+ struct.
+ (stub_noname_complaint): New function.
+ (check_typedef, add_mangled_type): Replace calls to complain()
+ with calls to complaint().
+ * hpread.c (string_table_offset_complaint, lbrac_unmatched_complaint)
+ (lbrac_mismatch_complaint, hpread_unhandled_end_common_complaint)
+ (hpread_unhandled_type_complaint, hpread_struct_complaint)
+ (hpread_array_complaint, hpread_type_lookup_complaint)
+ (hpread_unexpected_end_complaint, hpread_tagdef_complaint)
+ (hpread_unhandled_common_complaint)
+ (hpread_unhandled_blockdata_complaint): Delete deprecated complaint
+ struct definitions and declarations.
+ (lbrac_unmatched_complaint, lbrac_mismatch_complaint): New functions.
+ (SET_NAMESTRING, hpread_type_lookup, hpread_process_one_debug_symbol):
+ Replace calls to complain() with, possibly indirect, calls to
+ complaint().
+ * macrotab.c (macro_include, check_for_redefinition, macro_undef):
+ Likewise.
+ * mdebugread.c (bad_file_number_complaint, index_complaint)
+ (aux_index_complaint, block_index_complaint)
+ (unknown_ext_complaint, unknown_sym_complaint)
+ (unknown_st_complaint, block_overflow_complaint)
+ (basic_type_complaint, unknown_type_qual_complaint)
+ (array_index_type_complaint, bad_tag_guess_complaint)
+ (block_member_complaint, stEnd_complaint)
+ (unknown_mdebug_symtype_complaint, stab_unknown_complaint)
+ (pdr_for_nonsymbol_complaint, pdr_static_symbol_complaint)
+ (bad_setjmp_pdr_complaint, bad_fbitfield_complaint)
+ (bad_continued_complaint, bad_rfd_entry_complaint)
+ (unexpected_type_code_complaint, unable_to_cross_ref_complaint)
+ (bad_indirect_xref_complaint, illegal_forward_tq0_complaint)
+ (illegal_forward_bt_complaint, bad_linetable_guess_complaint)
+ (bad_ext_ifd_complaint, bad_ext_iss_complaint): Delete deprecated
+ complaint structs.
+ (index_complaint, unknown_ext_complaint, basic_type_complaint)
+ (bad_tag_guess_complaint, bad_rfd_entry_complaint)
+ (unexpected_type_code_complaint)
+ (function_outside_compilation_unit_complaint): New functions.
+ (parse_symbol, parse_type, upgrade_type, parse_procedure)
+ (parse_partial_symbols, psymtab_to_symtab_1, cross_ref, add_symbol):
+ Replace calls to complain() with, possibly indirect calls to
+ complaint().
+ * objc-lang.c (noclass_lookup_complaint, nosel_lookup_complaint):
+ Delete deprecated complaint structs.
+ (lookup__objc_class, lookup_child_selector): Replace complain()
+ with complaint().
+ * remote-vx.c (cant_contact_target): Delete deprecated complaint
+ struct.
+ (vx_lookup_symbol): Replace complain() with complaint().
+ * stabsread.c (invalid_cpp_abbrev_complaint)
+ (invalid_cpp_type_complaint, member_fn_complaint)
+ (const_vol_complaint, error_type_complaint)
+ (invalid_member_complaint, range_type_base_complaint)
+ (reg_value_complaint, vtbl_notfound_complaint)
+ (unrecognized_cplus_name_complaint, rs6000_builtin_complaint)
+ (unresolved_sym_chain_complaint, stabs_general_complaint)
+ (lrs_general_complaint, multiply_defined_struct): Delete
+ deprecated complaint structs.
+ (invalid_cpp_abbrev_complaint, ref_value_complaint)
+ (stabs_general_complaint, lrs_general_complaint)
+ (msg_unknown_complaint): New functions.
+ (dbx_lookup_type, read_cfront_baseclasses)
+ (read_cfront_member_functions, resolve_symbol_reference)
+ (define_symbol, resolve_live_range, add_live_range, read_type)
+ (rs6000_builtin_type, read_member_functions, read_cpp_abbrev)
+ (read_one_struct_field, read_baseclasses, read_tilde_fields)
+ (read_cfront_static_fields, attach_fields_to_type)
+ (complain_about_struct_wipeout, read_range_type)
+ (common_block_start, common_block_end, cleanup_undefined_types)
+ (scan_file_globals): Replace complain() with complaint().
+ * stabsread.h (unknown_symtype_complaint, unknown_symchar_complaint):
+ Delete deprecated complaint struct declarations.
+ * xcoffread.c (storclass_complaint, bf_notfound_complaint)
+ (ef_complaint, eb_complaint): Delete deprecated complaint structs.
+ (bf_not_found_complaint, ef_complaint, eb_complaint)
+ (function_outside_compilation_unit_complaint): New functions.
+ (record_include_begin, record_include_end, enter_line_range)
+ (xcoff_next_symbol_text, read_xcoff_symtab, process_xcoff_symbol)
+ (read_symbol, read_symbol_lineno, scan_xcoff_symtab) Replace
+ complain() with complaint().
+
2002-12-16 Andrew Cagney <ac131313@redhat.com>
* config/arc/arc.mt, config/arc/tm-arc.h: Delete.
#define INITIAL_LINE_VECTOR_LENGTH 1000
\f
-/* Complaints about the symbols we have encountered. */
-
-struct deprecated_complaint block_end_complaint =
-{"block end address less than block start address in %s (patched it)", 0, 0};
-
-struct deprecated_complaint anon_block_end_complaint =
-{"block end address 0x%lx less than block start address 0x%lx (patched it)", 0, 0};
-
-struct deprecated_complaint innerblock_complaint =
-{"inner block not inside outer block in %s", 0, 0};
-
-struct deprecated_complaint innerblock_anon_complaint =
-{"inner block (0x%lx-0x%lx) not inside outer block (0x%lx-0x%lx)", 0, 0};
-
-struct deprecated_complaint blockvector_complaint =
-{"block at %s out of order", 0, 0};
-\f
/* maintain the lists of symbols and blocks */
/* Add a pending list to free_pendings. */
{
if (symbol)
{
- complain (&block_end_complaint, SYMBOL_SOURCE_NAME (symbol));
+ complaint (&symfile_complaints,
+ "block end address less than block start address in %s (patched it)",
+ SYMBOL_SOURCE_NAME (symbol));
}
else
{
- complain (&anon_block_end_complaint, BLOCK_END (block), BLOCK_START (block));
+ complaint (&symfile_complaints,
+ "block end address 0x%s less than block start address 0x%s (patched it)",
+ paddr_nz (BLOCK_END (block)), paddr_nz (BLOCK_START (block)));
}
/* Better than nothing */
BLOCK_END (block) = BLOCK_START (block);
{
if (symbol)
{
- complain (&innerblock_complaint,
- SYMBOL_SOURCE_NAME (symbol));
+ complaint (&symfile_complaints,
+ "inner block not inside outer block in %s",
+ SYMBOL_SOURCE_NAME (symbol));
}
else
{
- complain (&innerblock_anon_complaint, BLOCK_START (pblock->block),
- BLOCK_END (pblock->block), BLOCK_START (block),
- BLOCK_END (block));
+ complaint (&symfile_complaints,
+ "inner block (0x%s-0x%s) not inside outer block (0x%s-0x%s)",
+ paddr_nz (BLOCK_START (pblock->block)),
+ paddr_nz (BLOCK_END (pblock->block)),
+ paddr_nz (BLOCK_START (block)),
+ paddr_nz (BLOCK_END (block)));
}
if (BLOCK_START (pblock->block) < BLOCK_START (block))
BLOCK_START (pblock->block) = BLOCK_START (block);
CORE_ADDR start
= BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i));
- complain (&blockvector_complaint,
- local_hex_string ((LONGEST) start));
+ complaint (&symfile_complaints, "block at %s out of order",
+ local_hex_string ((LONGEST) start));
}
}
}
same. FIXME: Find out why it is happening. This is not
believed to happen in most cases (even for coffread.c);
it used to be an abort(). */
- static struct deprecated_complaint msg =
- {"Context stack not empty in end_symtab", 0, 0};
- complain (&msg);
+ complaint (&symfile_complaints,
+ "Context stack not empty in end_symtab");
context_stack_depth = 0;
}
}
static struct symbol *opaque_type_chain[HASHSIZE];
-/* Complaints about various problems in the file being read */
-
-struct deprecated_complaint ef_complaint =
-{"Unmatched .ef symbol(s) ignored starting at symnum %d", 0, 0};
-
-struct deprecated_complaint ef_stack_complaint =
-{"`.ef' symbol without matching `.bf' symbol ignored starting at symnum %d", 0, 0};
-
-struct deprecated_complaint eb_stack_complaint =
-{"`.eb' symbol without matching `.bb' symbol ignored starting at symnum %d", 0, 0};
-
-struct deprecated_complaint bf_no_aux_complaint =
-{"`.bf' symbol %d has no aux entry", 0, 0};
-
-struct deprecated_complaint ef_no_aux_complaint =
-{"`.ef' symbol %d has no aux entry", 0, 0};
-
-struct deprecated_complaint lineno_complaint =
-{"Line number pointer %d lower than start of line numbers", 0, 0};
-
-struct deprecated_complaint unexpected_type_complaint =
-{"Unexpected type for symbol %s", 0, 0};
-
-struct deprecated_complaint bad_sclass_complaint =
-{"Bad n_sclass for symbol %s", 0, 0};
-
-struct deprecated_complaint misordered_blocks_complaint =
-{"Blocks out of order at address %x", 0, 0};
-
-struct deprecated_complaint tagndx_bad_complaint =
-{"Symbol table entry for %s has bad tagndx value", 0, 0};
-
-struct deprecated_complaint eb_complaint =
-{"Mismatched .eb symbol ignored starting at symnum %d", 0, 0};
-
/* Simplified internal version of coff symbol table information */
struct coff_symbol
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:
/* 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;
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;
}
/* 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
{
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)
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 */
}
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... */
}
}
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
/* Complaints about the symbols we have encountered. */
-struct deprecated_complaint lbrac_complaint =
-{"bad block start address patched", 0, 0};
-
-struct deprecated_complaint string_table_offset_complaint =
-{"bad string table offset in symbol %d", 0, 0};
-
-struct deprecated_complaint unknown_symtype_complaint =
-{"unknown symbol type %s", 0, 0};
-
-struct deprecated_complaint unknown_symchar_complaint =
-{"unknown symbol descriptor `%c'", 0, 0};
-
-struct deprecated_complaint lbrac_rbrac_complaint =
-{"block start larger than block end", 0, 0};
-
-struct deprecated_complaint lbrac_unmatched_complaint =
-{"unmatched N_LBRAC before symtab pos %d", 0, 0};
-
-struct deprecated_complaint lbrac_mismatch_complaint =
-{"N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d", 0, 0};
+static void
+unknown_symtype_complaint (const char *arg1)
+{
+ complaint (&symfile_complaints, "unknown symbol type %s", arg1);
+}
-struct deprecated_complaint repeated_header_complaint =
-{"\"repeated\" header file %s not previously seen, at symtab pos %d", 0, 0};
+static void
+lbrac_mismatch_complaint (int arg1)
+{
+ complaint (&symfile_complaints,
+ "N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d", arg1);
+}
-struct deprecated_complaint unclaimed_bincl_complaint =
-{"N_BINCL %s not in entries for any file, at symtab pos %d", 0, 0};
+static void
+repeated_header_complaint (const char *arg1, int arg2)
+{
+ complaint (&symfile_complaints,
+ "\"repeated\" header file %s not previously seen, at symtab pos %d",
+ arg1, arg2);
+}
-struct deprecated_complaint discarding_local_symbols_complaint =
-{"misplaced N_LBRAC entry; discarding local symbols which have no enclosing block", 0, 0};
-\f
/* find_text_range --- find start and end of loadable code sections
The find_text_range function finds the shortest address range that
add_this_object_header_file (i);
return;
}
- complain (&repeated_header_complaint, name, symnum);
+ repeated_header_complaint (name, symnum);
}
/* Add to this file a "new" header file: definitions for its types follow.
&& STREQ (name, bincl->name))
return bincl->pst;
- complain (&repeated_header_complaint, name, symnum);
+ repeated_header_complaint (name, symnum);
return (struct partial_symtab *) 0;
}
if (((unsigned) nlist.n_strx + file_string_table_offset) >=
DBX_STRINGTAB_SIZE (objfile))
{
- complain (&string_table_offset_complaint, symnum);
+ complaint (&symfile_complaints, "bad string table offset in symbol %d",
+ symnum);
namestring = "<bad string table offset>";
}
else
}
#endif /* SOFUN_ADDRESS_MAYBE_MISSING */
+static void
+function_outside_compilation_unit_complaint (const char *arg1)
+{
+ complaint (&symfile_complaints,
+ "function `%s' appears to be defined outside of all compilation units",
+ arg1);
+}
+
/* Setup partial_symtab's describing each source file for which
debugging information is available. */
switch (nlist.n_type)
{
- static struct deprecated_complaint function_outside_compilation_unit = {
- "function `%s' appears to be defined outside of all compilation units", 0, 0
- };
char *p;
/*
* Standard, external, non-debugger, symbols
{
/* FIXME: we should not get here without a PST to work on.
Attempt to recover. */
- complain (&unclaimed_bincl_complaint, namestring, symnum);
+ complaint (&symfile_complaints,
+ "N_BINCL %s not in entries for any file, at symtab pos %d",
+ namestring, symnum);
continue;
}
add_bincl_to_list (pst, namestring, nlist.n_value);
char *name = xmalloc (name_len + 1);
memcpy (name, namestring, name_len);
name[name_len] = '\0';
- complain (&function_outside_compilation_unit, name);
+ function_outside_compilation_unit_complaint (name);
xfree (name);
}
nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
char *name = xmalloc (name_len + 1);
memcpy (name, namestring, name_len);
name[name_len] = '\0';
- complain (&function_outside_compilation_unit, name);
+ function_outside_compilation_unit_complaint (name);
xfree (name);
}
nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
time searching to the end of every string looking for
a backslash. */
- complain (&unknown_symchar_complaint, p[1]);
+ complaint (&symfile_complaints, "unknown symbol descriptor `%c'",
+ p[1]);
/* Ignore it; perhaps it is an extension that we don't
know about. */
default:
/* If we haven't found it yet, ignore it. It's probably some
new type we don't know about yet. */
- complain (&unknown_symtype_complaint,
- local_hex_string (nlist.n_type));
+ unknown_symtype_complaint (local_hex_string (nlist.n_type));
continue;
}
}
if (context_stack_depth <= 0)
{
- complain (&lbrac_mismatch_complaint, symnum);
+ lbrac_mismatch_complaint (symnum);
break;
}
if (!SUN_FIXED_LBRAC_BUG && valu < last_pc_address)
{
/* Patch current LBRAC pc value to match last handy pc value */
- complain (&lbrac_complaint);
+ complaint (&symfile_complaints, "bad block start address patched");
valu = last_pc_address;
}
#endif
if (context_stack_depth <= 0)
{
- complain (&lbrac_mismatch_complaint, symnum);
+ lbrac_mismatch_complaint (symnum);
break;
}
new = pop_context ();
if (desc != new->depth)
- complain (&lbrac_mismatch_complaint, symnum);
+ lbrac_mismatch_complaint (symnum);
/* Some compilers put the variable decls inside of an
LBRAC/RBRAC block. This macro should be nonzero if this
symbols within an LBRAC/RBRAC block; this complaint
might also help sort out problems in which
VARIABLES_INSIDE_BLOCK is incorrectly defined. */
- complain (&discarding_local_symbols_complaint);
+ complaint (&symfile_complaints,
+ "misplaced N_LBRAC entry; discarding local symbols which have no enclosing block");
}
local_symbols = new->locals;
}
compilers? Is this ever harmful?). */
if (new->start_addr > valu)
{
- complain (&lbrac_rbrac_complaint);
+ complaint (&symfile_complaints,
+ "block start larger than block end");
new->start_addr = valu;
}
/* Make a block for the local symbols within. */
case N_NBBSS:
case N_NBSTS:
case N_NBLCS:
- complain (&unknown_symtype_complaint, local_hex_string (type));
+ unknown_symtype_complaint (local_hex_string (type));
/* FALLTHROUGH */
/* The following symbol types don't need the address field relocated,
if (context_stack_depth > 1)
{
- complain (&lbrac_unmatched_complaint, symnum);
+ complaint (&symfile_complaints,
+ "unmatched N_LBRAC before symtab pos %d", symnum);
break;
}
/* Complaints that can be issued during DWARF debug info reading. */
-struct deprecated_complaint no_bfd_get_N =
-{
- "DIE @ 0x%x \"%s\", no bfd support for %d byte data object", 0, 0
-};
-
-struct deprecated_complaint malformed_die =
-{
- "DIE @ 0x%x \"%s\", malformed DIE, bad length (%d bytes)", 0, 0
-};
-
-struct deprecated_complaint bad_die_ref =
-{
- "DIE @ 0x%x \"%s\", reference to DIE (0x%x) outside compilation unit", 0, 0
-};
-
-struct deprecated_complaint unknown_attribute_form =
-{
- "DIE @ 0x%x \"%s\", unknown attribute form (0x%x)", 0, 0
-};
-
-struct deprecated_complaint unknown_attribute_length =
-{
- "DIE @ 0x%x \"%s\", unknown attribute length, skipped remaining attributes", 0, 0
-};
-
-struct deprecated_complaint unexpected_fund_type =
-{
- "DIE @ 0x%x \"%s\", unexpected fundamental type 0x%x", 0, 0
-};
-
-struct deprecated_complaint unknown_type_modifier =
-{
- "DIE @ 0x%x \"%s\", unknown type modifier %u", 0, 0
-};
-
-struct deprecated_complaint volatile_ignored =
-{
- "DIE @ 0x%x \"%s\", type modifier 'volatile' ignored", 0, 0
-};
-
-struct deprecated_complaint const_ignored =
-{
- "DIE @ 0x%x \"%s\", type modifier 'const' ignored", 0, 0
-};
-
-struct deprecated_complaint botched_modified_type =
-{
- "DIE @ 0x%x \"%s\", botched modified type decoding (mtype 0x%x)", 0, 0
-};
-
-struct deprecated_complaint op_deref2 =
-{
- "DIE @ 0x%x \"%s\", OP_DEREF2 address 0x%x not handled", 0, 0
-};
-
-struct deprecated_complaint op_deref4 =
-{
- "DIE @ 0x%x \"%s\", OP_DEREF4 address 0x%x not handled", 0, 0
-};
-
-struct deprecated_complaint basereg_not_handled =
-{
- "DIE @ 0x%x \"%s\", BASEREG %d not handled", 0, 0
-};
-
-struct deprecated_complaint dup_user_type_allocation =
-{
- "DIE @ 0x%x \"%s\", internal error: duplicate user type allocation", 0, 0
-};
-
-struct deprecated_complaint dup_user_type_definition =
-{
- "DIE @ 0x%x \"%s\", internal error: duplicate user type definition", 0, 0
-};
-
-struct deprecated_complaint missing_tag =
-{
- "DIE @ 0x%x \"%s\", missing class, structure, or union tag", 0, 0
-};
-
-struct deprecated_complaint bad_array_element_type =
-{
- "DIE @ 0x%x \"%s\", bad array element type attribute 0x%x", 0, 0
-};
-
-struct deprecated_complaint subscript_data_items =
-{
- "DIE @ 0x%x \"%s\", can't decode subscript data items", 0, 0
-};
-
-struct deprecated_complaint unhandled_array_subscript_format =
+static void
+bad_die_ref_complaint (int arg1, const char *arg2, int arg3)
{
- "DIE @ 0x%x \"%s\", array subscript format 0x%x not handled yet", 0, 0
-};
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", reference to DIE (0x%x) outside compilation unit",
+ arg1, arg2, arg3);
+}
-struct deprecated_complaint unknown_array_subscript_format =
+static void
+unknown_attribute_form_complaint (int arg1, const char *arg2, int arg3)
{
- "DIE @ 0x%x \"%s\", unknown array subscript format %x", 0, 0
-};
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", unknown attribute form (0x%x)", arg1, arg2,
+ arg3);
+}
-struct deprecated_complaint not_row_major =
+static void
+dup_user_type_definition_complaint (int arg1, const char *arg2)
{
- "DIE @ 0x%x \"%s\", array not row major; not handled correctly", 0, 0
-};
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", internal error: duplicate user type definition",
+ arg1, arg2);
+}
-struct deprecated_complaint missing_at_name =
+static void
+bad_array_element_type_complaint (int arg1, const char *arg2, int arg3)
{
- "DIE @ 0x%x, AT_name tag missing", 0, 0
-};
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", bad array element type attribute 0x%x", arg1,
+ arg2, arg3);
+}
typedef unsigned int DIE_REF; /* Reference to a DIE */
utypeidx = (die_ref - dbroff) / 4;
if ((utypeidx < 0) || (utypeidx >= numutypes))
{
- complain (&bad_die_ref, DIE_ID, DIE_NAME);
+ bad_die_ref_complaint (DIE_ID, DIE_NAME, die_ref);
}
else
{
if ((utypeidx < 0) || (utypeidx >= numutypes))
{
utypep = dwarf_fundamental_type (current_objfile, FT_INTEGER);
- complain (&bad_die_ref, DIE_ID, DIE_NAME);
+ bad_die_ref_complaint (DIE_ID, DIE_NAME, die_ref);
}
else if (*typep != NULL)
{
utypep = *typep;
- complain (&dup_user_type_allocation, DIE_ID, DIE_NAME);
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", internal error: duplicate user type allocation",
+ DIE_ID, DIE_NAME);
}
else
{
default:
/* Should never happen */
TYPE_CODE (type) = TYPE_CODE_UNDEF;
- complain (&missing_tag, DIE_ID, DIE_NAME);
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", missing class, structure, or union tag",
+ DIE_ID, DIE_NAME);
break;
}
/* Some compilers try to be helpful by inventing "fake" names for
scan += SIZEOF_ATTRIBUTE;
if ((nbytes = attribute_size (attribute)) == -1)
{
- complain (&bad_array_element_type, DIE_ID, DIE_NAME, attribute);
+ bad_array_element_type_complaint (DIE_ID, DIE_NAME, attribute);
typep = dwarf_fundamental_type (current_objfile, FT_INTEGER);
}
else
typep = decode_mod_u_d_type (scan);
break;
default:
- complain (&bad_array_element_type, DIE_ID, DIE_NAME, attribute);
+ bad_array_element_type_complaint (DIE_ID, DIE_NAME, attribute);
typep = dwarf_fundamental_type (current_objfile, FT_INTEGER);
break;
}
if (nexttype == NULL)
{
/* Munged subscript data or other problem, fake it. */
- complain (&subscript_data_items, DIE_ID, DIE_NAME);
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", can't decode subscript data items",
+ DIE_ID, DIE_NAME);
nexttype = dwarf_fundamental_type (current_objfile, FT_INTEGER);
}
rangetype = create_range_type ((struct type *) NULL, indextype,
case FMT_UT_C_X:
case FMT_UT_X_C:
case FMT_UT_X_X:
- complain (&unhandled_array_subscript_format, DIE_ID, DIE_NAME, format);
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", array subscript format 0x%x not handled yet",
+ DIE_ID, DIE_NAME, format);
nexttype = dwarf_fundamental_type (current_objfile, FT_INTEGER);
rangetype = create_range_type ((struct type *) NULL, nexttype, 0, 0);
typep = create_array_type ((struct type *) NULL, nexttype, rangetype);
break;
default:
- complain (&unknown_array_subscript_format, DIE_ID, DIE_NAME, format);
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", unknown array subscript format %x", DIE_ID,
+ DIE_NAME, format);
nexttype = dwarf_fundamental_type (current_objfile, FT_INTEGER);
rangetype = create_range_type ((struct type *) NULL, nexttype, 0, 0);
typep = create_array_type ((struct type *) NULL, nexttype, rangetype);
if (dip->at_ordering != ORD_row_major)
{
/* FIXME: Can gdb even handle column major arrays? */
- complain (¬_row_major, DIE_ID, DIE_NAME);
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", array not row major; not handled correctly",
+ DIE_ID, DIE_NAME);
}
if ((sub = dip->at_subscr_data) != NULL)
{
{
/* Double ick! Not only is a type already in our slot, but
someone has decorated it. Complain and leave it alone. */
- complain (&dup_user_type_definition, DIE_ID, DIE_NAME);
+ dup_user_type_definition_complaint (DIE_ID, DIE_NAME);
}
}
}
is a blank one. If not, complain and leave it alone. */
if (TYPE_CODE (utype) != TYPE_CODE_UNDEF)
{
- complain (&dup_user_type_definition, DIE_ID, DIE_NAME);
+ dup_user_type_definition_complaint (DIE_ID, DIE_NAME);
return;
}
}
}
else
{
- complain (&dup_user_type_definition, DIE_ID, DIE_NAME);
+ dup_user_type_definition_complaint (DIE_ID, DIE_NAME);
}
}
FIXME: Add code to handle AT_abstract_origin tags properly. */
if (dip->at_name == NULL)
{
- complain (&missing_at_name, DIE_ID);
+ complaint (&symfile_complaints, "DIE @ 0x%x, AT_name tag missing",
+ DIE_ID);
return;
}
break;
case OP_DEREF2:
/* pop, deref and push 2 bytes (as a long) */
- complain (&op_deref2, DIE_ID, DIE_NAME, stack[stacki]);
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", OP_DEREF2 address 0x%lx not handled",
+ DIE_ID, DIE_NAME, stack[stacki]);
break;
case OP_DEREF4: /* pop, deref and push 4 bytes (as a long) */
- complain (&op_deref4, DIE_ID, DIE_NAME, stack[stacki]);
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", OP_DEREF4 address 0x%lx not handled",
+ DIE_ID, DIE_NAME, stack[stacki]);
break;
case OP_ADD: /* pop top 2 items, add, push result */
stack[stacki - 1] += stack[stacki];
temp = dbbase + di.at_sibling - dbroff;
if ((temp < thisdie) || (temp >= enddie))
{
- complain (&bad_die_ref, DIE_ID, DIE_NAME,
- di.at_sibling);
+ bad_die_ref_complaint (DIE_ID, DIE_NAME,
+ di.at_sibling);
}
else
{
}
break;
default:
- complain (&botched_modified_type, DIE_ID, DIE_NAME, mtype);
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", botched modified type decoding (mtype 0x%x)",
+ DIE_ID, DIE_NAME, mtype);
typep = dwarf_fundamental_type (current_objfile, FT_INTEGER);
break;
}
typep = lookup_reference_type (typep);
break;
case MOD_const:
- complain (&const_ignored, DIE_ID, DIE_NAME); /* FIXME */
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", type modifier 'const' ignored", DIE_ID,
+ DIE_NAME); /* FIXME */
break;
case MOD_volatile:
- complain (&volatile_ignored, DIE_ID, DIE_NAME); /* FIXME */
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", type modifier 'volatile' ignored",
+ DIE_ID, DIE_NAME); /* FIXME */
break;
default:
if (!(MOD_lo_user <= (unsigned char) modifier
&& (unsigned char) modifier <= MOD_hi_user))
{
- complain (&unknown_type_modifier, DIE_ID, DIE_NAME, modifier);
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", unknown type modifier %u", DIE_ID,
+ DIE_NAME, modifier);
}
break;
}
typep = dwarf_fundamental_type (current_objfile, FT_INTEGER);
if (!(FT_lo_user <= fundtype && fundtype <= FT_hi_user))
{
- complain (&unexpected_fund_type, DIE_ID, DIE_NAME, fundtype);
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", unexpected fundamental type 0x%x",
+ DIE_ID, DIE_NAME, fundtype);
}
}
if ((dip->die_length < SIZEOF_DIE_LENGTH) ||
((diep + dip->die_length) > (dbbase + dbsize)))
{
- complain (&malformed_die, DIE_ID, DIE_NAME, dip->die_length);
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", malformed DIE, bad length (%ld bytes)",
+ DIE_ID, DIE_NAME, dip->die_length);
dip->die_length = 0;
}
else if (dip->die_length < (SIZEOF_DIE_LENGTH + SIZEOF_DIE_TAG))
diep += SIZEOF_ATTRIBUTE;
if ((nbytes = attribute_size (attr)) == -1)
{
- complain (&unknown_attribute_length, DIE_ID, DIE_NAME);
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", unknown attribute length, skipped remaining attributes",
+ DIE_ID, DIE_NAME);
diep = end;
continue;
}
diep += strlen (diep) + 1;
break;
default:
- complain (&unknown_attribute_form, DIE_ID, DIE_NAME, form);
+ unknown_attribute_form_complaint (DIE_ID, DIE_NAME, form);
diep = end;
break;
}
rtnval = bfd_get_8 (objfile->obfd, (bfd_byte *) from);
break;
default:
- complain (&no_bfd_get_N, DIE_ID, DIE_NAME, nbytes);
+ complaint (&symfile_complaints,
+ "DIE @ 0x%x \"%s\", no bfd support for %d byte data object",
+ DIE_ID, DIE_NAME, nbytes);
rtnval = 0;
break;
}
nbytes = TARGET_FT_POINTER_SIZE (objfile);
break;
default:
- complain (&unknown_attribute_form, DIE_ID, DIE_NAME, form);
+ unknown_attribute_form_complaint (DIE_ID, DIE_NAME, form);
nbytes = -1;
break;
}
asection *mdebugsect; /* Section pointer for .mdebug section */
};
-/* Various things we might complain about... */
-
-struct deprecated_complaint section_info_complaint =
-{"elf/stab section information %s without a preceding file symbol", 0, 0};
-
-struct deprecated_complaint section_info_dup_complaint =
-{"duplicated elf/stab section information for %s", 0, 0};
-
-struct deprecated_complaint stab_info_mismatch_complaint =
-{"elf/stab section information missing for %s", 0, 0};
-
-struct deprecated_complaint stab_info_questionable_complaint =
-{"elf/stab section information questionable for %s", 0, 0};
-
static void free_elfinfo (void *);
/* We are called once per section from elf_symfile_read. We
sizeof (*sectinfo));
if (filesym == NULL)
{
- complain (§ion_info_complaint,
- sym->name);
+ complaint (&symfile_complaints,
+ "elf/stab section information %s without a preceding file symbol",
+ sym->name);
}
else
{
{
if (sectinfo->sections[index] != 0)
{
- complain (§ion_info_dup_complaint,
- sectinfo->filename);
+ complaint (&symfile_complaints,
+ "duplicated elf/stab section information for %s",
+ sectinfo->filename);
}
}
else
if (maybe == 0 && questionable != 0)
{
- complain (&stab_info_questionable_complaint, filename);
+ complaint (&symfile_complaints,
+ "elf/stab section information questionable for %s", filename);
maybe = questionable;
}
/* We were unable to find any offsets for this file. Complain. */
if (dbx->stab_section_info) /* If there *is* any info, */
- complain (&stab_info_mismatch_complaint, filename);
+ complaint (&symfile_complaints,
+ "elf/stab section information missing for %s", filename);
}
\f
/* Register that we are able to handle ELF object file formats. */
This used to be coded as a macro, but I don't think it is called
often enough to merit such treatment. */
-struct deprecated_complaint stub_noname_complaint =
-{"stub type has NULL name", 0, 0};
+static void
+stub_noname_complaint (void)
+{
+ complaint (&symfile_complaints, "stub type has NULL name");
+}
struct type *
check_typedef (struct type *type)
TYPE_TAG_NAME were separate). */
if (name == NULL)
{
- complain (&stub_noname_complaint);
+ stub_noname_complaint ();
return type;
}
sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0,
struct type *newtype;
if (name == NULL)
{
- complain (&stub_noname_complaint);
+ stub_noname_complaint ();
return type;
}
newtype = lookup_transparent_type (name);
struct symbol *sym;
if (name == NULL)
{
- complain (&stub_noname_complaint);
+ stub_noname_complaint ();
return type;
}
sym = lookup_symbol (name, 0, STRUCT_NAMESPACE, 0, (struct symtab **) NULL);
break;
default:
{
-
- static struct deprecated_complaint msg =
- {"Bad int type code length x%x\n", 0, 0};
-
- complain (&msg, tlen);
-
+ complaint (&symfile_complaints, "Bad int type code length x%x",
+ tlen);
}
}
break;
break;
default:
{
- static struct deprecated_complaint msg =
- {"Bad float type code length x%x\n", 0, 0};
- complain (&msg, tlen);
+ complaint (&symfile_complaints, "Bad float type code length x%x",
+ tlen);
}
}
break;
break;
case TYPE_CODE_TYPEDEF:
{
- static struct deprecated_complaint msg =
- {"Typedefs in overloaded functions not yet supported\n", 0, 0};
- complain (&msg);
+ complaint (&symfile_complaints,
+ "Typedefs in overloaded functions not yet supported");
}
/* followed by type bytes & name */
break;
case TYPE_CODE_ERROR:
default:
{
- static struct deprecated_complaint msg =
- {"Unknown type code x%x\n", 0, 0};
- complain (&msg, tcode);
+ complaint (&symfile_complaints, "Unknown type code x%x", tcode);
}
}
if (TYPE_TARGET_TYPE (t))
*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 \
#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 deprecated_complaint string_table_offset_complaint;
-extern struct deprecated_complaint lbrac_unmatched_complaint;
-extern struct deprecated_complaint lbrac_mismatch_complaint;
-\f
-static struct deprecated_complaint hpread_unhandled_end_common_complaint =
-{
- "unhandled symbol in hp-symtab-read.c: DNTT_TYPE_COMMON/DNTT_TYPE_END.\n", 0, 0
-};
-
-static struct deprecated_complaint hpread_unhandled_type_complaint =
-{
- "hpread_type_translate: unhandled type code.", 0, 0
-};
-
-static struct deprecated_complaint hpread_struct_complaint =
-{
- "hpread_read_struct_type: expected SVAR type...", 0, 0
-};
-
-static struct deprecated_complaint hpread_array_complaint =
-{
- "error in hpread_array_type.", 0, 0
-};
-
-static struct deprecated_complaint hpread_type_lookup_complaint =
-{
- "error in hpread_type_lookup().", 0, 0
-};
-
-
-static struct deprecated_complaint hpread_unexpected_end_complaint =
-{
- "internal error in hp-symtab-read.c: Unexpected DNTT_TYPE_END kind.", 0, 0
-};
-
-static struct deprecated_complaint hpread_tagdef_complaint =
-{
- "error processing class tagdef", 0, 0
-};
-
-static struct deprecated_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 deprecated_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". */
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;
}
/* 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
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
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,
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:
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);
break;
default:
- complain (&hpread_unexpected_end_complaint);
+ complaint (&symfile_complaints,
+ "internal error in hp-symtab-read.c: Unexpected DNTT_TYPE_END kind.");
break;
}
break;
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 ||
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. */
/* 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:
should tolerate bad debug info. So:
First, squawk. */
- static struct deprecated_complaint bogus_inclusion_line = {
- "both `%s' and `%s' allegedly #included at %s:%d", 0, 0
- };
-
- complain (&bogus_inclusion_line,
- included, (*link)->filename, source->filename, line);
+ complaint (&symfile_complaints,
+ "both `%s' and `%s' allegedly #included at %s:%d", included,
+ (*link)->filename, source->filename, line);
/* Now, choose a new, unoccupied line number for this
#inclusion, after the alleged #inclusion line. */
if (! same)
{
- static struct deprecated_complaint macro_redefined = {
- "macro `%s' redefined at %s:%d; original definition at %s:%d",
- 0, 0
- };
- complain (¯o_redefined,
- name,
- source->filename, line,
- found_key->start_file->filename,
- found_key->start_line);
+ complaint (&symfile_complaints,
+ "macro `%s' redefined at %s:%d; original definition at %s:%d",
+ name, source->filename, line,
+ found_key->start_file->filename, found_key->start_line);
}
return found_key;
if (key->end_file)
{
- static struct deprecated_complaint double_undef = {
- "macro '%s' is #undefined twice, at %s:%d and %s:%d",
- 0, 0
- };
- complain (&double_undef, name, source->filename, line,
- key->end_file->filename, key->end_line);
+ complaint (&symfile_complaints,
+ "macro '%s' is #undefined twice, at %s:%d and %s:%d", name,
+ source->filename, line, key->end_file->filename,
+ key->end_line);
}
/* Whatever the case, wipe out the old ending point, and
has no macro definition in scope is ignored. So we should
ignore it too. */
#if 0
- static struct deprecated_complaint no_macro_to_undefine = {
- "no definition for macro `%s' in scope to #undef at %s:%d",
- 0, 0
- };
- complain (&no_macro_to_undefine, name, source->filename, line);
+ complaint (&symfile_complaints,
+ "no definition for macro `%s' in scope to #undef at %s:%d",
+ name, source->filename, line);
#endif
}
}
#define SC_IS_UNDEF(sc) ((sc) == scUndefined || (sc) == scSUndefined)
\f
/* Various complaints about symbol reading that don't abort the process */
+static void
+index_complaint (const char *arg1)
+{
+ complaint (&symfile_complaints, "bad aux index at symbol %s", arg1);
+}
-static struct deprecated_complaint bad_file_number_complaint =
-{"bad file number %d", 0, 0};
-
-static struct deprecated_complaint index_complaint =
-{"bad aux index at symbol %s", 0, 0};
-
-static struct deprecated_complaint aux_index_complaint =
-{"bad proc end in aux found from symbol %s", 0, 0};
-
-static struct deprecated_complaint block_index_complaint =
-{"bad aux index at block symbol %s", 0, 0};
-
-static struct deprecated_complaint unknown_ext_complaint =
-{"unknown external symbol %s", 0, 0};
-
-static struct deprecated_complaint unknown_sym_complaint =
-{"unknown local symbol %s", 0, 0};
-
-static struct deprecated_complaint unknown_st_complaint =
-{"with type %d", 0, 0};
-
-static struct deprecated_complaint block_overflow_complaint =
-{"block containing %s overfilled", 0, 0};
-
-static struct deprecated_complaint basic_type_complaint =
-{"cannot map ECOFF basic type 0x%x for %s", 0, 0};
-
-static struct deprecated_complaint unknown_type_qual_complaint =
-{"unknown type qualifier 0x%x", 0, 0};
-
-static struct deprecated_complaint array_index_type_complaint =
-{"illegal array index type for %s, assuming int", 0, 0};
-
-static struct deprecated_complaint bad_tag_guess_complaint =
-{"guessed tag type of %s incorrectly", 0, 0};
-
-static struct deprecated_complaint block_member_complaint =
-{"declaration block contains unhandled symbol type %d", 0, 0};
-
-static struct deprecated_complaint stEnd_complaint =
-{"stEnd with storage class %d not handled", 0, 0};
-
-static struct deprecated_complaint unknown_mdebug_symtype_complaint =
-{"unknown symbol type 0x%x", 0, 0};
-
-static struct deprecated_complaint stab_unknown_complaint =
-{"unknown stabs symbol %s", 0, 0};
-
-static struct deprecated_complaint pdr_for_nonsymbol_complaint =
-{"PDR for %s, but no symbol", 0, 0};
-
-static struct deprecated_complaint pdr_static_symbol_complaint =
-{"can't handle PDR for static proc at 0x%lx", 0, 0};
-
-static struct deprecated_complaint bad_setjmp_pdr_complaint =
-{"fixing bad setjmp PDR from libc", 0, 0};
-
-static struct deprecated_complaint bad_fbitfield_complaint =
-{"can't handle TIR fBitfield for %s", 0, 0};
-
-static struct deprecated_complaint bad_continued_complaint =
-{"illegal TIR continued for %s", 0, 0};
-
-static struct deprecated_complaint bad_rfd_entry_complaint =
-{"bad rfd entry for %s: file %d, index %d", 0, 0};
-
-static struct deprecated_complaint unexpected_type_code_complaint =
-{"unexpected type code for %s", 0, 0};
-
-static struct deprecated_complaint unable_to_cross_ref_complaint =
-{"unable to cross ref btTypedef for %s", 0, 0};
-
-static struct deprecated_complaint bad_indirect_xref_complaint =
-{"unable to cross ref btIndirect for %s", 0, 0};
-
-static struct deprecated_complaint illegal_forward_tq0_complaint =
-{"illegal tq0 in forward typedef for %s", 0, 0};
+static void
+unknown_ext_complaint (const char *arg1)
+{
+ complaint (&symfile_complaints, "unknown external symbol %s", arg1);
+}
-static struct deprecated_complaint illegal_forward_bt_complaint =
-{"illegal bt %d in forward typedef for %s", 0, 0};
+static void
+basic_type_complaint (int arg1, const char *arg2)
+{
+ complaint (&symfile_complaints, "cannot map ECOFF basic type 0x%x for %s",
+ arg1, arg2);
+}
-static struct deprecated_complaint bad_linetable_guess_complaint =
-{"guessed size of linetable for %s incorrectly", 0, 0};
+static void
+bad_tag_guess_complaint (const char *arg1)
+{
+ complaint (&symfile_complaints, "guessed tag type of %s incorrectly", arg1);
+}
-static struct deprecated_complaint bad_ext_ifd_complaint =
-{"bad ifd for external symbol: %d (max %d)", 0, 0};
+static void
+bad_rfd_entry_complaint (const char *arg1, int arg2, int arg3)
+{
+ complaint (&symfile_complaints, "bad rfd entry for %s: file %d, index %d",
+ arg1, arg2, arg3);
+}
-static struct deprecated_complaint bad_ext_iss_complaint =
-{"bad iss for external symbol: %ld (max %ld)", 0, 0};
+static void
+unexpected_type_code_complaint (const char *arg1)
+{
+ complaint (&symfile_complaints, "unexpected type code for %s", arg1);
+}
/* Macros and extra defs */
break;
default:
- complain (&block_member_complaint, tsym.st);
+ complaint (&symfile_complaints,
+ "declaration block contains unhandled symbol type %d",
+ tsym.st);
}
}
end_of_fields:;
;
}
else
- complain (&stEnd_complaint, sh->sc);
+ complaint (&symfile_complaints,
+ "stEnd with storage class %d not handled", sh->sc);
pop_parse_stack (); /* restore previous lexical context */
break;
case stConstant:
break; /* constant */
default:
- complain (&unknown_mdebug_symtype_complaint, sh->st);
+ complaint (&symfile_complaints, "unknown symbol type 0x%x", sh->st);
break;
}
/* Handle corrupt aux indices. */
if (aux_index >= (debug_info->fdr + fd)->caux)
{
- complain (&index_complaint, sym_name);
+ index_complaint (sym_name);
return mdebug_type_int;
}
ax += aux_index;
(*debug_swap->swap_tir_in) (bigend, &ax->a_ti, t);
if (t->bt >= (sizeof (map_bt) / sizeof (*map_bt)))
{
- complain (&basic_type_complaint, t->bt, sym_name);
+ basic_type_complaint (t->bt, sym_name);
return mdebug_type_int;
}
if (map_bt[t->bt])
type_code = TYPE_CODE_ERROR;
break;
default:
- complain (&basic_type_complaint, t->bt, sym_name);
+ basic_type_complaint (t->bt, sym_name);
return mdebug_type_int;
}
}
else if (t->bt == btEnum)
;
else
- complain (&bad_fbitfield_complaint, sym_name);
+ complaint (&symfile_complaints, "can't handle TIR fBitfield for %s",
+ sym_name);
}
else
*bs = width;
if (rf == -1)
{
- complain (&bad_indirect_xref_complaint, sym_name);
+ complaint (&symfile_complaints,
+ "unable to cross ref btIndirect for %s", sym_name);
return mdebug_type_int;
}
xref_fh = get_rfd (fd, rf);
&& TYPE_CODE (tp) != TYPE_CODE_UNION
&& TYPE_CODE (tp) != TYPE_CODE_ENUM)
{
- complain (&unexpected_type_code_complaint, sym_name);
+ unexpected_type_code_complaint (sym_name);
}
else
{
|| (TYPE_CODE (tp) != TYPE_CODE_ENUM
&& type_code == TYPE_CODE_ENUM))
{
- complain (&bad_tag_guess_complaint, sym_name);
+ bad_tag_guess_complaint (sym_name);
}
if (TYPE_CODE (tp) != type_code)
are corrupted. */
if (TYPE_CODE (tp) != TYPE_CODE_RANGE)
{
- complain (&unexpected_type_code_complaint, sym_name);
+ unexpected_type_code_complaint (sym_name);
}
else
{
exception is if we guessed wrong re struct/union/enum. */
if (TYPE_CODE (tp) != type_code)
{
- complain (&bad_tag_guess_complaint, sym_name);
+ bad_tag_guess_complaint (sym_name);
TYPE_CODE (tp) = type_code;
}
if (TYPE_NAME (tp) == NULL || !STREQ (TYPE_NAME (tp), name))
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
if (tp == (struct type *) NULL)
{
- complain (&unable_to_cross_ref_complaint, sym_name);
+ complaint (&symfile_complaints,
+ "unable to cross ref btTypedef for %s", sym_name);
tp = mdebug_type_int;
}
}
/* Complain for illegal continuations due to corrupt aux entries. */
if (t->continued)
- complain (&bad_continued_complaint, sym_name);
+ complaint (&symfile_complaints, "illegal TIR continued for %s", sym_name);
return tp;
}
else due to corrupt aux entries. */
if (TYPE_CODE (indx) != TYPE_CODE_INT)
{
- complain (&array_index_type_complaint, sym_name);
+ complaint (&symfile_complaints,
+ "illegal array index type for %s, assuming int", sym_name);
indx = mdebug_type_int;
}
return 0;
default:
- complain (&unknown_type_qual_complaint, tq);
+ complaint (&symfile_complaints, "unknown type qualifier 0x%x", tq);
return 0;
}
}
{
/* Static procedure at address pr->adr. Sigh. */
/* FIXME-32x64. assuming pr->adr fits in long. */
- complain (&pdr_static_symbol_complaint, (unsigned long) pr->adr);
+ complaint (&symfile_complaints,
+ "can't handle PDR for static proc at 0x%lx",
+ (unsigned long) pr->adr);
return;
}
else
}
else
{
- complain (&pdr_for_nonsymbol_complaint, sh_name);
+ complaint (&symfile_complaints, "PDR for %s, but no symbol", sh_name);
#if 1
return;
#else
to make backtrace through setjmp work. */
if (e->pdr.pcreg == 0 && STREQ (sh_name, "setjmp"))
{
- complain (&bad_setjmp_pdr_complaint, 0);
+ complaint (&symfile_complaints, "fixing bad setjmp PDR from libc");
e->pdr.pcreg = RA_REGNUM;
e->pdr.regmask = 0x80000000;
e->pdr.regoffset = -4;
with corrupt binaries. */
if (lt->nitems >= maxlines)
{
- complain (&bad_linetable_guess_complaint, fdr_name (fh));
+ complaint (&symfile_complaints,
+ "guessed size of linetable for %s incorrectly",
+ fdr_name (fh));
break;
}
k = add_line (lt, lineno, l, k);
}
}
\f
+static void
+function_outside_compilation_unit_complaint (const char *arg1)
+{
+ complaint (&symfile_complaints,
+ "function `%s' appears to be defined outside of all compilation units",
+ arg1);
+}
+
/* Master parsing procedure for first-pass reading of file symbols
into a partial_symtab. */
external symbols. */
if (ext_in->ifd < -1 || ext_in->ifd >= hdr->ifdMax)
{
- complain (&bad_ext_ifd_complaint, ext_in->ifd, hdr->ifdMax);
+ complaint (&symfile_complaints,
+ "bad ifd for external symbol: %d (max %ld)", ext_in->ifd,
+ hdr->ifdMax);
continue;
}
if (ext_in->asym.iss < 0 || ext_in->asym.iss >= hdr->issExtMax)
{
- complain (&bad_ext_iss_complaint, ext_in->asym.iss,
- hdr->issExtMax);
+ complaint (&symfile_complaints,
+ "bad iss for external symbol: %ld (max %ld)",
+ ext_in->asym.iss, hdr->issExtMax);
continue;
}
/* Fall through. */
default:
ms_type = mst_unknown;
- complain (&unknown_ext_complaint, name);
+ unknown_ext_complaint (name);
}
if (!ECOFF_IN_ELF (cur_bfd))
prim_record_minimal_symbol (name, svalue, ms_type, objfile);
switch (type_code)
{
- static struct deprecated_complaint function_outside_compilation_unit = {
- "function `%s' appears to be defined outside of all compilation units", 0, 0
- };
char *p;
/*
* Standard, external, non-debugger, symbols
char *name = xmalloc (name_len + 1);
memcpy (name, namestring, name_len);
name[name_len] = '\0';
- complain (&function_outside_compilation_unit, name);
+ function_outside_compilation_unit_complaint (name);
xfree (name);
}
sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
char *name = xmalloc (name_len + 1);
memcpy (name, namestring, name_len);
name[name_len] = '\0';
- complain (&function_outside_compilation_unit, name);
+ function_outside_compilation_unit_complaint (name);
xfree (name);
}
sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
time searching to the end of every string looking for
a backslash. */
- complain (&unknown_symchar_complaint, p[1]);
+ complaint (&symfile_complaints,
+ "unknown symbol descriptor `%c'", p[1]);
/* Ignore it; perhaps it is an extension that we don't
know about. */
default:
/* If we haven't found it yet, ignore it. It's probably some
new type we don't know about yet. */
- complain (&unknown_symtype_complaint,
- local_hex_string (type_code)); /*CUR_SYMBOL_TYPE*/
+ complaint (&symfile_complaints, "unknown symbol type %s",
+ local_hex_string (type_code)); /*CUR_SYMBOL_TYPE*/
continue;
}
if (stabstring
{
/* Should not happen, but does when cross-compiling
with the MIPS compiler. FIXME -- pull later. */
- complain (&index_complaint, name);
+ index_complaint (name);
new_sdx = cur_sdx + 1; /* Don't skip at all */
}
else
if (new_sdx <= cur_sdx)
{
/* This should not happen either... FIXME. */
- complain (&aux_index_complaint, name);
+ complaint (&symfile_complaints,
+ "bad proc end in aux found from symbol %s",
+ name);
new_sdx = cur_sdx + 1; /* Don't skip backward */
}
if (new_sdx <= cur_sdx)
{
/* This happens with the Ultrix kernel. */
- complain (&block_index_complaint, name);
+ complaint (&symfile_complaints,
+ "bad aux index at block symbol %s", name);
new_sdx = cur_sdx + 1; /* Don't skip backward */
}
cur_sdx = new_sdx;
default:
/* Both complaints are valid: one gives symbol name,
the other the offending symbol type. */
- complain (&unknown_sym_complaint, name);
- complain (&unknown_st_complaint, sh.st);
+ complaint (&symfile_complaints, "unknown local symbol %s",
+ name);
+ complaint (&symfile_complaints, "with type %d", sh.st);
cur_sdx++;
continue;
}
class = LOC_LABEL;
break;
default:
- complain (&unknown_ext_complaint,
- debug_info->ssext + psh->iss);
+ unknown_ext_complaint (debug_info->ssext + psh->iss);
/* Fall through, pretend it's global. */
case stGlobal:
/* Global common symbols are resolved by the runtime loader,
&rh);
if (rh < 0 || rh >= hdr->ifdMax)
{
- complain (&bad_file_number_complaint, rh);
+ complaint (&symfile_complaints, "bad file number %ld", rh);
continue;
}
/* These are generated by gcc-2.x, do not complain */
;
else
- complain (&stab_unknown_complaint, name);
+ complaint (&symfile_complaints, "unknown stabs symbol %s", name);
}
if (! last_symtab_ended)
{
/* File indirect entry is corrupt. */
*pname = "<illegal>";
- complain (&bad_rfd_entry_complaint,
- sym_name, xref_fd, rn->index);
+ bad_rfd_entry_complaint (sym_name, xref_fd, rn->index);
return result;
}
{
/* File indirect entry is corrupt. */
*pname = "<illegal>";
- complain (&bad_rfd_entry_complaint,
- sym_name, xref_fd, rn->index);
+ bad_rfd_entry_complaint (sym_name, xref_fd, rn->index);
return result;
}
+ fh->iauxBase + sh.index)->a_ti,
&tir);
if (tir.tq0 != tqNil)
- complain (&illegal_forward_tq0_complaint, sym_name);
+ complaint (&symfile_complaints,
+ "illegal tq0 in forward typedef for %s", sym_name);
switch (tir.bt)
{
case btVoid:
break;
default:
- complain (&illegal_forward_bt_complaint, tir.bt, sym_name);
+ complaint (&symfile_complaints,
+ "illegal bt %d in forward typedef for %s", tir.bt,
+ sym_name);
*tpp = init_type (type_code, 0, 0, (char *) NULL,
current_objfile);
break;
if (b == top_stack->cur_block &&
nsyms >= top_stack->maxsyms)
{
- complain (&block_overflow_complaint, SYMBOL_NAME (s));
+ complaint (&symfile_complaints, "block containing %s overfilled",
+ SYMBOL_NAME (s));
/* In this case shrink_block is actually grow_block, since
BLOCK_NSYMS(b) is larger than its current size. */
origb = b;
/* Complaints about ObjC classes, selectors, etc. */
-static struct deprecated_complaint noclass_lookup_complaint = {
- "no way to lookup Objective-C classes", 0, 0
-};
-
-static struct deprecated_complaint nosel_lookup_complaint = {
- "no way to lookup Objective-C selectors", 0, 0
-};
-
-
#if (!defined __GNUC__ || __GNUC__ < 2 || __GNUC_MINOR__ < (defined __cplusplus ? 6 : 4))
#define __CHECK_FUNCTION ((__const char *) 0)
#else
function = find_function_in_inferior("objc_lookup_class");
else
{
- complain (&noclass_lookup_complaint, 0);
+ complaint (&symfile_complaints, "no way to lookup Objective-C classes",
+ 0);
return 0;
}
function = find_function_in_inferior("sel_get_any_uid");
else
{
- complain (&nosel_lookup_complaint, 0);
+ complaint (&symfile_complaints, "no way to lookup Objective-C selectors",
+ 0);
return 0;
}
Returns status of symbol read on target side (0=success, -1=fail)
Returns -1 and complain()s if rpc fails. */
-struct deprecated_complaint cant_contact_target =
-{"Lost contact with VxWorks target", 0, 0};
-
static int
vx_lookup_symbol (char *name, /* symbol name */
CORE_ADDR *pAddr)
xdr_SYMBOL_ADDR, &symbolAddr);
if (status != RPC_SUCCESS)
{
- complain (&cant_contact_target);
+ complaint (&symfile_complaints, "Lost contact with VxWorks target");
return -1;
}
#define BELIEVE_PCC_PROMOTION_TYPE 0
#endif
-static struct deprecated_complaint invalid_cpp_abbrev_complaint =
-{"invalid C++ abbreviation `%s'", 0, 0};
-
-static struct deprecated_complaint invalid_cpp_type_complaint =
-{"C++ abbreviated type name unknown at symtab pos %d", 0, 0};
-
-static struct deprecated_complaint member_fn_complaint =
-{"member function type missing, got '%c'", 0, 0};
-
-static struct deprecated_complaint const_vol_complaint =
-{"const/volatile indicator missing, got '%c'", 0, 0};
-
-static struct deprecated_complaint error_type_complaint =
-{"couldn't parse type; debugger out of date?", 0, 0};
-
-static struct deprecated_complaint invalid_member_complaint =
-{"invalid (minimal) member type data format at symtab pos %d.", 0, 0};
-
-static struct deprecated_complaint range_type_base_complaint =
-{"base type %d of range type is not defined", 0, 0};
-
-static struct deprecated_complaint reg_value_complaint =
-{"register number %d too large (max %d) in symbol %s", 0, 0};
-
-static struct deprecated_complaint vtbl_notfound_complaint =
-{"virtual function table pointer not found when defining class `%s'", 0, 0};
-
-static struct deprecated_complaint unrecognized_cplus_name_complaint =
-{"Unknown C++ symbol name `%s'", 0, 0};
-
-static struct deprecated_complaint rs6000_builtin_complaint =
-{"Unknown builtin type %d", 0, 0};
+static void
+invalid_cpp_abbrev_complaint (const char *arg1)
+{
+ complaint (&symfile_complaints, "invalid C++ abbreviation `%s'", arg1);
+}
-static struct deprecated_complaint unresolved_sym_chain_complaint =
-{"%s: common block `%s' from global_sym_chain unresolved", 0, 0};
+static void
+reg_value_complaint (int arg1, int arg2, const char *arg3)
+{
+ complaint (&symfile_complaints,
+ "register number %d too large (max %d) in symbol %s", arg1, arg2,
+ arg3);
+}
-static struct deprecated_complaint stabs_general_complaint =
-{"%s", 0, 0};
+static void
+stabs_general_complaint (const char *arg1)
+{
+ complaint (&symfile_complaints, "%s", arg1);
+}
-static struct deprecated_complaint lrs_general_complaint =
-{"%s", 0, 0};
+static void
+lrs_general_complaint (const char *arg1)
+{
+ complaint (&symfile_complaints, "%s", arg1);
+}
/* Make a list of forward references which haven't been defined. */
if (filenum < 0 || filenum >= n_this_object_header_files)
{
- static struct deprecated_complaint msg =
- {"\
-Invalid symbol data: type number (%d,%d) out of range at symtab pos %d.",
- 0, 0};
- complain (&msg, filenum, index, symnum);
+ complaint (&symfile_complaints,
+ "Invalid symbol data: type number (%d,%d) out of range at symtab pos %d.",
+ filenum, index, symnum);
goto error_return;
}
return p;
}
+static void
+msg_unknown_complaint (const char *arg1)
+{
+ complaint (&symfile_complaints, "Unsupported token in stabs string %s", arg1);
+}
+
/* Read base classes within cfront class definition.
eg: A:ZcA;1@Bpub v2@Bvirpri;__ct__1AFv func__1AFv *sfunc__1AFv ;as__1A ;;
^^^^^^^^^^^^^^^^^^
read_cfront_baseclasses (struct field_info *fip, char **pp, struct type *type,
struct objfile *objfile)
{
- static struct deprecated_complaint msg_unknown =
- {"\
- Unsupported token in stabs string %s.\n",
- 0, 0};
- static struct deprecated_complaint msg_notfound =
- {"\
- Unable to find base type for %s.\n",
- 0, 0};
int bnum = 0;
char *p;
int i;
/* Bad visibility format. Complain and treat it as
public. */
{
- static struct deprecated_complaint msg =
- {
- "Unknown visibility `%c' for baseclass", 0, 0};
- complain (&msg, new->visibility);
+ complaint (&symfile_complaints,
+ "Unknown visibility `%c' for baseclass",
+ new->visibility);
new->visibility = VISIBILITY_PUBLIC;
}
}
/* "@" comes next - eg: @Bvir */
if (**pp != '@')
{
- complain (&msg_unknown, *pp);
+ msg_unknown_complaint (*pp);
return 1;
}
++(*pp);
bname = get_substring (pp, ';');
if (!bname || !*bname)
{
- complain (&msg_unknown, *pp);
+ msg_unknown_complaint (*pp);
return 1;
}
/* FIXME! attach base info to type */
}
else
{
- complain (&msg_notfound, *pp);
+ complaint (&symfile_complaints, "Unable to find base type for %s",
+ *pp);
return 1;
}
}
ref_func = lookup_symbol (fname, 0, VAR_NAMESPACE, 0, 0); /* demangled name */
if (!ref_func)
{
- static struct deprecated_complaint msg =
- {"\
- Unable to find function symbol for %s\n",
- 0, 0};
- complain (&msg, fname);
+ complaint (&symfile_complaints,
+ "Unable to find function symbol for %s", fname);
continue;
}
sublist = NULL;
ref_sym = ref_search (refnum);
if (!ref_sym)
{
- complain (&lrs_general_complaint, "symbol for reference not found");
+ lrs_general_complaint ("symbol for reference not found");
return 0;
}
sizeof (struct alias_list));
if (!alias)
{
- complain (&lrs_general_complaint, "Unable to allocate alias list memory");
+ lrs_general_complaint ("Unable to allocate alias list memory");
return 0;
}
#endif
default:
- complain (&unrecognized_cplus_name_complaint, string);
+ complaint (&symfile_complaints, "Unknown C++ symbol name `%s'",
+ string);
goto normal; /* Do *something* with it */
}
}
SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
if (SYMBOL_VALUE (sym) >= NUM_REGS + NUM_PSEUDO_REGS)
{
- complain (®_value_complaint, SYMBOL_VALUE (sym),
- NUM_REGS + NUM_PSEUDO_REGS,
- SYMBOL_SOURCE_NAME (sym));
+ reg_value_complaint (SYMBOL_VALUE (sym),
+ NUM_REGS + NUM_PSEUDO_REGS,
+ SYMBOL_SOURCE_NAME (sym));
SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */
}
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
if (SYMBOL_VALUE (sym) >= NUM_REGS + NUM_PSEUDO_REGS)
{
- complain (®_value_complaint, SYMBOL_VALUE (sym),
- NUM_REGS + NUM_PSEUDO_REGS,
- SYMBOL_SOURCE_NAME (sym));
+ reg_value_complaint (SYMBOL_VALUE (sym),
+ NUM_REGS + NUM_PSEUDO_REGS,
+ SYMBOL_SOURCE_NAME (sym));
SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */
}
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (valu);
if (SYMBOL_VALUE (sym) >= NUM_REGS + NUM_PSEUDO_REGS)
{
- complain (®_value_complaint, SYMBOL_VALUE (sym),
- NUM_REGS + NUM_PSEUDO_REGS,
- SYMBOL_SOURCE_NAME (sym));
+ reg_value_complaint (SYMBOL_VALUE (sym),
+ NUM_REGS + NUM_PSEUDO_REGS,
+ SYMBOL_SOURCE_NAME (sym));
SYMBOL_VALUE (sym) = SP_REGNUM; /* Known safe, though useless */
}
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
p = strchr (p, ')');
if (!*p || *p != ')')
{
- complain (&lrs_general_complaint, "live range format not recognized");
+ lrs_general_complaint ("live range format not recognized");
return NULL;
}
p++;
/* Sanity check the beginning of the stabs string. */
if (!*p || *p != 'l')
{
- complain (&lrs_general_complaint, "live range string 1");
+ lrs_general_complaint ("live range string 1");
return 0;
}
p++;
if (!*p || *p != '(')
{
- complain (&lrs_general_complaint, "live range string 2");
+ lrs_general_complaint ("live range string 2");
return 0;
}
p++;
start = ref_search_value (refnum);
if (!start)
{
- complain (&lrs_general_complaint, "Live range symbol not found 1");
+ lrs_general_complaint ("Live range symbol not found 1");
return 0;
}
if (!*p || *p != ',')
{
- complain (&lrs_general_complaint, "live range string 3");
+ lrs_general_complaint ("live range string 3");
return 0;
}
p++;
end = ref_search_value (refnum);
if (!end)
{
- complain (&lrs_general_complaint, "Live range symbol not found 2");
+ lrs_general_complaint ("Live range symbol not found 2");
return 0;
}
if (!*p || *p != ')')
{
- complain (&lrs_general_complaint, "live range string 4");
+ lrs_general_complaint ("live range string 4");
return 0;
}
if (start >= end)
{
- complain (&lrs_general_complaint, "end of live range follows start");
+ lrs_general_complaint ("end of live range follows start");
return;
}
static struct type *
error_type (char **pp, struct objfile *objfile)
{
- complain (&error_type_complaint);
+ complaint (&symfile_complaints, "couldn't parse type; debugger out of date?");
while (1)
{
/* Skip to end of symbol. */
{
/* Complain and keep going, so compilers can invent new
cross-reference types. */
- static struct deprecated_complaint msg =
- {"Unrecognized cross-reference type `%c'", 0, 0};
- complain (&msg, (*pp)[0]);
+ complaint (&symfile_complaints,
+ "Unrecognized cross-reference type `%c'", (*pp)[0]);
code = TYPE_CODE_STRUCT;
break;
}
++*pp;
else
{
- static struct deprecated_complaint msg = {
- "Prototyped function type didn't end arguments with `#':\n%s",
- 0, 0
- };
- complain (&msg, type_start);
+ complaint (&symfile_complaints,
+ "Prototyped function type didn't end arguments with `#':\n%s",
+ type_start);
}
/* If there is just one argument whose type is `void', then
(*pp)++;
return_type = read_type (pp, objfile);
if (*(*pp)++ != ';')
- complain (&invalid_member_complaint, symnum);
+ complaint (&symfile_complaints,
+ "invalid (minimal) member type data format at symtab pos %d.",
+ symnum);
type = allocate_stub_method (return_type);
if (typenums[0] != -1)
*dbx_lookup_type (typenums) = type;
if (typenum >= 0 || typenum < -NUMBER_RECOGNIZED)
{
- complain (&rs6000_builtin_complaint, typenum);
+ complaint (&symfile_complaints, "Unknown builtin type %d", typenum);
return builtin_type_error;
}
if (negative_types[-typenum] != NULL)
case '.':
break;
default:
- complain (&const_vol_complaint, **pp);
+ complaint (&symfile_complaints,
+ "const/volatile indicator missing, got '%c'", **pp);
break;
}
default:
/* error */
- complain (&member_fn_complaint, (*pp)[-1]);
+ complaint (&symfile_complaints,
+ "member function type missing, got '%c'", (*pp)[-1]);
/* Fall through into normal member function. */
case '.':
name = type_name_no_tag (context);
if (name == NULL)
{
- complain (&invalid_cpp_type_complaint, symnum);
+ complaint (&symfile_complaints,
+ "C++ abbreviated type name unknown at symtab pos %d",
+ symnum);
name = "FOO";
}
fip->list->field.name =
break;
default:
- complain (&invalid_cpp_abbrev_complaint, *pp);
+ invalid_cpp_abbrev_complaint (*pp);
fip->list->field.name =
obconcat (&objfile->type_obstack,
"INVALID_CPLUSPLUS_ABBREV", "", "");
p = ++(*pp);
if (p[-1] != ':')
{
- complain (&invalid_cpp_abbrev_complaint, *pp);
+ invalid_cpp_abbrev_complaint (*pp);
return 0;
}
fip->list->field.type = read_type (pp, objfile);
}
else
{
- complain (&invalid_cpp_abbrev_complaint, *pp);
+ invalid_cpp_abbrev_complaint (*pp);
/* We have no idea what syntax an unrecognized abbrev would have, so
better return 0. If we returned 1, we would need to at least advance
*pp to avoid an infinite loop. */
else if (**pp != ',')
{
/* Bad structure-type format. */
- complain (&stabs_general_complaint, "bad structure-type format");
+ stabs_general_complaint ("bad structure-type format");
return;
}
FIELD_BITPOS (fip->list->field) = read_huge_number (pp, ',', &nbits);
if (nbits != 0)
{
- complain (&stabs_general_complaint, "bad structure-type format");
+ stabs_general_complaint ("bad structure-type format");
return;
}
FIELD_BITSIZE (fip->list->field) = read_huge_number (pp, ';', &nbits);
if (nbits != 0)
{
- complain (&stabs_general_complaint, "bad structure-type format");
+ stabs_general_complaint ("bad structure-type format");
return;
}
}
default:
/* Unknown character. Complain and treat it as non-virtual. */
{
- static struct deprecated_complaint msg =
- {
- "Unknown virtual character `%c' for baseclass", 0, 0};
- complain (&msg, **pp);
+ complaint (&symfile_complaints,
+ "Unknown virtual character `%c' for baseclass", **pp);
}
}
++(*pp);
/* Bad visibility format. Complain and treat it as
public. */
{
- static struct deprecated_complaint msg =
- {
- "Unknown visibility `%c' for baseclass", 0, 0
- };
- complain (&msg, new->visibility);
+ complaint (&symfile_complaints,
+ "Unknown visibility `%c' for baseclass",
+ new->visibility);
new->visibility = VISIBILITY_PUBLIC;
}
}
}
}
/* Virtual function table field not found. */
- complain (&vtbl_notfound_complaint, TYPE_NAME (type));
+ complaint (&symfile_complaints,
+ "virtual function table pointer not found when defining class `%s'",
+ TYPE_NAME (type));
return 0;
}
else
ref_static = lookup_symbol (sname, 0, VAR_NAMESPACE, 0, 0); /*demangled_name */
if (!ref_static)
{
- static struct deprecated_complaint msg =
- {"\
- Unable to find symbol for static data field %s\n",
- 0, 0};
- complain (&msg, sname);
+ complaint (&symfile_complaints,
+ "Unable to find symbol for static data field %s", sname);
continue;
}
stype = SYMBOL_TYPE (ref_static);
default:
/* Unknown visibility. Complain and treat it as public. */
{
- static struct deprecated_complaint msg =
- {
- "Unknown visibility `%c' for field", 0, 0};
- complain (&msg, fip->list->visibility);
+ complaint (&symfile_complaints, "Unknown visibility `%c' for field",
+ fip->list->visibility);
}
break;
}
}
-static struct deprecated_complaint multiply_defined_struct =
-{"struct/union type gets multiply defined: %s%s", 0, 0};
-
-
/* Complain that the compiler has emitted more than one definition for the
structure type TYPE. */
static void
kind = "";
}
- complain (&multiply_defined_struct, kind, name);
+ complaint (&symfile_complaints,
+ "struct/union type gets multiply defined: %s%s", kind, name);
}
static struct type *range_type_index;
- complain (&range_type_base_complaint, rangenums[1]);
+ complaint (&symfile_complaints,
+ "base type %d of range type is not defined", rangenums[1]);
if (range_type_index == NULL)
range_type_index =
init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
{
if (common_block_name != NULL)
{
- static struct deprecated_complaint msg =
- {
- "Invalid symbol data: common block within common block",
- 0, 0};
- complain (&msg);
+ complaint (&symfile_complaints,
+ "Invalid symbol data: common block within common block");
}
common_block = local_symbols;
common_block_i = local_symbols ? local_symbols->nsyms : 0;
if (common_block_name == NULL)
{
- static struct deprecated_complaint msg =
- {"ECOMM symbol unmatched by BCOMM", 0, 0};
- complain (&msg);
+ complaint (&symfile_complaints, "ECOMM symbol unmatched by BCOMM");
return;
}
if (typename == NULL)
{
- static struct deprecated_complaint msg =
- {"need a type name", 0, 0};
- complain (&msg);
+ complaint (&symfile_complaints, "need a type name");
break;
}
for (ppt = file_symbols; ppt; ppt = ppt->next)
default:
{
- static struct deprecated_complaint msg =
- {"\
-GDB internal error. cleanup_undefined_types with bad type %d.", 0, 0};
- complain (&msg, TYPE_CODE (*type));
+ complaint (&symfile_complaints,
+ "GDB internal error. cleanup_undefined_types with bad type %d.",
+ TYPE_CODE (*type));
}
break;
}
if (SYMBOL_CLASS (prev) == LOC_STATIC)
SYMBOL_CLASS (prev) = LOC_UNRESOLVED;
else
- complain (&unresolved_sym_chain_complaint,
- objfile->name, SYMBOL_NAME (prev));
+ complaint (&symfile_complaints,
+ "%s: common block `%s' from global_sym_chain unresolved",
+ objfile->name, SYMBOL_NAME (prev));
}
}
memset (global_sym_chain, 0, sizeof (global_sym_chain));
EXTERN int n_allocated_this_object_header_files;
-extern struct deprecated_complaint unknown_symtype_complaint;
-extern struct deprecated_complaint unknown_symchar_complaint;
-
extern struct type *read_type (char **, struct objfile *);
extern void cleanup_undefined_types (void);
CORE_ADDR toc_offset;
};
-static struct deprecated_complaint storclass_complaint =
-{"Unexpected storage class: %d", 0, 0};
-
-static struct deprecated_complaint bf_notfound_complaint =
-{"line numbers off, `.bf' symbol not found", 0, 0};
+static void
+bf_notfound_complaint (void)
+{
+ complaint (&symfile_complaints, "line numbers off, `.bf' symbol not found");
+}
-static struct deprecated_complaint ef_complaint =
-{"Mismatched .ef symbol ignored starting at symnum %d", 0, 0};
+static void
+ef_complaint (int arg1)
+{
+ complaint (&symfile_complaints,
+ "Mismatched .ef symbol ignored starting at symnum %d", arg1);
+}
-static struct deprecated_complaint eb_complaint =
-{"Mismatched .eb symbol ignored starting at symnum %d", 0, 0};
+static void
+eb_complaint (int arg1)
+{
+ complaint (&symfile_complaints,
+ "Mismatched .eb symbol ignored starting at symnum %d", arg1);
+}
static void xcoff_initial_scan (struct objfile *, int);
/* This can happen with old versions of GCC.
GCC 2.3.3-930426 does not exhibit this on a test case which
a user said produced the message for him. */
- static struct deprecated_complaint msg =
- {"Nested C_BINCL symbols", 0, 0};
- complain (&msg);
+ complaint (&symfile_complaints, "Nested C_BINCL symbols");
}
++inclDepth;
if (inclDepth == 0)
{
- static struct deprecated_complaint msg =
- {"Mismatched C_BINCL/C_EINCL pair", 0, 0};
- complain (&msg);
+ complaint (&symfile_complaints, "Mismatched C_BINCL/C_EINCL pair");
}
allocate_include_entry ();
{
if (endoffset >= limit_offset)
{
- static struct deprecated_complaint msg =
- {"Bad line table offset in C_EINCL directive", 0, 0};
- complain (&msg);
+ complaint (&symfile_complaints,
+ "Bad line table offset in C_EINCL directive");
return;
}
limit_offset = endoffset;
xcoff_next_symbol_text (struct objfile *objfile)
{
struct internal_syment symbol;
- static struct deprecated_complaint msg =
- {"Unexpected symbol continuation", 0, 0};
char *retval;
/* FIXME: is this the same as the passed arg? */
objfile = this_symtab_psymtab->objfile;
bfd_coff_swap_sym_in (objfile->obfd, raw_symbol, &symbol);
if (symbol.n_zeroes)
{
- complain (&msg);
+ complaint (&symfile_complaints, "Unexpected symbol continuation");
/* Return something which points to '\0' and hope the symbol reading
code does something reasonable. */
}
else
{
- complain (&msg);
+ complaint (&symfile_complaints, "Unexpected symbol continuation");
/* Return something which points to '\0' and hope the symbol reading
code does something reasonable. */
if (context_stack_depth <= 0)
{ /* We attempted to pop an empty context stack */
- complain (&ef_complaint, cs->c_symnum);
+ ef_complaint (cs->c_symnum);
within_function = 0;
break;
}
/* Stack must be empty now. */
if (context_stack_depth > 0 || new == NULL)
{
- complain (&ef_complaint, cs->c_symnum);
+ ef_complaint (cs->c_symnum);
within_function = 0;
break;
}
case C_UNTAG:
case C_ENTAG:
{
- static struct deprecated_complaint msg =
- {"Unrecognized storage class %d.", 0, 0};
- complain (&msg, cs->c_sclass);
+ complaint (&symfile_complaints, "Unrecognized storage class %d.",
+ cs->c_sclass);
}
break;
{
if (context_stack_depth <= 0)
{ /* We attempted to pop an empty context stack */
- complain (&eb_complaint, cs->c_symnum);
+ eb_complaint (cs->c_symnum);
break;
}
new = pop_context ();
if (depth-- != new->depth)
{
- complain (&eb_complaint, cs->c_symnum);
+ eb_complaint (cs->c_symnum);
break;
}
if (local_symbols && context_stack_depth > 0)
break;
default:
- complain (&storclass_complaint, cs->c_sclass);
+ complaint (&symfile_complaints, "Unexpected storage class: %d",
+ cs->c_sclass);
/* FALLTHROUGH */
case C_DECL:
->symtbl;
if (symno < 0 || symno >= nsyms)
{
- static struct deprecated_complaint msg =
- {"Invalid symbol offset", 0, 0};
- complain (&msg);
+ complaint (&symfile_complaints, "Invalid symbol offset");
symbol->n_value = 0;
symbol->n_scnum = -1;
return;
if (symno < 0)
{
- complain (&bf_notfound_complaint);
+ bf_notfound_complaint ();
return 0;
}
symno += symbol->n_numaux + 1;
}
- complain (&bf_notfound_complaint);
+ bf_notfound_complaint ();
return 0;
gotit:
}
}
+static void
+function_outside_compilation_unit_complaint (const char *arg1)
+{
+ complaint (&symfile_complaints,
+ "function `%s' appears to be defined outside of all compilation units",
+ arg1);
+}
+
static void
scan_xcoff_symtab (struct objfile *objfile)
{
default:
{
- static struct deprecated_complaint msg =
- {"Storage class %d not recognized during scan", 0, 0};
- complain (&msg, sclass);
+ complaint (&symfile_complaints,
+ "Storage class %d not recognized during scan", sclass);
}
/* FALLTHROUGH */
case C_DECL:
case C_STSYM:
{
-
- static struct deprecated_complaint function_outside_compilation_unit = {
- "function `%s' appears to be defined outside of all compilation units", 0, 0
- };
-
char *p;
swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol,
&ssymnum, objfile);
char *name = xmalloc (name_len + 1);
memcpy (name, namestring, name_len);
name[name_len] = '\0';
- complain (&function_outside_compilation_unit, name);
+ function_outside_compilation_unit_complaint (name);
xfree (name);
}
symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
char *name = xmalloc (name_len + 1);
memcpy (name, namestring, name_len);
name[name_len] = '\0';
- complain (&function_outside_compilation_unit, name);
+ function_outside_compilation_unit_complaint (name);
xfree (name);
}
symbol.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
time searching to the end of every string looking for
a backslash. */
- complain (&unknown_symchar_complaint, p[1]);
+ complaint (&symfile_complaints,
+ "unknown symbol descriptor `%c'", p[1]);
/* Ignore it; perhaps it is an extension that we don't
know about. */