diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/gdbarch.c | 160 | ||||
-rwxr-xr-x | gdb/gdbarch.sh | 25 |
3 files changed, 85 insertions, 106 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a571e1b..a764f40 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2001-11-05 Andrew Cagney <ac131313@redhat.com> + + * gdbarch.sh (verify_gdbarch): Use a mem_file to accumulate all + error messages. Print in a single batch. + * gdbarch.c: Re-generate. + 2001-11-04 Mark Kettenis <kettenis@gnu.org> * i386-linux-nat.c (GETREGS_SUPPLIES, supply_gregset, diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index f0a8a0a..ce42082 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -526,16 +526,20 @@ gdbarch_free (struct gdbarch *arch) static void verify_gdbarch (struct gdbarch *gdbarch) { + struct ui_file *log; + struct cleanup *cleanups; + long dummy; + char *buf; /* Only perform sanity checks on a multi-arch target. */ if (!GDB_MULTI_ARCH) return; + log = mem_fileopen (); + cleanups = make_cleanup_ui_file_delete (log); /* fundamental */ if (gdbarch->byte_order == 0) - internal_error (__FILE__, __LINE__, - "verify_gdbarch: byte-order unset"); + fprintf_unfiltered (log, "\n\tbyte-order"); if (gdbarch->bfd_arch_info == NULL) - internal_error (__FILE__, __LINE__, - "verify_gdbarch: bfd_arch_info unset"); + fprintf_unfiltered (log, "\n\tbfd_arch_info"); /* Check those that need to be defined for the given multi-arch level. */ /* Skip verify of short_bit, invalid_p == 0 */ /* Skip verify of int_bit, invalid_p == 0 */ @@ -560,21 +564,17 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of register_write, has predicate */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->num_regs == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: num_regs invalid"); + fprintf_unfiltered (log, "\n\tnum_regs"); /* Skip verify of num_pseudo_regs, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->sp_regnum == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: sp_regnum invalid"); + fprintf_unfiltered (log, "\n\tsp_regnum"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->fp_regnum == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: fp_regnum invalid"); + fprintf_unfiltered (log, "\n\tfp_regnum"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->pc_regnum == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: pc_regnum invalid"); + fprintf_unfiltered (log, "\n\tpc_regnum"); /* Skip verify of fp0_regnum, invalid_p == 0 */ /* Skip verify of npc_regnum, invalid_p == 0 */ /* Skip verify of nnpc_regnum, invalid_p == 0 */ @@ -586,36 +586,28 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of register_name, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->register_size == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: register_size invalid"); + fprintf_unfiltered (log, "\n\tregister_size"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->register_bytes == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: register_bytes invalid"); + fprintf_unfiltered (log, "\n\tregister_bytes"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->register_byte == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: register_byte invalid"); + fprintf_unfiltered (log, "\n\tregister_byte"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->register_raw_size == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: register_raw_size invalid"); + fprintf_unfiltered (log, "\n\tregister_raw_size"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->max_register_raw_size == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: max_register_raw_size invalid"); + fprintf_unfiltered (log, "\n\tmax_register_raw_size"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->register_virtual_size == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: register_virtual_size invalid"); + fprintf_unfiltered (log, "\n\tregister_virtual_size"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->max_register_virtual_size == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: max_register_virtual_size invalid"); + fprintf_unfiltered (log, "\n\tmax_register_virtual_size"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->register_virtual_type == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: register_virtual_type invalid"); + fprintf_unfiltered (log, "\n\tregister_virtual_type"); /* Skip verify of do_registers_info, invalid_p == 0 */ /* Skip verify of register_sim_regno, invalid_p == 0 */ /* Skip verify of register_bytes_ok, has predicate */ @@ -623,61 +615,48 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of cannot_store_register, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 1) && (gdbarch->use_generic_dummy_frames == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: use_generic_dummy_frames invalid"); + fprintf_unfiltered (log, "\n\tuse_generic_dummy_frames"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->call_dummy_location == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: call_dummy_location invalid"); + fprintf_unfiltered (log, "\n\tcall_dummy_location"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: call_dummy_address invalid"); + fprintf_unfiltered (log, "\n\tcall_dummy_address"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->call_dummy_start_offset == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: call_dummy_start_offset invalid"); + fprintf_unfiltered (log, "\n\tcall_dummy_start_offset"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid"); + fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset"); if ((GDB_MULTI_ARCH >= 1) && (gdbarch->call_dummy_breakpoint_offset_p == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid"); + fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset_p"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->call_dummy_length == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: call_dummy_length invalid"); + fprintf_unfiltered (log, "\n\tcall_dummy_length"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->pc_in_call_dummy == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: pc_in_call_dummy invalid"); + fprintf_unfiltered (log, "\n\tpc_in_call_dummy"); if ((GDB_MULTI_ARCH >= 1) && (gdbarch->call_dummy_p == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: call_dummy_p invalid"); + fprintf_unfiltered (log, "\n\tcall_dummy_p"); /* Skip verify of call_dummy_words, invalid_p == 0 */ /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 1) && (gdbarch->call_dummy_stack_adjust_p == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid"); + fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust_p"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid"); + fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->fix_call_dummy == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: fix_call_dummy invalid"); + fprintf_unfiltered (log, "\n\tfix_call_dummy"); /* Skip verify of init_frame_pc_first, invalid_p == 0 */ /* Skip verify of init_frame_pc, invalid_p == 0 */ /* Skip verify of coerce_float_to_double, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 1) && (gdbarch->get_saved_register == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: get_saved_register invalid"); + fprintf_unfiltered (log, "\n\tget_saved_register"); /* Skip verify of register_convertible, invalid_p == 0 */ /* Skip verify of register_convert_to_virtual, invalid_p == 0 */ /* Skip verify of register_convert_to_raw, invalid_p == 0 */ @@ -689,100 +668,78 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of return_value_on_stack, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->extract_return_value == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: extract_return_value invalid"); + fprintf_unfiltered (log, "\n\textract_return_value"); if ((GDB_MULTI_ARCH >= 1) && (gdbarch->push_arguments == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: push_arguments invalid"); + fprintf_unfiltered (log, "\n\tpush_arguments"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->push_dummy_frame == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: push_dummy_frame invalid"); + fprintf_unfiltered (log, "\n\tpush_dummy_frame"); if ((GDB_MULTI_ARCH >= 1) && (gdbarch->push_return_address == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: push_return_address invalid"); + fprintf_unfiltered (log, "\n\tpush_return_address"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->pop_frame == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: pop_frame invalid"); + fprintf_unfiltered (log, "\n\tpop_frame"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->store_struct_return == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: store_struct_return invalid"); + fprintf_unfiltered (log, "\n\tstore_struct_return"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->store_return_value == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: store_return_value invalid"); + fprintf_unfiltered (log, "\n\tstore_return_value"); /* Skip verify of extract_struct_value_address, has predicate */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->use_struct_convention == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: use_struct_convention invalid"); + fprintf_unfiltered (log, "\n\tuse_struct_convention"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_init_saved_regs == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: frame_init_saved_regs invalid"); + fprintf_unfiltered (log, "\n\tframe_init_saved_regs"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->init_extra_frame_info == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: init_extra_frame_info invalid"); + fprintf_unfiltered (log, "\n\tinit_extra_frame_info"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->skip_prologue == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: skip_prologue invalid"); + fprintf_unfiltered (log, "\n\tskip_prologue"); /* Skip verify of prologue_frameless_p, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->inner_than == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: inner_than invalid"); + fprintf_unfiltered (log, "\n\tinner_than"); /* Skip verify of breakpoint_from_pc, invalid_p == 0 */ /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */ /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->decr_pc_after_break == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: decr_pc_after_break invalid"); + fprintf_unfiltered (log, "\n\tdecr_pc_after_break"); /* Skip verify of prepare_to_proceed, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->function_start_offset == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: function_start_offset invalid"); + fprintf_unfiltered (log, "\n\tfunction_start_offset"); /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_args_skip == -1)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: frame_args_skip invalid"); + fprintf_unfiltered (log, "\n\tframe_args_skip"); /* Skip verify of frameless_function_invocation, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_chain == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: frame_chain invalid"); + fprintf_unfiltered (log, "\n\tframe_chain"); if ((GDB_MULTI_ARCH >= 1) && (gdbarch->frame_chain_valid == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: frame_chain_valid invalid"); + fprintf_unfiltered (log, "\n\tframe_chain_valid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_saved_pc == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: frame_saved_pc invalid"); + fprintf_unfiltered (log, "\n\tframe_saved_pc"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_args_address == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: frame_args_address invalid"); + fprintf_unfiltered (log, "\n\tframe_args_address"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_locals_address == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: frame_locals_address invalid"); + fprintf_unfiltered (log, "\n\tframe_locals_address"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->saved_pc_after_call == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: saved_pc_after_call invalid"); + fprintf_unfiltered (log, "\n\tsaved_pc_after_call"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_num_args == 0)) - internal_error (__FILE__, __LINE__, - "gdbarch: verify_gdbarch: frame_num_args invalid"); + fprintf_unfiltered (log, "\n\tframe_num_args"); /* Skip verify of stack_align, has predicate */ /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */ /* Skip verify of reg_struct_has_addr, has predicate */ @@ -799,6 +756,13 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of print_insn, invalid_p == 0 */ /* Skip verify of skip_trampoline_code, invalid_p == 0 */ /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */ + buf = ui_file_xstrdup (log, &dummy); + make_cleanup (xfree, buf); + if (strlen (buf) > 0) + internal_error (__FILE__, __LINE__, + "verify_gdbarch: the following are invalid ...%s", + buf); + do_cleanups (cleanups); } diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index d3bd595..623b03e 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -1366,16 +1366,20 @@ cat <<EOF static void verify_gdbarch (struct gdbarch *gdbarch) { + struct ui_file *log; + struct cleanup *cleanups; + long dummy; + char *buf; /* Only perform sanity checks on a multi-arch target. */ if (!GDB_MULTI_ARCH) return; + log = mem_fileopen (); + cleanups = make_cleanup_ui_file_delete (log); /* fundamental */ if (gdbarch->byte_order == 0) - internal_error (__FILE__, __LINE__, - "verify_gdbarch: byte-order unset"); + fprintf_unfiltered (log, "\n\tbyte-order"); if (gdbarch->bfd_arch_info == NULL) - internal_error (__FILE__, __LINE__, - "verify_gdbarch: bfd_arch_info unset"); + fprintf_unfiltered (log, "\n\tbfd_arch_info"); /* Check those that need to be defined for the given multi-arch level. */ EOF function_list | while do_read @@ -1405,18 +1409,23 @@ do then printf " if ((GDB_MULTI_ARCH >= ${level})\n" printf " && (${invalid_p}))\n" - printf " internal_error (__FILE__, __LINE__,\n" - printf " \"gdbarch: verify_gdbarch: ${function} invalid\");\n" + printf " fprintf_unfiltered (log, \"\\\\n\\\\t${function}\");\n" elif [ -n "${predefault}" ] then printf " if ((GDB_MULTI_ARCH >= ${level})\n" printf " && (gdbarch->${function} == ${predefault}))\n" - printf " internal_error (__FILE__, __LINE__,\n" - printf " \"gdbarch: verify_gdbarch: ${function} invalid\");\n" + printf " fprintf_unfiltered (log, \"\\\\n\\\\t${function}\");\n" fi fi done cat <<EOF + buf = ui_file_xstrdup (log, &dummy); + make_cleanup (xfree, buf); + if (strlen (buf) > 0) + internal_error (__FILE__, __LINE__, + "verify_gdbarch: the following are invalid ...%s", + buf); + do_cleanups (cleanups); } EOF |