Remove symfile_complaints

The complaint system seems to allow for multiple different complaint
topics.  However, in practice only symfile_complaints has ever been
defined.  Seeing that complaints.c dates to 1992, and that no new
complaints have been added in the intervening years, I think it is
reasonable to admit that complaints are specifically related to
debuginfo reading.

This patch removes symfile_complaints and updates all the callers.
Some of these spots should perhaps be calls to warning instead, but I
did not make that change.

gdb/ChangeLog
2018-05-23  Tom Tromey  <tom@tromey.com>

	* complaints.c (symfile_complaints): Remove.
	(complaint_internal): Remove "complaints" parameter.
	(clear_complaints, vcomplaint): Remove "c" parameter.
	(get_complaints): Remove.
	* dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint)
	(dwarf2_debug_line_missing_file_complaint)
	(dwarf2_debug_line_missing_end_sequence_complaint)
	(dwarf2_complex_location_expr_complaint)
	(dwarf2_const_value_length_mismatch_complaint)
	(dwarf2_section_buffer_overflow_complaint)
	(dwarf2_macro_malformed_definition_complaint)
	(dwarf2_invalid_attrib_class_complaint)
	(create_addrmap_from_index, dw2_symtab_iter_next)
	(dw2_expand_marked_cus)
	(dw2_debug_names_iterator::find_vec_in_debug_names)
	(dw2_debug_names_iterator::next, dw2_debug_names_iterator::next)
	(create_debug_type_hash_table, init_cutu_and_read_dies)
	(partial_die_parent_scope, add_partial_enumeration)
	(skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die)
	(dwarf2_compute_name, dwarf2_physname, read_namespace_alias)
	(read_import_statement, read_file_scope, create_dwo_cu_reader)
	(create_cus_hash_table, create_dwp_hash_table)
	(inherit_abstract_dies, read_func_scope, read_call_site_scope)
	(dwarf2_rnglists_process, dwarf2_ranges_process)
	(dwarf2_add_type_defn, dwarf2_attach_fields_to_type)
	(dwarf2_add_member_fn, get_alignment, maybe_set_alignment)
	(handle_struct_member_die, process_structure_scope)
	(read_array_type, read_common_block, read_module_type)
	(read_tag_pointer_type, read_typedef, read_base_type)
	(read_subrange_type, load_partial_dies, partial_die_info::read)
	(partial_die_info::read, partial_die_info::read)
	(partial_die_info::read, read_checked_initial_length_and_offset)
	(dwarf2_string_attr, read_formatted_entries)
	(dwarf_decode_line_header)
	(lnp_state_machine::check_line_address, dwarf_decode_lines_1)
	(new_symbol, dwarf2_const_value_attr, lookup_die_type)
	(read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset)
	(dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes)
	(get_signatured_type, get_DW_AT_signature_type)
	(decode_locdesc, file_file_name, consume_improper_spaces)
	(skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header)
	(dwarf_decode_macro_bytes, dwarf_decode_macros)
	(dwarf2_symbol_mark_computed, set_die_type)
	(read_attribute_value): Update.
	* stap-probe.c (handle_stap_probe, get_stap_base_address):
	Update.
	* dbxread.c (unknown_symtype_complaint)
	(lbrac_mismatch_complaint, repeated_header_complaint)
	(set_namestring, function_outside_compilation_unit_complaint)
	(read_dbx_symtab, process_one_symbol): Update.
	* gdbtypes.c (stub_noname_complaint): Update.
	* windows-nat.c (handle_unload_dll): Update.
	* coffread.c (coff_symtab_read, enter_linenos, decode_type)
	(decode_base_type): Update.
	* xcoffread.c (bf_notfound_complaint, ef_complaint)
	(eb_complaint, record_include_begin, record_include_end)
	(enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab)
	(process_xcoff_symbol, read_symbol)
	(function_outside_compilation_unit_complaint)
	(scan_xcoff_symtab): Update.
	* machoread.c (macho_symtab_read, macho_add_oso_symfile): Update.
	* buildsym.c (finish_block_internal, make_blockvector)
	(end_symtab_get_static_block, augment_type_symtab): Update.
	* dtrace-probe.c (dtrace_process_dof)
	(dtrace_static_probe_ops::get_probes): Update.
	* complaints.h (struct complaint): Don't declare.
	(symfile_complaints): Remove.
	(complaint_internal): Remove "complaints" parameter.
	(complaint): Likewise.
	(clear_complaints): Likewise.
	* symfile.c (syms_from_objfile_1, finish_new_objfile)
	(reread_symbols): Update.
	* dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program)
	(dwarf2_frame_cache, decode_frame_entry): Update.
	* dwarf2loc.c (dwarf_reg_to_regnum): Update.
	* objc-lang.c (lookup_objc_class, lookup_child_selector)
	(info_selectors_command): Update.
	* macrotab.c (macro_include, check_for_redefinition)
	(macro_undef): Update.
	* objfiles.c (filter_overlapping_sections): Update.
	* stabsread.c (invalid_cpp_abbrev_complaint)
	(reg_value_complaint, stabs_general_complaint, dbx_lookup_type)
	(define_symbol, error_type, read_type, rs6000_builtin_type)
	(stabs_method_name_from_physname, read_member_functions)
	(read_cpp_abbrev, read_baseclasses, read_tilde_fields)
	(attach_fields_to_type, complain_about_struct_wipeout)
	(read_range_type, read_args, common_block_start)
	(common_block_end, cleanup_undefined_types_1, scan_file_globals):
	Update.
	* mdebugread.c (index_complaint, unknown_ext_complaint)
	(basic_type_complaint, bad_tag_guess_complaint)
	(bad_rfd_entry_complaint, unexpected_type_code_complaint)
	(reg_value_complaint, parse_symbol, parse_type, upgrade_type)
	(parse_procedure, parse_lines)
	(function_outside_compilation_unit_complaint)
	(parse_partial_symbols, psymtab_to_symtab_1, cross_ref)
	(bad_tag_guess_complaint, reg_value_complaint): Update.
	* cp-support.c (demangled_name_complaint): Update.
	* macroscope.c (sal_macro_scope): Update.
	* dwarf-index-write.c (class debug_names): Update.

gdb/testsuite/ChangeLog
2018-05-23  Tom Tromey  <tom@tromey.com>

	* gdb.gdb/complaints.exp (test_initial_complaints): Don't mention
	symfile_complaints.
	(test_short_complaints): Likewise.
	(test_empty_complaints): Likewise.
	(test_initial_complaints): Update.
This commit is contained in:
Tom Tromey 2018-05-16 22:54:44 -06:00
parent 4e9668d0d1
commit b98664d386
26 changed files with 427 additions and 565 deletions

View file

@ -1,3 +1,106 @@
2018-05-23 Tom Tromey <tom@tromey.com>
* complaints.c (symfile_complaints): Remove.
(complaint_internal): Remove "complaints" parameter.
(clear_complaints, vcomplaint): Remove "c" parameter.
(get_complaints): Remove.
* dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint)
(dwarf2_debug_line_missing_file_complaint)
(dwarf2_debug_line_missing_end_sequence_complaint)
(dwarf2_complex_location_expr_complaint)
(dwarf2_const_value_length_mismatch_complaint)
(dwarf2_section_buffer_overflow_complaint)
(dwarf2_macro_malformed_definition_complaint)
(dwarf2_invalid_attrib_class_complaint)
(create_addrmap_from_index, dw2_symtab_iter_next)
(dw2_expand_marked_cus)
(dw2_debug_names_iterator::find_vec_in_debug_names)
(dw2_debug_names_iterator::next, dw2_debug_names_iterator::next)
(create_debug_type_hash_table, init_cutu_and_read_dies)
(partial_die_parent_scope, add_partial_enumeration)
(skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die)
(dwarf2_compute_name, dwarf2_physname, read_namespace_alias)
(read_import_statement, read_file_scope, create_dwo_cu_reader)
(create_cus_hash_table, create_dwp_hash_table)
(inherit_abstract_dies, read_func_scope, read_call_site_scope)
(dwarf2_rnglists_process, dwarf2_ranges_process)
(dwarf2_add_type_defn, dwarf2_attach_fields_to_type)
(dwarf2_add_member_fn, get_alignment, maybe_set_alignment)
(handle_struct_member_die, process_structure_scope)
(read_array_type, read_common_block, read_module_type)
(read_tag_pointer_type, read_typedef, read_base_type)
(read_subrange_type, load_partial_dies, partial_die_info::read)
(partial_die_info::read, partial_die_info::read)
(partial_die_info::read, read_checked_initial_length_and_offset)
(dwarf2_string_attr, read_formatted_entries)
(dwarf_decode_line_header)
(lnp_state_machine::check_line_address, dwarf_decode_lines_1)
(new_symbol, dwarf2_const_value_attr, lookup_die_type)
(read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset)
(dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes)
(get_signatured_type, get_DW_AT_signature_type)
(decode_locdesc, file_file_name, consume_improper_spaces)
(skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header)
(dwarf_decode_macro_bytes, dwarf_decode_macros)
(dwarf2_symbol_mark_computed, set_die_type)
(read_attribute_value): Update.
* stap-probe.c (handle_stap_probe, get_stap_base_address):
Update.
* dbxread.c (unknown_symtype_complaint)
(lbrac_mismatch_complaint, repeated_header_complaint)
(set_namestring, function_outside_compilation_unit_complaint)
(read_dbx_symtab, process_one_symbol): Update.
* gdbtypes.c (stub_noname_complaint): Update.
* windows-nat.c (handle_unload_dll): Update.
* coffread.c (coff_symtab_read, enter_linenos, decode_type)
(decode_base_type): Update.
* xcoffread.c (bf_notfound_complaint, ef_complaint)
(eb_complaint, record_include_begin, record_include_end)
(enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab)
(process_xcoff_symbol, read_symbol)
(function_outside_compilation_unit_complaint)
(scan_xcoff_symtab): Update.
* machoread.c (macho_symtab_read, macho_add_oso_symfile): Update.
* buildsym.c (finish_block_internal, make_blockvector)
(end_symtab_get_static_block, augment_type_symtab): Update.
* dtrace-probe.c (dtrace_process_dof)
(dtrace_static_probe_ops::get_probes): Update.
* complaints.h (struct complaint): Don't declare.
(symfile_complaints): Remove.
(complaint_internal): Remove "complaints" parameter.
(complaint): Likewise.
(clear_complaints): Likewise.
* symfile.c (syms_from_objfile_1, finish_new_objfile)
(reread_symbols): Update.
* dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program)
(dwarf2_frame_cache, decode_frame_entry): Update.
* dwarf2loc.c (dwarf_reg_to_regnum): Update.
* objc-lang.c (lookup_objc_class, lookup_child_selector)
(info_selectors_command): Update.
* macrotab.c (macro_include, check_for_redefinition)
(macro_undef): Update.
* objfiles.c (filter_overlapping_sections): Update.
* stabsread.c (invalid_cpp_abbrev_complaint)
(reg_value_complaint, stabs_general_complaint, dbx_lookup_type)
(define_symbol, error_type, read_type, rs6000_builtin_type)
(stabs_method_name_from_physname, read_member_functions)
(read_cpp_abbrev, read_baseclasses, read_tilde_fields)
(attach_fields_to_type, complain_about_struct_wipeout)
(read_range_type, read_args, common_block_start)
(common_block_end, cleanup_undefined_types_1, scan_file_globals):
Update.
* mdebugread.c (index_complaint, unknown_ext_complaint)
(basic_type_complaint, bad_tag_guess_complaint)
(bad_rfd_entry_complaint, unexpected_type_code_complaint)
(reg_value_complaint, parse_symbol, parse_type, upgrade_type)
(parse_procedure, parse_lines)
(function_outside_compilation_unit_complaint)
(parse_partial_symbols, psymtab_to_symtab_1, cross_ref)
(bad_tag_guess_complaint, reg_value_complaint): Update.
* cp-support.c (demangled_name_complaint): Update.
* macroscope.c (sal_macro_scope): Update.
* dwarf-index-write.c (class debug_names): Update.
2018-05-23 Tom Tromey <tom@tromey.com> 2018-05-23 Tom Tromey <tom@tromey.com>
* complaints.c (clear_complaints): Remove "noisy" parameter. * complaints.c (clear_complaints): Remove "noisy" parameter.

View file

@ -445,15 +445,13 @@ finish_block_internal (struct symbol *symbol,
{ {
if (symbol) if (symbol)
{ {
complaint (&symfile_complaints, complaint (_("block end address less than block "
_("block end address less than block "
"start address in %s (patched it)"), "start address in %s (patched it)"),
SYMBOL_PRINT_NAME (symbol)); SYMBOL_PRINT_NAME (symbol));
} }
else else
{ {
complaint (&symfile_complaints, complaint (_("block end address %s less than block "
_("block end address %s less than block "
"start address %s (patched it)"), "start address %s (patched it)"),
paddress (gdbarch, BLOCK_END (block)), paddress (gdbarch, BLOCK_END (block)),
paddress (gdbarch, BLOCK_START (block))); paddress (gdbarch, BLOCK_START (block)));
@ -485,14 +483,12 @@ finish_block_internal (struct symbol *symbol,
{ {
if (symbol) if (symbol)
{ {
complaint (&symfile_complaints, complaint (_("inner block not inside outer block in %s"),
_("inner block not inside outer block in %s"),
SYMBOL_PRINT_NAME (symbol)); SYMBOL_PRINT_NAME (symbol));
} }
else else
{ {
complaint (&symfile_complaints, complaint (_("inner block (%s-%s) not "
_("inner block (%s-%s) not "
"inside outer block (%s-%s)"), "inside outer block (%s-%s)"),
paddress (gdbarch, BLOCK_START (pblock->block)), paddress (gdbarch, BLOCK_START (pblock->block)),
paddress (gdbarch, BLOCK_END (pblock->block)), paddress (gdbarch, BLOCK_END (pblock->block)),
@ -653,7 +649,7 @@ make_blockvector (void)
CORE_ADDR start CORE_ADDR start
= BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i)); = BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i));
complaint (&symfile_complaints, _("block at %s out of order"), complaint (_("block at %s out of order"),
hex_string ((LONGEST) start)); hex_string ((LONGEST) start));
} }
} }
@ -1237,8 +1233,7 @@ end_symtab_get_static_block (CORE_ADDR end_addr, int expandable, int required)
same. FIXME: Find out why it is happening. This is not same. FIXME: Find out why it is happening. This is not
believed to happen in most cases (even for coffread.c); believed to happen in most cases (even for coffread.c);
it used to be an abort(). */ it used to be an abort(). */
complaint (&symfile_complaints, complaint (_("Context stack not empty in end_symtab"));
_("Context stack not empty in end_symtab"));
context_stack_depth = 0; context_stack_depth = 0;
} }
} }
@ -1585,17 +1580,15 @@ augment_type_symtab (void)
if (context_stack_depth > 0) if (context_stack_depth > 0)
{ {
complaint (&symfile_complaints, complaint (_("Context stack not empty in augment_type_symtab"));
_("Context stack not empty in augment_type_symtab"));
context_stack_depth = 0; context_stack_depth = 0;
} }
if (pending_blocks != NULL) if (pending_blocks != NULL)
complaint (&symfile_complaints, _("Blocks in a type symtab")); complaint (_("Blocks in a type symtab"));
if (pending_macros != NULL) if (pending_macros != NULL)
complaint (&symfile_complaints, _("Macro in a type symtab")); complaint (_("Macro in a type symtab"));
if (have_line_numbers) if (have_line_numbers)
complaint (&symfile_complaints, complaint (_("Line numbers recorded in a type symtab"));
_("Line numbers recorded in a type symtab"));
if (file_symbols != NULL) if (file_symbols != NULL)
{ {

View file

@ -896,8 +896,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
case C_LINE: case C_LINE:
case C_ALIAS: case C_ALIAS:
case C_HIDDEN: case C_HIDDEN:
complaint (&symfile_complaints, complaint (_("Bad n_sclass for symbol %s"),
_("Bad n_sclass for symbol %s"),
cs->c_name); cs->c_name);
break; break;
@ -1066,8 +1065,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
/* main_aux.x_sym.x_misc.x_lnsz.x_lnno /* main_aux.x_sym.x_misc.x_lnsz.x_lnno
contains line number of '{' }. */ contains line number of '{' }. */
if (cs->c_naux != 1) if (cs->c_naux != 1)
complaint (&symfile_complaints, complaint (_("`.bf' symbol %d has no aux entry"),
_("`.bf' symbol %d has no aux entry"),
cs->c_symnum); cs->c_symnum);
fcn_first_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno; fcn_first_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
fcn_first_line_addr = cs->c_value; fcn_first_line_addr = cs->c_value;
@ -1093,8 +1091,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
if (context_stack_depth <= 0) if (context_stack_depth <= 0)
{ /* We attempted to pop an empty context stack. */ { /* We attempted to pop an empty context stack. */
complaint (&symfile_complaints, complaint (_("`.ef' symbol without matching `.bf' "
_("`.ef' symbol without matching `.bf' "
"symbol ignored starting at symnum %d"), "symbol ignored starting at symnum %d"),
cs->c_symnum); cs->c_symnum);
within_function = 0; within_function = 0;
@ -1105,8 +1102,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
/* Stack must be empty now. */ /* Stack must be empty now. */
if (context_stack_depth > 0 || newobj == NULL) if (context_stack_depth > 0 || newobj == NULL)
{ {
complaint (&symfile_complaints, complaint (_("Unmatched .ef symbol(s) ignored "
_("Unmatched .ef symbol(s) ignored "
"starting at symnum %d"), "starting at symnum %d"),
cs->c_symnum); cs->c_symnum);
within_function = 0; within_function = 0;
@ -1114,8 +1110,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
} }
if (cs->c_naux != 1) if (cs->c_naux != 1)
{ {
complaint (&symfile_complaints, complaint (_("`.ef' symbol %d has no aux entry"),
_("`.ef' symbol %d has no aux entry"),
cs->c_symnum); cs->c_symnum);
fcn_last_line = 0x7FFFFFFF; fcn_last_line = 0x7FFFFFFF;
} }
@ -1160,8 +1155,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
{ {
if (context_stack_depth <= 0) if (context_stack_depth <= 0)
{ /* We attempted to pop an empty context stack. */ { /* We attempted to pop an empty context stack. */
complaint (&symfile_complaints, complaint (_("`.eb' symbol without matching `.bb' "
_("`.eb' symbol without matching `.bb' "
"symbol ignored starting at symnum %d"), "symbol ignored starting at symnum %d"),
cs->c_symnum); cs->c_symnum);
break; break;
@ -1170,8 +1164,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
newobj = pop_context (); newobj = pop_context ();
if (depth-- != newobj->depth) if (depth-- != newobj->depth)
{ {
complaint (&symfile_complaints, complaint (_("Mismatched .eb symbol ignored "
_("Mismatched .eb symbol ignored "
"starting at symnum %d"), "starting at symnum %d"),
symnum); symnum);
break; break;
@ -1480,8 +1473,7 @@ enter_linenos (long file_offset, int first_line,
return; return;
if (file_offset < linetab_offset) if (file_offset < linetab_offset)
{ {
complaint (&symfile_complaints, complaint (_("Line number pointer %ld lower than start of line numbers"),
_("Line number pointer %ld lower than start of line numbers"),
file_offset); file_offset);
if (file_offset > linetab_size) /* Too big to be an offset? */ if (file_offset > linetab_size) /* Too big to be an offset? */
return; return;
@ -1877,8 +1869,7 @@ decode_type (struct coff_symbol *cs, unsigned int c_type,
} }
else else
{ {
complaint (&symfile_complaints, complaint (_("Symbol table entry for %s has bad tagndx value"),
_("Symbol table entry for %s has bad tagndx value"),
cs->c_name); cs->c_name);
/* And fall through to decode_base_type... */ /* And fall through to decode_base_type... */
} }
@ -2047,8 +2038,7 @@ decode_base_type (struct coff_symbol *cs,
else else
return objfile_type (objfile)->builtin_unsigned_long; return objfile_type (objfile)->builtin_unsigned_long;
} }
complaint (&symfile_complaints, complaint (_("Unexpected type for symbol %s"), cs->c_name);
_("Unexpected type for symbol %s"), cs->c_name);
return objfile_type (objfile)->builtin_void; return objfile_type (objfile)->builtin_void;
} }

View file

@ -83,21 +83,6 @@ static struct complaints symfile_complaint_book = {
ISOLATED_MESSAGE, ISOLATED_MESSAGE,
symfile_explanations symfile_explanations
}; };
struct complaints *symfile_complaints = &symfile_complaint_book;
/* Wrapper function to, on-demand, fill in a complaints object. */
static struct complaints *
get_complaints (struct complaints **c)
{
if ((*c) != NULL)
return (*c);
(*c) = XNEW (struct complaints);
(*c)->root = &complaint_sentinel;
(*c)->series = ISOLATED_MESSAGE;
(*c)->explanation = NULL;
return (*c);
}
static struct complain * ATTRIBUTE_PRINTF (4, 0) static struct complain * ATTRIBUTE_PRINTF (4, 0)
find_complaint (struct complaints *complaints, const char *file, find_complaint (struct complaints *complaints, const char *file,
@ -143,23 +128,20 @@ int stop_whining = 0;
/* Print a complaint, and link the complaint block into a chain for /* Print a complaint, and link the complaint block into a chain for
later handling. */ later handling. */
static void ATTRIBUTE_PRINTF (4, 0) static void ATTRIBUTE_PRINTF (3, 0)
vcomplaint (struct complaints **c, const char *file, vcomplaint (const char *file,
int line, const char *fmt, int line, const char *fmt,
va_list args) va_list args)
{ {
struct complaints *complaints = get_complaints (c); struct complain *complaint = find_complaint (&symfile_complaint_book, file,
struct complain *complaint = find_complaint (complaints, file,
line, fmt); line, fmt);
enum complaint_series series; enum complaint_series series;
gdb_assert (complaints != NULL);
complaint->counter++; complaint->counter++;
if (complaint->counter > stop_whining) if (complaint->counter > stop_whining)
return; return;
series = complaints->series; series = symfile_complaint_book.series;
/* Pass 'fmt' instead of 'complaint->fmt' to printf-like callees /* Pass 'fmt' instead of 'complaint->fmt' to printf-like callees
from here on, to avoid "format string is not a string literal" from here on, to avoid "format string is not a string literal"
@ -174,7 +156,7 @@ vcomplaint (struct complaints **c, const char *file,
(*deprecated_warning_hook) (fmt, args); (*deprecated_warning_hook) (fmt, args);
else else
{ {
if (complaints->explanation == NULL) if (symfile_complaint_book.explanation == NULL)
/* A [v]warning() call always appends a newline. */ /* A [v]warning() call always appends a newline. */
vwarning (fmt, args); vwarning (fmt, args);
else else
@ -184,9 +166,9 @@ vcomplaint (struct complaints **c, const char *file,
begin_line (); begin_line ();
/* XXX: i18n */ /* XXX: i18n */
fprintf_filtered (gdb_stderr, "%s%s%s", fprintf_filtered (gdb_stderr, "%s%s%s",
complaints->explanation[series].prefix, symfile_complaint_book.explanation[series].prefix,
msg.c_str (), msg.c_str (),
complaints->explanation[series].postfix); symfile_complaint_book.explanation[series].postfix);
/* Force a line-break after any isolated message. */ /* Force a line-break after any isolated message. */
if (series == ISOLATED_MESSAGE) if (series == ISOLATED_MESSAGE)
/* It would be really nice to use begin_line() here. /* It would be really nice to use begin_line() here.
@ -207,12 +189,12 @@ vcomplaint (struct complaints **c, const char *file,
} }
void void
complaint_internal (struct complaints **complaints, const char *fmt, ...) complaint_internal (const char *fmt, ...)
{ {
va_list args; va_list args;
va_start (args, fmt); va_start (args, fmt);
vcomplaint (complaints, NULL/*file*/, 0/*line*/, fmt, args); vcomplaint (NULL/*file*/, 0/*line*/, fmt, args);
va_end (args); va_end (args);
} }
@ -223,20 +205,19 @@ complaint_internal (struct complaints **complaints, const char *fmt, ...)
complaints (rather than being interleaved with other messages). */ complaints (rather than being interleaved with other messages). */
void void
clear_complaints (struct complaints **c, int less_verbose) clear_complaints (int less_verbose)
{ {
struct complaints *complaints = get_complaints (c);
struct complain *p; struct complain *p;
for (p = complaints->root; p != NULL; p = p->next) for (p = symfile_complaint_book.root; p != NULL; p = p->next)
{ {
p->counter = 0; p->counter = 0;
} }
if (!less_verbose) if (!less_verbose)
complaints->series = ISOLATED_MESSAGE; symfile_complaint_book.series = ISOLATED_MESSAGE;
else else
complaints->series = SHORT_FIRST_MESSAGE; symfile_complaint_book.series = SHORT_FIRST_MESSAGE;
} }
static void static void

View file

@ -25,25 +25,21 @@
particular category. */ particular category. */
struct complaints; struct complaints;
/* Predefined categories. */
extern struct complaints *symfile_complaints;
/* Helper for complaint. */ /* Helper for complaint. */
extern void complaint_internal (struct complaints **complaints, extern void complaint_internal (const char *fmt, ...)
const char *fmt, ...) ATTRIBUTE_PRINTF (1, 2);
ATTRIBUTE_PRINTF (2, 3);
/* Register a complaint. This is a macro around complaint_internal to /* Register a complaint. This is a macro around complaint_internal to
avoid computing complaint's arguments when complaints are disabled. avoid computing complaint's arguments when complaints are disabled.
Running FMT via gettext [i.e., _(FMT)] can be quite expensive, for Running FMT via gettext [i.e., _(FMT)] can be quite expensive, for
example. */ example. */
#define complaint(COMPLAINTS, FMT, ...) \ #define complaint(FMT, ...) \
do \ do \
{ \ { \
extern int stop_whining; \ extern int stop_whining; \
\ \
if (stop_whining > 0) \ if (stop_whining > 0) \
complaint_internal (COMPLAINTS, FMT, ##__VA_ARGS__); \ complaint_internal (FMT, ##__VA_ARGS__); \
} \ } \
while (0) while (0)
@ -55,8 +51,7 @@ extern void complaint_internal (struct complaints **complaints,
noisy is 1, we are in a noisy command, and our caller will print noisy is 1, we are in a noisy command, and our caller will print
enough context for the user to figure it out. */ enough context for the user to figure it out. */
extern void clear_complaints (struct complaints **complaints, extern void clear_complaints (int less_verbose);
int less_verbose);
#endif /* !defined (COMPLAINTS_H) */ #endif /* !defined (COMPLAINTS_H) */

View file

@ -1108,8 +1108,7 @@ cp_find_first_component_aux (const char *name, int permissive)
static void static void
demangled_name_complaint (const char *name) demangled_name_complaint (const char *name)
{ {
complaint (&symfile_complaints, complaint ("unexpected demangled name '%s'", name);
"unexpected demangled name '%s'", name);
} }
/* If NAME is the fully-qualified name of a C++ /* If NAME is the fully-qualified name of a C++

View file

@ -164,21 +164,19 @@ static int has_line_numbers;
static void static void
unknown_symtype_complaint (const char *arg1) unknown_symtype_complaint (const char *arg1)
{ {
complaint (&symfile_complaints, _("unknown symbol type %s"), arg1); complaint (_("unknown symbol type %s"), arg1);
} }
static void static void
lbrac_mismatch_complaint (int arg1) lbrac_mismatch_complaint (int arg1)
{ {
complaint (&symfile_complaints, complaint (_("N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d"), arg1);
_("N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d"), arg1);
} }
static void static void
repeated_header_complaint (const char *arg1, int arg2) repeated_header_complaint (const char *arg1, int arg2)
{ {
complaint (&symfile_complaints, complaint (_("\"repeated\" header file %s not "
_("\"repeated\" header file %s not "
"previously seen, at symtab pos %d"), "previously seen, at symtab pos %d"),
arg1, arg2); arg1, arg2);
} }
@ -940,8 +938,7 @@ set_namestring (struct objfile *objfile, const struct internal_nlist *nlist)
>= DBX_STRINGTAB_SIZE (objfile) >= DBX_STRINGTAB_SIZE (objfile)
|| nlist->n_strx + file_string_table_offset < nlist->n_strx) || nlist->n_strx + file_string_table_offset < nlist->n_strx)
{ {
complaint (&symfile_complaints, complaint (_("bad string table offset in symbol %d"),
_("bad string table offset in symbol %d"),
symnum); symnum);
namestring = "<bad string table offset>"; namestring = "<bad string table offset>";
} }
@ -999,8 +996,7 @@ find_stab_function_addr (const char *namestring, const char *filename,
static void static void
function_outside_compilation_unit_complaint (const char *arg1) function_outside_compilation_unit_complaint (const char *arg1)
{ {
complaint (&symfile_complaints, complaint (_("function `%s' appears to be defined "
_("function `%s' appears to be defined "
"outside of all compilation units"), "outside of all compilation units"),
arg1); arg1);
} }
@ -1389,8 +1385,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
{ {
/* FIXME: we should not get here without a PST to work on. /* FIXME: we should not get here without a PST to work on.
Attempt to recover. */ Attempt to recover. */
complaint (&symfile_complaints, complaint (_("N_BINCL %s not in entries for "
_("N_BINCL %s not in entries for "
"any file, at symtab pos %d"), "any file, at symtab pos %d"),
namestring, symnum); namestring, symnum);
continue; continue;
@ -1839,8 +1834,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
time searching to the end of every string looking for time searching to the end of every string looking for
a backslash. */ a backslash. */
complaint (&symfile_complaints, complaint (_("unknown symbol descriptor `%c'"),
_("unknown symbol descriptor `%c'"),
p[1]); p[1]);
/* Ignore it; perhaps it is an extension that we don't /* Ignore it; perhaps it is an extension that we don't
@ -2635,8 +2629,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
2000 would output N_LSYM entries after N_LBRAC 2000 would output N_LSYM entries after N_LBRAC
entries. As a consequence, these symbols are simply entries. As a consequence, these symbols are simply
discarded. Complain if this is the case. */ discarded. Complain if this is the case. */
complaint (&symfile_complaints, complaint (_("misplaced N_LBRAC entry; discarding local "
_("misplaced N_LBRAC entry; discarding local "
"symbols which have no enclosing block")); "symbols which have no enclosing block"));
} }
local_symbols = newobj->locals; local_symbols = newobj->locals;
@ -2656,8 +2649,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
??? Which compilers? Is this ever harmful?. */ ??? Which compilers? Is this ever harmful?. */
if (newobj->start_addr > valu) if (newobj->start_addr > valu)
{ {
complaint (&symfile_complaints, complaint (_("block start larger than block end"));
_("block start larger than block end"));
newobj->start_addr = valu; newobj->start_addr = valu;
} }
/* Make a block for the local symbols within. */ /* Make a block for the local symbols within. */
@ -2937,8 +2929,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
if (context_stack_depth > 1) if (context_stack_depth > 1)
{ {
complaint (&symfile_complaints, complaint (_("unmatched N_LBRAC before symtab pos %d"),
_("unmatched N_LBRAC before symtab pos %d"),
symnum); symnum);
break; break;
} }

View file

@ -607,8 +607,7 @@ dtrace_process_dof (asection *sect, struct objfile *objfile,
return; return;
invalid_dof_data: invalid_dof_data:
complaint (&symfile_complaints, complaint (_("skipping section '%s' which does not contain valid DOF data."),
_("skipping section '%s' which does not contain valid DOF data."),
sect->name); sect->name);
} }
@ -858,8 +857,7 @@ dtrace_static_probe_ops::get_probes (std::vector<probe *> *probesp,
/* Read the contents of the DOF section and then process it to /* Read the contents of the DOF section and then process it to
extract the information of any probe defined into it. */ extract the information of any probe defined into it. */
if (!bfd_malloc_and_get_section (abfd, sect, &dof)) if (!bfd_malloc_and_get_section (abfd, sect, &dof))
complaint (&symfile_complaints, complaint (_("could not obtain the contents of"
_("could not obtain the contents of"
"section '%s' in objfile `%s'."), "section '%s' in objfile `%s'."),
sect->name, abfd->filename); sect->name, abfd->filename);

View file

@ -933,8 +933,7 @@ private:
= m_str_table.emplace (c_str_view (s), = m_str_table.emplace (c_str_view (s),
data - dwarf2_per_objfile->str.buffer); data - dwarf2_per_objfile->str.buffer);
if (!insertpair.second) if (!insertpair.second)
complaint (&symfile_complaints, complaint (_("Duplicate string \"%s\" in "
_("Duplicate string \"%s\" in "
".debug_str section [in module %s]"), ".debug_str section [in module %s]"),
s, bfd_get_filename (m_abfd)); s, bfd_get_filename (m_abfd));
data += strlen (s) + 1; data += strlen (s) + 1;

View file

@ -216,7 +216,7 @@ dwarf2_restore_rule (struct gdbarch *gdbarch, ULONGEST reg_num,
{ {
int regnum = dwarf_reg_to_regnum (gdbarch, reg); int regnum = dwarf_reg_to_regnum (gdbarch, reg);
complaint (&symfile_complaints, _("\ complaint (_("\
incomplete CFI data; DW_CFA_restore unspecified\n\ incomplete CFI data; DW_CFA_restore unspecified\n\
register %s (#%d) at %s"), register %s (#%d) at %s"),
gdbarch_register_name (gdbarch, regnum), regnum, gdbarch_register_name (gdbarch, regnum), regnum,
@ -449,7 +449,7 @@ execute_cfa_program (struct dwarf2_fde *fde, const gdb_byte *insn_ptr,
if (old_rs == NULL) if (old_rs == NULL)
{ {
complaint (&symfile_complaints, _("\ complaint (_("\
bad CFI data; mismatched DW_CFA_restore_state at %s"), bad CFI data; mismatched DW_CFA_restore_state at %s"),
paddress (gdbarch, fs->pc)); paddress (gdbarch, fs->pc));
} }
@ -1111,7 +1111,7 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
if (fs.regs.reg[column].how == DWARF2_FRAME_REG_UNSPECIFIED) if (fs.regs.reg[column].how == DWARF2_FRAME_REG_UNSPECIFIED)
{ {
if (cache->reg[regnum].how == DWARF2_FRAME_REG_UNSPECIFIED) if (cache->reg[regnum].how == DWARF2_FRAME_REG_UNSPECIFIED)
complaint (&symfile_complaints, _("\ complaint (_("\
incomplete CFI data; unspecified registers (e.g., %s) at %s"), incomplete CFI data; unspecified registers (e.g., %s) at %s"),
gdbarch_register_name (gdbarch, regnum), gdbarch_register_name (gdbarch, regnum),
paddress (gdbarch, fs.pc)); paddress (gdbarch, fs.pc));
@ -2144,22 +2144,21 @@ decode_frame_entry (struct comp_unit *unit, const gdb_byte *start,
break; break;
case ALIGN4: case ALIGN4:
complaint (&symfile_complaints, _("\ complaint (_("\
Corrupt data in %s:%s; align 4 workaround apparently succeeded"), Corrupt data in %s:%s; align 4 workaround apparently succeeded"),
unit->dwarf_frame_section->owner->filename, unit->dwarf_frame_section->owner->filename,
unit->dwarf_frame_section->name); unit->dwarf_frame_section->name);
break; break;
case ALIGN8: case ALIGN8:
complaint (&symfile_complaints, _("\ complaint (_("\
Corrupt data in %s:%s; align 8 workaround apparently succeeded"), Corrupt data in %s:%s; align 8 workaround apparently succeeded"),
unit->dwarf_frame_section->owner->filename, unit->dwarf_frame_section->owner->filename,
unit->dwarf_frame_section->name); unit->dwarf_frame_section->name);
break; break;
default: default:
complaint (&symfile_complaints, complaint (_("Corrupt data in %s:%s"),
_("Corrupt data in %s:%s"),
unit->dwarf_frame_section->owner->filename, unit->dwarf_frame_section->owner->filename,
unit->dwarf_frame_section->name); unit->dwarf_frame_section->name);
break; break;

View file

@ -2892,8 +2892,7 @@ dwarf_reg_to_regnum (struct gdbarch *arch, int dwarf_reg)
if (reg == -1) if (reg == -1)
{ {
complaint (&symfile_complaints, complaint (_("bad DWARF register number %d"), dwarf_reg);
_("bad DWARF register number %d"), dwarf_reg);
} }
return reg; return reg;
} }

File diff suppressed because it is too large Load diff

View file

@ -1887,7 +1887,7 @@ get_vptr_fieldno (struct type *type, struct type **basetypep)
static void static void
stub_noname_complaint (void) stub_noname_complaint (void)
{ {
complaint (&symfile_complaints, _("stub type has NULL name")); complaint (_("stub type has NULL name"));
} }
/* Return nonzero if TYPE has a DYN_PROP_BYTE_STRIDE dynamic property /* Return nonzero if TYPE has a DYN_PROP_BYTE_STRIDE dynamic property

View file

@ -191,8 +191,7 @@ macho_symtab_read (minimal_symbol_reader &reader,
if (sym->name == NULL || sym->name[0] == 0) if (sym->name == NULL || sym->name[0] == 0)
{ {
/* Unexpected empty N_SO. */ /* Unexpected empty N_SO. */
complaint (&symfile_complaints, complaint (_("Unexpected empty N_SO stab"));
_("Unexpected empty N_SO stab"));
} }
else else
{ {
@ -209,8 +208,7 @@ macho_symtab_read (minimal_symbol_reader &reader,
} }
/* Debugging symbols are not expected here. */ /* Debugging symbols are not expected here. */
complaint (&symfile_complaints, complaint (_("%s: Unexpected debug stab outside SO markers"),
_("%s: Unexpected debug stab outside SO markers"),
objfile_name (objfile)); objfile_name (objfile));
} }
else else
@ -227,7 +225,7 @@ macho_symtab_read (minimal_symbol_reader &reader,
if (sym->name == NULL || sym->name[0] == 0) if (sym->name == NULL || sym->name[0] == 0)
{ {
/* Unexpected empty N_SO. */ /* Unexpected empty N_SO. */
complaint (&symfile_complaints, _("Empty SO section")); complaint (_("Empty SO section"));
state = S_NO_SO; state = S_NO_SO;
} }
else if (state == S_FIRST_SO) else if (state == S_FIRST_SO)
@ -237,7 +235,7 @@ macho_symtab_read (minimal_symbol_reader &reader,
state = S_SECOND_SO; state = S_SECOND_SO;
} }
else else
complaint (&symfile_complaints, _("Three SO in a raw")); complaint (_("Three SO in a raw"));
} }
else if (mach_o_sym->n_type == N_OSO) else if (mach_o_sym->n_type == N_OSO)
{ {
@ -258,8 +256,7 @@ macho_symtab_read (minimal_symbol_reader &reader,
} }
} }
else else
complaint (&symfile_complaints, complaint (_("Unexpected stab after SO"));
_("Unexpected stab after SO"));
break; break;
case S_STAB_FILE: case S_STAB_FILE:
@ -276,7 +273,7 @@ macho_symtab_read (minimal_symbol_reader &reader,
} }
else else
{ {
complaint (&symfile_complaints, _("Missing nul SO")); complaint (_("Missing nul SO"));
file_so = sym; file_so = sym;
state = S_FIRST_SO; state = S_FIRST_SO;
} }
@ -304,21 +301,19 @@ macho_symtab_read (minimal_symbol_reader &reader,
case N_GSYM: case N_GSYM:
break; break;
default: default:
complaint (&symfile_complaints, complaint (_("unhandled stab for dwarf OSO file"));
_("unhandled stab for dwarf OSO file"));
break; break;
} }
} }
} }
else else
complaint (&symfile_complaints, complaint (_("non-debugging symbol within SO"));
_("non-debugging symbol within SO"));
break; break;
} }
} }
if (state != S_NO_SO) if (state != S_NO_SO)
complaint (&symfile_complaints, _("missing nul SO")); complaint (_("missing nul SO"));
} }
/* If NAME describes an archive member (ie: ARCHIVE '(' MEMBER ')'), /* If NAME describes an archive member (ie: ARCHIVE '(' MEMBER ')'),
@ -496,8 +491,7 @@ macho_add_oso_symfile (oso_el *oso, const gdb_bfd_ref_ptr &abfd,
ent = (struct macho_sym_hash_entry *) ent = (struct macho_sym_hash_entry *)
bfd_hash_lookup (&table, sym->name, TRUE, FALSE); bfd_hash_lookup (&table, sym->name, TRUE, FALSE);
if (ent->sym != NULL) if (ent->sym != NULL)
complaint (&symfile_complaints, complaint (_("Duplicated symbol %s in symbol table"), sym->name);
_("Duplicated symbol %s in symbol table"), sym->name);
else else
{ {
if (mach_o_debug_level > 4) if (mach_o_debug_level > 4)

View file

@ -76,8 +76,7 @@ sal_macro_scope (struct symtab_and_line sal)
ms->file = main_file; ms->file = main_file;
ms->line = -1; ms->line = -1;
complaint (&symfile_complaints, complaint (_("symtab found for `%s', but that file\n"
_("symtab found for `%s', but that file\n"
"is not covered in the compilation unit's macro information"), "is not covered in the compilation unit's macro information"),
symtab_to_filename_for_display (sal.symtab)); symtab_to_filename_for_display (sal.symtab));
} }

View file

@ -478,8 +478,7 @@ macro_include (struct macro_source_file *source,
link_fullname = macro_source_fullname (*link); link_fullname = macro_source_fullname (*link);
source_fullname = macro_source_fullname (source); source_fullname = macro_source_fullname (source);
complaint (&symfile_complaints, complaint (_("both `%s' and `%s' allegedly #included at %s:%d"),
_("both `%s' and `%s' allegedly #included at %s:%d"),
included, link_fullname, source_fullname, line); included, link_fullname, source_fullname, line);
xfree (source_fullname); xfree (source_fullname);
xfree (link_fullname); xfree (link_fullname);
@ -730,8 +729,7 @@ check_for_redefinition (struct macro_source_file *source, int line,
source_fullname = macro_source_fullname (source); source_fullname = macro_source_fullname (source);
found_key_fullname = macro_source_fullname (found_key->start_file); found_key_fullname = macro_source_fullname (found_key->start_file);
complaint (&symfile_complaints, complaint (_("macro `%s' redefined at %s:%d; "
_("macro `%s' redefined at %s:%d; "
"original definition at %s:%d"), "original definition at %s:%d"),
name, source_fullname, line, found_key_fullname, name, source_fullname, line, found_key_fullname,
found_key->start_line); found_key->start_line);
@ -859,8 +857,7 @@ macro_undef (struct macro_source_file *source, int line,
source_fullname = macro_source_fullname (source); source_fullname = macro_source_fullname (source);
key_fullname = macro_source_fullname (key->end_file); key_fullname = macro_source_fullname (key->end_file);
complaint (&symfile_complaints, complaint (_("macro '%s' is #undefined twice,"
_("macro '%s' is #undefined twice,"
" at %s:%d and %s:%d"), " at %s:%d and %s:%d"),
name, source_fullname, line, key_fullname, name, source_fullname, line, key_fullname,
key->end_line); key->end_line);
@ -880,8 +877,7 @@ macro_undef (struct macro_source_file *source, int line,
has no macro definition in scope is ignored. So we should has no macro definition in scope is ignored. So we should
ignore it too. */ ignore it too. */
#if 0 #if 0
complaint (&symfile_complaints, complaint (_("no definition for macro `%s' in scope to #undef at %s:%d"),
_("no definition for macro `%s' in scope to #undef at %s:%d"),
name, source->filename, line); name, source->filename, line);
#endif #endif
} }

View file

@ -125,40 +125,39 @@ struct symloc
static void static void
index_complaint (const char *arg1) index_complaint (const char *arg1)
{ {
complaint (&symfile_complaints, _("bad aux index at symbol %s"), arg1); complaint (_("bad aux index at symbol %s"), arg1);
} }
static void static void
unknown_ext_complaint (const char *arg1) unknown_ext_complaint (const char *arg1)
{ {
complaint (&symfile_complaints, _("unknown external symbol %s"), arg1); complaint (_("unknown external symbol %s"), arg1);
} }
static void static void
basic_type_complaint (int arg1, const char *arg2) basic_type_complaint (int arg1, const char *arg2)
{ {
complaint (&symfile_complaints, _("cannot map ECOFF basic type 0x%x for %s"), complaint (_("cannot map ECOFF basic type 0x%x for %s"),
arg1, arg2); arg1, arg2);
} }
static void static void
bad_tag_guess_complaint (const char *arg1) bad_tag_guess_complaint (const char *arg1)
{ {
complaint (&symfile_complaints, complaint (_("guessed tag type of %s incorrectly"), arg1);
_("guessed tag type of %s incorrectly"), arg1);
} }
static void static void
bad_rfd_entry_complaint (const char *arg1, int arg2, int arg3) bad_rfd_entry_complaint (const char *arg1, int arg2, int arg3)
{ {
complaint (&symfile_complaints, _("bad rfd entry for %s: file %d, index %d"), complaint (_("bad rfd entry for %s: file %d, index %d"),
arg1, arg2, arg3); arg1, arg2, arg3);
} }
static void static void
unexpected_type_code_complaint (const char *arg1) unexpected_type_code_complaint (const char *arg1)
{ {
complaint (&symfile_complaints, _("unexpected type code for %s"), arg1); complaint (_("unexpected type code for %s"), arg1);
} }
/* Macros and extra defs. */ /* Macros and extra defs. */
@ -521,8 +520,7 @@ add_pending (FDR *fh, char *sh, struct type *t)
static void static void
reg_value_complaint (int regnum, int num_regs, const char *sym) reg_value_complaint (int regnum, int num_regs, const char *sym)
{ {
complaint (&symfile_complaints, complaint (_("bad register number %d (max %d) in symbol %s"),
_("bad register number %d (max %d) in symbol %s"),
regnum, num_regs - 1, sym); regnum, num_regs - 1, sym);
} }
@ -747,8 +745,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
keep_counting = 0; keep_counting = 0;
break; break;
default: default:
complaint (&symfile_complaints, complaint (_("unknown symbol type 0x%x"), sh->st);
_("unknown symbol type 0x%x"), sh->st);
break; break;
} }
} }
@ -965,8 +962,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
break; break;
default: default:
complaint (&symfile_complaints, complaint (_("declaration block contains "
_("declaration block contains "
"unhandled symbol type %d"), "unhandled symbol type %d"),
tsym.st); tsym.st);
} }
@ -1245,8 +1241,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
; ;
} }
else else
complaint (&symfile_complaints, complaint (_("stEnd with storage class %d not handled"), sh->sc);
_("stEnd with storage class %d not handled"), sh->sc);
pop_parse_stack (); /* Restore previous lexical context. */ pop_parse_stack (); /* Restore previous lexical context. */
break; break;
@ -1358,7 +1353,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
case stConstant: case stConstant:
break; /* constant */ break; /* constant */
default: default:
complaint (&symfile_complaints, _("unknown symbol type 0x%x"), sh->st); complaint (_("unknown symbol type 0x%x"), sh->st);
break; break;
} }
@ -1599,8 +1594,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
else if (t->bt == btEnum) else if (t->bt == btEnum)
; ;
else else
complaint (&symfile_complaints, complaint (_("can't handle TIR fBitfield for %s"),
_("can't handle TIR fBitfield for %s"),
sym_name); sym_name);
} }
else else
@ -1629,8 +1623,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
if (rf == -1) if (rf == -1)
{ {
complaint (&symfile_complaints, complaint (_("unable to cross ref btIndirect for %s"), sym_name);
_("unable to cross ref btIndirect for %s"), sym_name);
return basic_type (btInt, mdebugread_objfile); return basic_type (btInt, mdebugread_objfile);
} }
xref_fh = get_rfd (fd, rf); xref_fh = get_rfd (fd, rf);
@ -1749,8 +1742,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name); ax += cross_ref (fd, ax, &tp, type_code, &name, bigend, sym_name);
if (tp == (struct type *) NULL) if (tp == (struct type *) NULL)
{ {
complaint (&symfile_complaints, complaint (_("unable to cross ref btTypedef for %s"), sym_name);
_("unable to cross ref btTypedef for %s"), sym_name);
tp = basic_type (btInt, mdebugread_objfile); tp = basic_type (btInt, mdebugread_objfile);
} }
} }
@ -1796,8 +1788,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
/* Complain for illegal continuations due to corrupt aux entries. */ /* Complain for illegal continuations due to corrupt aux entries. */
if (t->continued) if (t->continued)
complaint (&symfile_complaints, complaint (_("illegal TIR continued for %s"), sym_name);
_("illegal TIR continued for %s"), sym_name);
return tp; return tp;
} }
@ -1859,8 +1850,7 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
else due to corrupt aux entries. */ else due to corrupt aux entries. */
if (TYPE_CODE (indx) != TYPE_CODE_INT) if (TYPE_CODE (indx) != TYPE_CODE_INT)
{ {
complaint (&symfile_complaints, complaint (_("illegal array index type for %s, assuming int"),
_("illegal array index type for %s, assuming int"),
sym_name); sym_name);
indx = objfile_type (mdebugread_objfile)->builtin_int; indx = objfile_type (mdebugread_objfile)->builtin_int;
} }
@ -1908,7 +1898,7 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
return 0; return 0;
default: default:
complaint (&symfile_complaints, _("unknown type qualifier 0x%x"), tq); complaint (_("unknown type qualifier 0x%x"), tq);
return 0; return 0;
} }
} }
@ -1940,8 +1930,7 @@ parse_procedure (PDR *pr, struct compunit_symtab *search_symtab,
{ {
/* Static procedure at address pr->adr. Sigh. */ /* Static procedure at address pr->adr. Sigh. */
/* FIXME-32x64. assuming pr->adr fits in long. */ /* FIXME-32x64. assuming pr->adr fits in long. */
complaint (&symfile_complaints, complaint (_("can't handle PDR for static proc at 0x%lx"),
_("can't handle PDR for static proc at 0x%lx"),
(unsigned long) pr->adr); (unsigned long) pr->adr);
return; return;
} }
@ -2004,7 +1993,7 @@ parse_procedure (PDR *pr, struct compunit_symtab *search_symtab,
} }
else else
{ {
complaint (&symfile_complaints, _("PDR for %s, but no symbol"), sh_name); complaint (_("PDR for %s, but no symbol"), sh_name);
#if 1 #if 1
return; return;
#else #else
@ -2230,8 +2219,7 @@ parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines,
with corrupt binaries. */ with corrupt binaries. */
if (lt->nitems >= maxlines) if (lt->nitems >= maxlines)
{ {
complaint (&symfile_complaints, complaint (_("guessed size of linetable for %s incorrectly"),
_("guessed size of linetable for %s incorrectly"),
fdr_name (fh)); fdr_name (fh));
break; break;
} }
@ -2244,8 +2232,7 @@ parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines,
static void static void
function_outside_compilation_unit_complaint (const char *arg1) function_outside_compilation_unit_complaint (const char *arg1)
{ {
complaint (&symfile_complaints, complaint (_("function `%s' appears to be defined "
_("function `%s' appears to be defined "
"outside of all compilation units"), "outside of all compilation units"),
arg1); arg1);
} }
@ -2486,15 +2473,13 @@ parse_partial_symbols (minimal_symbol_reader &reader,
external symbols. */ external symbols. */
if (ext_in->ifd < -1 || ext_in->ifd >= hdr->ifdMax) if (ext_in->ifd < -1 || ext_in->ifd >= hdr->ifdMax)
{ {
complaint (&symfile_complaints, complaint (_("bad ifd for external symbol: %d (max %ld)"),
_("bad ifd for external symbol: %d (max %ld)"),
ext_in->ifd, hdr->ifdMax); ext_in->ifd, hdr->ifdMax);
continue; continue;
} }
if (ext_in->asym.iss < 0 || ext_in->asym.iss >= hdr->issExtMax) if (ext_in->asym.iss < 0 || ext_in->asym.iss >= hdr->issExtMax)
{ {
complaint (&symfile_complaints, complaint (_("bad iss for external symbol: %ld (max %ld)"),
_("bad iss for external symbol: %ld (max %ld)"),
ext_in->asym.iss, hdr->issExtMax); ext_in->asym.iss, hdr->issExtMax);
continue; continue;
} }
@ -3312,8 +3297,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
searching to the end of every string looking for searching to the end of every string looking for
a backslash. */ a backslash. */
complaint (&symfile_complaints, complaint (_("unknown symbol descriptor `%c'"), p[1]);
_("unknown symbol descriptor `%c'"), p[1]);
/* Ignore it; perhaps it is an extension that we don't /* Ignore it; perhaps it is an extension that we don't
know about. */ know about. */
@ -3377,8 +3361,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
default: default:
/* If we haven't found it yet, ignore it. It's /* If we haven't found it yet, ignore it. It's
probably some new type we don't know about yet. */ probably some new type we don't know about yet. */
complaint (&symfile_complaints, complaint (_("unknown symbol type %s"),
_("unknown symbol type %s"),
hex_string (type_code)); /* CUR_SYMBOL_TYPE */ hex_string (type_code)); /* CUR_SYMBOL_TYPE */
continue; continue;
} }
@ -3479,8 +3462,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
if (new_sdx <= cur_sdx) if (new_sdx <= cur_sdx)
{ {
/* This should not happen either... FIXME. */ /* This should not happen either... FIXME. */
complaint (&symfile_complaints, complaint (_("bad proc end in aux found from symbol %s"),
_("bad proc end in aux found from symbol %s"),
name); name);
new_sdx = cur_sdx + 1; /* Don't skip backward. */ new_sdx = cur_sdx + 1; /* Don't skip backward. */
} }
@ -3589,8 +3571,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
if (new_sdx <= cur_sdx) if (new_sdx <= cur_sdx)
{ {
/* This happens with the Ultrix kernel. */ /* This happens with the Ultrix kernel. */
complaint (&symfile_complaints, complaint (_("bad aux index at block symbol %s"), name);
_("bad aux index at block symbol %s"), name);
new_sdx = cur_sdx + 1; /* Don't skip backward. */ new_sdx = cur_sdx + 1; /* Don't skip backward. */
} }
cur_sdx = new_sdx; cur_sdx = new_sdx;
@ -3610,9 +3591,9 @@ parse_partial_symbols (minimal_symbol_reader &reader,
default: default:
/* Both complaints are valid: one gives symbol name, /* Both complaints are valid: one gives symbol name,
the other the offending symbol type. */ the other the offending symbol type. */
complaint (&symfile_complaints, _("unknown local symbol %s"), complaint (_("unknown local symbol %s"),
name); name);
complaint (&symfile_complaints, _("with type %d"), sh.st); complaint (_("with type %d"), sh.st);
cur_sdx++; cur_sdx++;
continue; continue;
} }
@ -3774,7 +3755,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
&rh); &rh);
if (rh < 0 || rh >= hdr->ifdMax) if (rh < 0 || rh >= hdr->ifdMax)
{ {
complaint (&symfile_complaints, _("bad file number %ld"), rh); complaint (_("bad file number %ld"), rh);
continue; continue;
} }
@ -4084,8 +4065,7 @@ psymtab_to_symtab_1 (struct objfile *objfile,
/* These are generated by gcc-2.x, do not complain. */ /* These are generated by gcc-2.x, do not complain. */
; ;
else else
complaint (&symfile_complaints, complaint (_("unknown stabs symbol %s"), name);
_("unknown stabs symbol %s"), name);
} }
if (! last_symtab_ended) if (! last_symtab_ended)
@ -4444,8 +4424,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp,
+ fh->iauxBase + sh.index)->a_ti, + fh->iauxBase + sh.index)->a_ti,
&tir); &tir);
if (tir.tq0 != tqNil) if (tir.tq0 != tqNil)
complaint (&symfile_complaints, complaint (_("illegal tq0 in forward typedef for %s"), sym_name);
_("illegal tq0 in forward typedef for %s"), sym_name);
switch (tir.bt) switch (tir.bt)
{ {
case btVoid: case btVoid:
@ -4481,8 +4460,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp,
break; break;
default: default:
complaint (&symfile_complaints, complaint (_("illegal bt %d in forward typedef for %s"), tir.bt,
_("illegal bt %d in forward typedef for %s"), tir.bt,
sym_name); sym_name);
*tpp = init_type (mdebugread_objfile, type_code, 0, NULL); *tpp = init_type (mdebugread_objfile, type_code, 0, NULL);
break; break;

View file

@ -124,8 +124,7 @@ lookup_objc_class (struct gdbarch *gdbarch, const char *classname)
function = find_function_in_inferior("objc_lookup_class", NULL); function = find_function_in_inferior("objc_lookup_class", NULL);
else else
{ {
complaint (&symfile_complaints, complaint (_("no way to lookup Objective-C classes"));
_("no way to lookup Objective-C classes"));
return 0; return 0;
} }
@ -154,8 +153,7 @@ lookup_child_selector (struct gdbarch *gdbarch, const char *selname)
function = find_function_in_inferior("sel_get_any_uid", NULL); function = find_function_in_inferior("sel_get_any_uid", NULL);
else else
{ {
complaint (&symfile_complaints, complaint (_("no way to lookup Objective-C selectors"));
_("no way to lookup Objective-C selectors"));
return 0; return 0;
} }
@ -626,8 +624,7 @@ info_selectors_command (const char *regexp, int from_tty)
name = (char *) strchr (name+2, ' '); name = (char *) strchr (name+2, ' ');
if (name == NULL) if (name == NULL)
{ {
complaint (&symfile_complaints, complaint (_("Bad method name '%s'"),
_("Bad method name '%s'"),
MSYMBOL_NATURAL_NAME (msymbol)); MSYMBOL_NATURAL_NAME (msymbol));
continue; continue;
} }

View file

@ -1284,8 +1284,7 @@ filter_overlapping_sections (struct obj_section **map, int map_size)
struct gdbarch *const gdbarch = get_objfile_arch (objf1); struct gdbarch *const gdbarch = get_objfile_arch (objf1);
complaint (&symfile_complaints, complaint (_("unexpected overlap between:\n"
_("unexpected overlap between:\n"
" (A) section `%s' from `%s' [%s, %s)\n" " (A) section `%s' from `%s' [%s, %s)\n"
" (B) section `%s' from `%s' [%s, %s).\n" " (B) section `%s' from `%s' [%s, %s).\n"
"Will ignore section B"), "Will ignore section B"),

View file

@ -164,21 +164,20 @@ static const char vb_name[] = "_vb$";
static void static void
invalid_cpp_abbrev_complaint (const char *arg1) invalid_cpp_abbrev_complaint (const char *arg1)
{ {
complaint (&symfile_complaints, _("invalid C++ abbreviation `%s'"), arg1); complaint (_("invalid C++ abbreviation `%s'"), arg1);
} }
static void static void
reg_value_complaint (int regnum, int num_regs, const char *sym) reg_value_complaint (int regnum, int num_regs, const char *sym)
{ {
complaint (&symfile_complaints, complaint (_("bad register number %d (max %d) in symbol %s"),
_("bad register number %d (max %d) in symbol %s"),
regnum, num_regs - 1, sym); regnum, num_regs - 1, sym);
} }
static void static void
stabs_general_complaint (const char *arg1) stabs_general_complaint (const char *arg1)
{ {
complaint (&symfile_complaints, "%s", arg1); complaint ("%s", arg1);
} }
/* Make a list of forward references which haven't been defined. */ /* Make a list of forward references which haven't been defined. */
@ -249,8 +248,7 @@ dbx_lookup_type (int typenums[2], struct objfile *objfile)
if (filenum < 0 || filenum >= n_this_object_header_files) if (filenum < 0 || filenum >= n_this_object_header_files)
{ {
complaint (&symfile_complaints, complaint (_("Invalid symbol data: type number "
_("Invalid symbol data: type number "
"(%d,%d) out of range at symtab pos %d."), "(%d,%d) out of range at symtab pos %d."),
filenum, index, symnum); filenum, index, symnum);
goto error_return; goto error_return;
@ -673,7 +671,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
p = strchr (p, ':'); p = strchr (p, ':');
if (p == NULL) if (p == NULL)
{ {
complaint (&symfile_complaints, complaint (
_("Bad stabs string '%s'"), string); _("Bad stabs string '%s'"), string);
return NULL; return NULL;
} }
@ -726,7 +724,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
/* fall through */ /* fall through */
default: default:
complaint (&symfile_complaints, _("Unknown C++ symbol name `%s'"), complaint (_("Unknown C++ symbol name `%s'"),
string); string);
goto normal; /* Do *something* with it. */ goto normal; /* Do *something* with it. */
} }
@ -1490,8 +1488,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
static struct type * static struct type *
error_type (const char **pp, struct objfile *objfile) error_type (const char **pp, struct objfile *objfile)
{ {
complaint (&symfile_complaints, complaint (_("couldn't parse type; debugger out of date?"));
_("couldn't parse type; debugger out of date?"));
while (1) while (1)
{ {
/* Skip to end of symbol. */ /* Skip to end of symbol. */
@ -1611,8 +1608,7 @@ again:
{ {
/* Complain and keep going, so compilers can invent new /* Complain and keep going, so compilers can invent new
cross-reference types. */ cross-reference types. */
complaint (&symfile_complaints, complaint (_("Unrecognized cross-reference type `%c'"),
_("Unrecognized cross-reference type `%c'"),
(*pp)[0]); (*pp)[0]);
code = TYPE_CODE_STRUCT; code = TYPE_CODE_STRUCT;
break; break;
@ -1842,8 +1838,7 @@ again:
++*pp; ++*pp;
else else
{ {
complaint (&symfile_complaints, complaint (_("Prototyped function type didn't "
_("Prototyped function type didn't "
"end arguments with `#':\n%s"), "end arguments with `#':\n%s"),
type_start); type_start);
} }
@ -1955,8 +1950,7 @@ again:
(*pp)++; (*pp)++;
return_type = read_type (pp, objfile); return_type = read_type (pp, objfile);
if (*(*pp)++ != ';') if (*(*pp)++ != ';')
complaint (&symfile_complaints, complaint (_("invalid (minimal) member type "
_("invalid (minimal) member type "
"data format at symtab pos %d."), "data format at symtab pos %d."),
symnum); symnum);
type = allocate_stub_method (return_type); type = allocate_stub_method (return_type);
@ -2088,7 +2082,7 @@ rs6000_builtin_type (int typenum, struct objfile *objfile)
if (typenum >= 0 || typenum < -NUMBER_RECOGNIZED) if (typenum >= 0 || typenum < -NUMBER_RECOGNIZED)
{ {
complaint (&symfile_complaints, _("Unknown builtin type %d"), typenum); complaint (_("Unknown builtin type %d"), typenum);
return objfile_type (objfile)->builtin_error; return objfile_type (objfile)->builtin_error;
} }
@ -2254,8 +2248,7 @@ stabs_method_name_from_physname (const char *physname)
if (method_name == NULL) if (method_name == NULL)
{ {
complaint (&symfile_complaints, complaint (_("Method has bad physname %s\n"), physname);
_("Method has bad physname %s\n"), physname);
return NULL; return NULL;
} }
@ -2446,8 +2439,7 @@ read_member_functions (struct field_info *fip, const char **pp,
case '.': case '.':
break; break;
default: default:
complaint (&symfile_complaints, complaint (_("const/volatile indicator missing, got '%c'"),
_("const/volatile indicator missing, got '%c'"),
**pp); **pp);
break; break;
} }
@ -2530,8 +2522,7 @@ read_member_functions (struct field_info *fip, const char **pp,
default: default:
/* error */ /* error */
complaint (&symfile_complaints, complaint (_("member function type missing, got '%c'"),
_("member function type missing, got '%c'"),
(*pp)[-1]); (*pp)[-1]);
/* Normal member function. */ /* Normal member function. */
/* Fall through. */ /* Fall through. */
@ -2805,8 +2796,7 @@ read_cpp_abbrev (struct field_info *fip, const char **pp, struct type *type,
name = type_name_no_tag (context); name = type_name_no_tag (context);
if (name == NULL) if (name == NULL)
{ {
complaint (&symfile_complaints, complaint (_("C++ abbreviated type name "
_("C++ abbreviated type name "
"unknown at symtab pos %d"), "unknown at symtab pos %d"),
symnum); symnum);
name = "FOO"; name = "FOO";
@ -3167,8 +3157,7 @@ read_baseclasses (struct field_info *fip, const char **pp, struct type *type,
default: default:
/* Unknown character. Complain and treat it as non-virtual. */ /* Unknown character. Complain and treat it as non-virtual. */
{ {
complaint (&symfile_complaints, complaint (_("Unknown virtual character `%c' for baseclass"),
_("Unknown virtual character `%c' for baseclass"),
**pp); **pp);
} }
} }
@ -3185,8 +3174,7 @@ read_baseclasses (struct field_info *fip, const char **pp, struct type *type,
/* Bad visibility format. Complain and treat it as /* Bad visibility format. Complain and treat it as
public. */ public. */
{ {
complaint (&symfile_complaints, complaint (_("Unknown visibility `%c' for baseclass"),
_("Unknown visibility `%c' for baseclass"),
newobj->visibility); newobj->visibility);
newobj->visibility = VISIBILITY_PUBLIC; newobj->visibility = VISIBILITY_PUBLIC;
} }
@ -3294,8 +3282,7 @@ read_tilde_fields (struct field_info *fip, const char **pp, struct type *type,
} }
} }
/* Virtual function table field not found. */ /* Virtual function table field not found. */
complaint (&symfile_complaints, complaint (_("virtual function table pointer "
_("virtual function table pointer "
"not found when defining class `%s'"), "not found when defining class `%s'"),
TYPE_NAME (type)); TYPE_NAME (type));
return 0; return 0;
@ -3407,8 +3394,7 @@ attach_fields_to_type (struct field_info *fip, struct type *type,
default: default:
/* Unknown visibility. Complain and treat it as public. */ /* Unknown visibility. Complain and treat it as public. */
{ {
complaint (&symfile_complaints, complaint (_("Unknown visibility `%c' for field"),
_("Unknown visibility `%c' for field"),
fip->list->visibility); fip->list->visibility);
} }
break; break;
@ -3449,8 +3435,7 @@ complain_about_struct_wipeout (struct type *type)
kind = ""; kind = "";
} }
complaint (&symfile_complaints, complaint (_("struct/union type gets multiply defined: %s%s"), kind, name);
_("struct/union type gets multiply defined: %s%s"), kind, name);
} }
/* Set the length for all variants of a same main_type, which are /* Set the length for all variants of a same main_type, which are
@ -4251,8 +4236,7 @@ handle_true_range:
/* Does this actually ever happen? Is that why we are worrying /* Does this actually ever happen? Is that why we are worrying
about dealing with it rather than just calling error_type? */ about dealing with it rather than just calling error_type? */
complaint (&symfile_complaints, complaint (_("base type %d of range type is not defined"), rangenums[1]);
_("base type %d of range type is not defined"), rangenums[1]);
index_type = objfile_type (objfile)->builtin_int; index_type = objfile_type (objfile)->builtin_int;
} }
@ -4293,7 +4277,7 @@ read_args (const char **pp, int end, struct objfile *objfile, int *nargsp,
have been present ";-16,(0,43)" reference instead. This way the have been present ";-16,(0,43)" reference instead. This way the
excessive ";" marker prematurely stops the parameters parsing. */ excessive ";" marker prematurely stops the parameters parsing. */
complaint (&symfile_complaints, _("Invalid (empty) method arguments")); complaint (_("Invalid (empty) method arguments"));
*varargsp = 0; *varargsp = 0;
} }
else if (TYPE_CODE (types[n - 1]) != TYPE_CODE_VOID) else if (TYPE_CODE (types[n - 1]) != TYPE_CODE_VOID)
@ -4335,8 +4319,7 @@ common_block_start (const char *name, struct objfile *objfile)
{ {
if (common_block_name != NULL) if (common_block_name != NULL)
{ {
complaint (&symfile_complaints, complaint (_("Invalid symbol data: common block within common block"));
_("Invalid symbol data: common block within common block"));
} }
common_block = local_symbols; common_block = local_symbols;
common_block_i = local_symbols ? local_symbols->nsyms : 0; common_block_i = local_symbols ? local_symbols->nsyms : 0;
@ -4362,7 +4345,7 @@ common_block_end (struct objfile *objfile)
if (common_block_name == NULL) if (common_block_name == NULL)
{ {
complaint (&symfile_complaints, _("ECOMM symbol unmatched by BCOMM")); complaint (_("ECOMM symbol unmatched by BCOMM"));
return; return;
} }
@ -4564,7 +4547,7 @@ cleanup_undefined_types_1 (void)
if (type_name == NULL) if (type_name == NULL)
{ {
complaint (&symfile_complaints, _("need a type name")); complaint (_("need a type name"));
break; break;
} }
for (ppt = file_symbols; ppt; ppt = ppt->next) for (ppt = file_symbols; ppt; ppt = ppt->next)
@ -4590,8 +4573,7 @@ cleanup_undefined_types_1 (void)
default: default:
{ {
complaint (&symfile_complaints, complaint (_("forward-referenced types left unresolved, "
_("forward-referenced types left unresolved, "
"type code %d."), "type code %d."),
TYPE_CODE (*type)); TYPE_CODE (*type));
} }
@ -4742,8 +4724,7 @@ scan_file_globals (struct objfile *objfile)
if (SYMBOL_CLASS (prev) == LOC_STATIC) if (SYMBOL_CLASS (prev) == LOC_STATIC)
SYMBOL_ACLASS_INDEX (prev) = LOC_UNRESOLVED; SYMBOL_ACLASS_INDEX (prev) = LOC_UNRESOLVED;
else else
complaint (&symfile_complaints, complaint (_("%s: common block `%s' from "
_("%s: common block `%s' from "
"global_sym_chain unresolved"), "global_sym_chain unresolved"),
objfile_name (objfile), SYMBOL_PRINT_NAME (prev)); objfile_name (objfile), SYMBOL_PRINT_NAME (prev));
} }

View file

@ -1512,7 +1512,7 @@ handle_stap_probe (struct objfile *objfile, struct sdt_note *el,
/* Making sure there is a name. */ /* Making sure there is a name. */
if (name == NULL) if (name == NULL)
{ {
complaint (&symfile_complaints, _("corrupt probe name when " complaint (_("corrupt probe name when "
"reading `%s'"), "reading `%s'"),
objfile_name (objfile)); objfile_name (objfile));
@ -1549,7 +1549,7 @@ handle_stap_probe (struct objfile *objfile, struct sdt_note *el,
|| (memchr (probe_args, '\0', (char *) el->data + el->size - name) || (memchr (probe_args, '\0', (char *) el->data + el->size - name)
!= el->data + el->size - 1)) != el->data + el->size - 1))
{ {
complaint (&symfile_complaints, _("corrupt probe argument when " complaint (_("corrupt probe argument when "
"reading `%s'"), "reading `%s'"),
objfile_name (objfile)); objfile_name (objfile));
/* If the argument string is NULL, it means some problem happened with /* If the argument string is NULL, it means some problem happened with
@ -1590,7 +1590,7 @@ get_stap_base_address (bfd *obfd, bfd_vma *base)
if (ret == NULL) if (ret == NULL)
{ {
complaint (&symfile_complaints, _("could not obtain base address for " complaint (_("could not obtain base address for "
"SystemTap section on objfile `%s'."), "SystemTap section on objfile `%s'."),
obfd->filename); obfd->filename);
return 0; return 0;
@ -1660,7 +1660,7 @@ stap_static_probe_ops::get_probes (std::vector<probe *> *probesp,
{ {
/* If we are here, it means we have failed to parse every known /* If we are here, it means we have failed to parse every known
probe. */ probe. */
complaint (&symfile_complaints, _("could not parse SystemTap probe(s) " complaint (_("could not parse SystemTap probe(s) "
"from inferior")); "from inferior"));
return; return;
} }

View file

@ -986,7 +986,7 @@ syms_from_objfile_1 (struct objfile *objfile,
initial symbol reading for this file. */ initial symbol reading for this file. */
(*objfile->sf->sym_init) (objfile); (*objfile->sf->sym_init) (objfile);
clear_complaints (&symfile_complaints, 1); clear_complaints (1);
(*objfile->sf->sym_offsets) (objfile, *addrs); (*objfile->sf->sym_offsets) (objfile, *addrs);
@ -1033,7 +1033,7 @@ finish_new_objfile (struct objfile *objfile, symfile_add_flags add_flags)
} }
/* We're done reading the symbol file; finish off complaints. */ /* We're done reading the symbol file; finish off complaints. */
clear_complaints (&symfile_complaints, 0); clear_complaints (0);
} }
/* Process a symbol file, as either the main file or as a dynamically /* Process a symbol file, as either the main file or as a dynamically
@ -2457,7 +2457,7 @@ reread_symbols (void)
} }
(*objfile->sf->sym_init) (objfile); (*objfile->sf->sym_init) (objfile);
clear_complaints (&symfile_complaints, 1); clear_complaints (1);
objfile->flags &= ~OBJF_PSYMTABS_READ; objfile->flags &= ~OBJF_PSYMTABS_READ;
@ -2487,7 +2487,7 @@ reread_symbols (void)
} }
/* We're done reading the symbol file; finish off complaints. */ /* We're done reading the symbol file; finish off complaints. */
clear_complaints (&symfile_complaints, 0); clear_complaints (0);
/* Getting new symbols may change our opinion about what is /* Getting new symbols may change our opinion about what is
frameless. */ frameless. */

View file

@ -1,3 +1,11 @@
2018-05-23 Tom Tromey <tom@tromey.com>
* gdb.gdb/complaints.exp (test_initial_complaints): Don't mention
symfile_complaints.
(test_short_complaints): Likewise.
(test_empty_complaints): Likewise.
(test_initial_complaints): Update.
2018-05-23 Tom Tromey <tom@tromey.com> 2018-05-23 Tom Tromey <tom@tromey.com>
* gdb.gdb/complaints.exp (test_empty_complaints): Update. * gdb.gdb/complaints.exp (test_empty_complaints): Update.

View file

@ -59,27 +59,27 @@ proc test_initial_complaints { } {
# Prime the system # Prime the system
gdb_test_stdio \ gdb_test_stdio \
"call complaint_internal (&symfile_complaints, \"Register a complaint\")" \ "call complaint_internal (\"Register a complaint\")" \
"During symbol reading, Register a complaint." "During symbol reading, Register a complaint."
# Check that the complaint was inserted and where # Check that the complaint was inserted and where
gdb_test "print symfile_complaints->root->fmt" \ gdb_test "print symfile_complaint_book.root->fmt" \
".\[0-9\]+ =.*\"Register a complaint\"" ".\[0-9\]+ =.*\"Register a complaint\""
# Re-issue the first message #1 # Re-issue the first message #1
gdb_test_stdio \ gdb_test_stdio \
"call complaint_internal (&symfile_complaints, symfile_complaints->root->fmt)" \ "call complaint_internal (symfile_complaint_book.root->fmt)" \
"During symbol reading, Register a complaint." "During symbol reading, Register a complaint."
# Check that there is only one thing in the list. How the boolean # Check that there is only one thing in the list. How the boolean
# result is output depends on whether GDB is built as a C or C++ # result is output depends on whether GDB is built as a C or C++
# program. # program.
gdb_test "print symfile_complaints->root->next == &complaint_sentinel" \ gdb_test "print symfile_complaint_book.root->next == &complaint_sentinel" \
".\[0-9\]+ = \(1|true\)" "list has one entry" ".\[0-9\]+ = \(1|true\)" "list has one entry"
# Add a second complaint, expect it # Add a second complaint, expect it
gdb_test_stdio \ gdb_test_stdio \
"call complaint_internal (&symfile_complaints, \"Testing! Testing! Testing!\")" \ "call complaint_internal (\"Testing! Testing! Testing!\")" \
"During symbol reading, Testing. Testing. Testing.." "During symbol reading, Testing. Testing. Testing.."
return 0 return 0
@ -88,17 +88,17 @@ proc test_initial_complaints { } {
# For short complaints, all are the same # For short complaints, all are the same
proc test_short_complaints { } { proc test_short_complaints { } {
gdb_test_exact "call clear_complaints (&symfile_complaints, 1)" "" "short start" gdb_test_exact "call clear_complaints (1)" "" "short start"
# Prime the system # Prime the system
test_complaint \ test_complaint \
"call complaint_internal (&symfile_complaints, \"short line 1\")" \ "call complaint_internal (\"short line 1\")" \
"short line 1..." \ "short line 1..." \
"short line 1" "short line 1"
# Add a second complaint, expect it # Add a second complaint, expect it
test_complaint \ test_complaint \
"call complaint_internal (&symfile_complaints, \"short line 2\")" \ "call complaint_internal (\"short line 2\")" \
"short line 2..." \ "short line 2..." \
"short line 2" "short line 2"
@ -131,9 +131,9 @@ proc test_empty_complaint { cmd msg } {
proc test_empty_complaints { } { proc test_empty_complaints { } {
test_empty_complaint "call clear_complaints(&symfile_complaints,0)" \ test_empty_complaint "call clear_complaints(0)" \
"empty non-verbose clear" "empty non-verbose clear"
test_empty_complaint "call clear_complaints(&symfile_complaints,1)" \ test_empty_complaint "call clear_complaints(1)" \
"empty verbose clear" "empty verbose clear"
return 0 return 0

View file

@ -876,7 +876,7 @@ handle_unload_dll ()
4 mysterious UNLOAD_DLL_DEBUG_EVENTs during the startup phase (these 4 mysterious UNLOAD_DLL_DEBUG_EVENTs during the startup phase (these
events are apparently caused by the WOW layer, the interface between events are apparently caused by the WOW layer, the interface between
32bit and 64bit worlds). */ 32bit and 64bit worlds). */
complaint (&symfile_complaints, _("dll starting at %s not found."), complaint (_("dll starting at %s not found."),
host_address_to_string (lpBaseOfDll)); host_address_to_string (lpBaseOfDll));
} }

View file

@ -182,22 +182,19 @@ static const struct dwarf2_debug_sections dwarf2_xcoff_names = {
static void static void
bf_notfound_complaint (void) bf_notfound_complaint (void)
{ {
complaint (&symfile_complaints, complaint (_("line numbers off, `.bf' symbol not found"));
_("line numbers off, `.bf' symbol not found"));
} }
static void static void
ef_complaint (int arg1) ef_complaint (int arg1)
{ {
complaint (&symfile_complaints, complaint (_("Mismatched .ef symbol ignored starting at symnum %d"), arg1);
_("Mismatched .ef symbol ignored starting at symnum %d"), arg1);
} }
static void static void
eb_complaint (int arg1) eb_complaint (int arg1)
{ {
complaint (&symfile_complaints, complaint (_("Mismatched .eb symbol ignored starting at symnum %d"), arg1);
_("Mismatched .eb symbol ignored starting at symnum %d"), arg1);
} }
static void xcoff_initial_scan (struct objfile *, symfile_add_flags); static void xcoff_initial_scan (struct objfile *, symfile_add_flags);
@ -558,7 +555,7 @@ record_include_begin (struct coff_symbol *cs)
/* This can happen with old versions of GCC. /* This can happen with old versions of GCC.
GCC 2.3.3-930426 does not exhibit this on a test case which GCC 2.3.3-930426 does not exhibit this on a test case which
a user said produced the message for him. */ a user said produced the message for him. */
complaint (&symfile_complaints, _("Nested C_BINCL symbols")); complaint (_("Nested C_BINCL symbols"));
} }
++inclDepth; ++inclDepth;
@ -575,7 +572,7 @@ record_include_end (struct coff_symbol *cs)
if (inclDepth == 0) if (inclDepth == 0)
{ {
complaint (&symfile_complaints, _("Mismatched C_BINCL/C_EINCL pair")); complaint (_("Mismatched C_BINCL/C_EINCL pair"));
} }
allocate_include_entry (); allocate_include_entry ();
@ -856,8 +853,7 @@ enter_line_range (struct subfile *subfile, unsigned beginoffset,
{ {
if (endoffset >= limit_offset) if (endoffset >= limit_offset)
{ {
complaint (&symfile_complaints, complaint (_("Bad line table offset in C_EINCL directive"));
_("Bad line table offset in C_EINCL directive"));
return; return;
} }
limit_offset = endoffset; limit_offset = endoffset;
@ -978,7 +974,7 @@ xcoff_next_symbol_text (struct objfile *objfile)
bfd_coff_swap_sym_in (objfile->obfd, raw_symbol, &symbol); bfd_coff_swap_sym_in (objfile->obfd, raw_symbol, &symbol);
if (symbol.n_zeroes) if (symbol.n_zeroes)
{ {
complaint (&symfile_complaints, _("Unexpected symbol continuation")); complaint (_("Unexpected symbol continuation"));
/* Return something which points to '\0' and hope the symbol reading /* Return something which points to '\0' and hope the symbol reading
code does something reasonable. */ code does something reasonable. */
@ -992,7 +988,7 @@ xcoff_next_symbol_text (struct objfile *objfile)
} }
else else
{ {
complaint (&symfile_complaints, _("Unexpected symbol continuation")); complaint (_("Unexpected symbol continuation"));
/* Return something which points to '\0' and hope the symbol reading /* Return something which points to '\0' and hope the symbol reading
code does something reasonable. */ code does something reasonable. */
@ -1446,8 +1442,7 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
case C_UNTAG: case C_UNTAG:
case C_ENTAG: case C_ENTAG:
{ {
complaint (&symfile_complaints, complaint (_("Unrecognized storage class %d."),
_("Unrecognized storage class %d."),
cs->c_sclass); cs->c_sclass);
} }
break; break;
@ -1632,7 +1627,7 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
break; break;
default: default:
complaint (&symfile_complaints, _("Unexpected storage class: %d"), complaint (_("Unexpected storage class: %d"),
cs->c_sclass); cs->c_sclass);
/* FALLTHROUGH */ /* FALLTHROUGH */
@ -1717,7 +1712,7 @@ read_symbol (struct internal_syment *symbol, int symno)
if (symno < 0 || symno >= nsyms) if (symno < 0 || symno >= nsyms)
{ {
complaint (&symfile_complaints, _("Invalid symbol offset")); complaint (_("Invalid symbol offset"));
symbol->n_value = 0; symbol->n_value = 0;
symbol->n_scnum = -1; symbol->n_scnum = -1;
return; return;
@ -2192,8 +2187,7 @@ swap_sym (struct internal_syment *symbol, union internal_auxent *aux,
static void static void
function_outside_compilation_unit_complaint (const char *arg1) function_outside_compilation_unit_complaint (const char *arg1)
{ {
complaint (&symfile_complaints, complaint (_("function `%s' appears to be defined "
_("function `%s' appears to be defined "
"outside of all compilation units"), "outside of all compilation units"),
arg1); arg1);
} }
@ -2524,8 +2518,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
default: default:
{ {
complaint (&symfile_complaints, complaint (_("Storage class %d not recognized during scan"),
_("Storage class %d not recognized during scan"),
sclass); sclass);
} }
/* FALLTHROUGH */ /* FALLTHROUGH */
@ -2901,8 +2894,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
the end of every string looking for a the end of every string looking for a
backslash. */ backslash. */
complaint (&symfile_complaints, complaint (_("unknown symbol descriptor `%c'"), p[1]);
_("unknown symbol descriptor `%c'"), p[1]);
/* Ignore it; perhaps it is an extension that we don't /* Ignore it; perhaps it is an extension that we don't
know about. */ know about. */