From 956ac328832f9b49bc4fa51a5495e3a54085c240 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 10 Jul 2003 22:01:14 +0000 Subject: [PATCH] 2003-07-10 Andrew Cagney * gdbarch.sh: Use gdb_assert instead of internal_error. Compare functions against NULL, not 0. * gdbarch.c: Re-generate. --- gdb/ChangeLog | 6 + gdb/gdbarch.c | 558 +++++++++++++++---------------------------------- gdb/gdbarch.sh | 18 +- 3 files changed, 186 insertions(+), 396 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a58c97209e0..9f84f717cd2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2003-07-10 Andrew Cagney + + * gdbarch.sh: Use gdb_assert instead of internal_error. Compare + functions against NULL, not 0. + * gdbarch.c: Re-generate. + 2003-07-10 Fred Fish * coff-solib.h (SOLIB_LOADED_LIBRARY_PATHNAME): Default to a diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index c4aa9d26505..7333952893c 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -2878,9 +2878,8 @@ int gdbarch_addr_bit (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->addr_bit == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_addr_bit invalid"); + /* Check variable changed from pre-default. */ + gdb_assert (gdbarch->addr_bit != 0); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n"); return gdbarch->addr_bit; @@ -2914,9 +2913,8 @@ int gdbarch_char_signed (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->char_signed == -1) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_char_signed invalid"); + /* Check variable changed from pre-default. */ + gdb_assert (gdbarch->char_signed != -1); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n"); return gdbarch->char_signed; @@ -2933,16 +2931,14 @@ int gdbarch_read_pc_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->read_pc != 0; + return gdbarch->read_pc != NULL; } CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid) { gdb_assert (gdbarch != NULL); - if (gdbarch->read_pc == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_read_pc invalid"); + gdb_assert (gdbarch->read_pc != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n"); return gdbarch->read_pc (ptid); @@ -2959,9 +2955,7 @@ void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid) { gdb_assert (gdbarch != NULL); - if (gdbarch->write_pc == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_write_pc invalid"); + gdb_assert (gdbarch->write_pc != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n"); gdbarch->write_pc (val, ptid); @@ -2978,16 +2972,14 @@ int gdbarch_read_sp_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->read_sp != 0; + return gdbarch->read_sp != NULL; } CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->read_sp == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_read_sp invalid"); + gdb_assert (gdbarch->read_sp != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n"); return gdbarch->read_sp (); @@ -3004,9 +2996,7 @@ void gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset) { gdb_assert (gdbarch != NULL); - if (gdbarch->virtual_frame_pointer == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_virtual_frame_pointer invalid"); + gdb_assert (gdbarch->virtual_frame_pointer != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n"); gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset); @@ -3023,16 +3013,14 @@ int gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->pseudo_register_read != 0; + return gdbarch->pseudo_register_read != NULL; } void gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf) { gdb_assert (gdbarch != NULL); - if (gdbarch->pseudo_register_read == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_pseudo_register_read invalid"); + gdb_assert (gdbarch->pseudo_register_read != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n"); gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf); @@ -3049,16 +3037,14 @@ int gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->pseudo_register_write != 0; + return gdbarch->pseudo_register_write != NULL; } void gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf) { gdb_assert (gdbarch != NULL); - if (gdbarch->pseudo_register_write == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_pseudo_register_write invalid"); + gdb_assert (gdbarch->pseudo_register_write != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n"); gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf); @@ -3075,9 +3061,8 @@ int gdbarch_num_regs (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->num_regs == -1) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_num_regs invalid"); + /* Check variable changed from pre-default. */ + gdb_assert (gdbarch->num_regs != -1); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n"); return gdbarch->num_regs; @@ -3196,9 +3181,7 @@ int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr) { gdb_assert (gdbarch != NULL); - if (gdbarch->stab_reg_to_regnum == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_stab_reg_to_regnum invalid"); + gdb_assert (gdbarch->stab_reg_to_regnum != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n"); return gdbarch->stab_reg_to_regnum (stab_regnr); @@ -3215,9 +3198,7 @@ int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr) { gdb_assert (gdbarch != NULL); - if (gdbarch->ecoff_reg_to_regnum == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_ecoff_reg_to_regnum invalid"); + gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n"); return gdbarch->ecoff_reg_to_regnum (ecoff_regnr); @@ -3234,9 +3215,7 @@ int gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr) { gdb_assert (gdbarch != NULL); - if (gdbarch->dwarf_reg_to_regnum == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_dwarf_reg_to_regnum invalid"); + gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n"); return gdbarch->dwarf_reg_to_regnum (dwarf_regnr); @@ -3253,9 +3232,7 @@ int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr) { gdb_assert (gdbarch != NULL); - if (gdbarch->sdb_reg_to_regnum == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_sdb_reg_to_regnum invalid"); + gdb_assert (gdbarch->sdb_reg_to_regnum != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n"); return gdbarch->sdb_reg_to_regnum (sdb_regnr); @@ -3272,9 +3249,7 @@ int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr) { gdb_assert (gdbarch != NULL); - if (gdbarch->dwarf2_reg_to_regnum == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_dwarf2_reg_to_regnum invalid"); + gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n"); return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr); @@ -3291,9 +3266,7 @@ const char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_name == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_name invalid"); + gdb_assert (gdbarch->register_name != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n"); return gdbarch->register_name (regnr); @@ -3310,16 +3283,14 @@ int gdbarch_register_type_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->register_type != 0; + return gdbarch->register_type != NULL; } struct type * gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_type == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_type invalid"); + gdb_assert (gdbarch->register_type != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n"); return gdbarch->register_type (gdbarch, reg_nr); @@ -3336,16 +3307,14 @@ int gdbarch_deprecated_register_virtual_type_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_register_virtual_type != 0; + return gdbarch->deprecated_register_virtual_type != NULL; } struct type * gdbarch_deprecated_register_virtual_type (struct gdbarch *gdbarch, int reg_nr) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_register_virtual_type == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_register_virtual_type invalid"); + gdb_assert (gdbarch->deprecated_register_virtual_type != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_virtual_type called\n"); return gdbarch->deprecated_register_virtual_type (reg_nr); @@ -3385,10 +3354,8 @@ int gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, int reg_nr) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_register_byte == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_register_byte invalid"); - /* Ignore predicate (gdbarch->deprecated_register_byte != generic_register_byte). */ + gdb_assert (gdbarch->deprecated_register_byte != NULL); + /* Do not check predicate: gdbarch->deprecated_register_byte != generic_register_byte, allow call. */ if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_byte called\n"); return gdbarch->deprecated_register_byte (reg_nr); @@ -3412,10 +3379,8 @@ int gdbarch_deprecated_register_raw_size (struct gdbarch *gdbarch, int reg_nr) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_register_raw_size == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_register_raw_size invalid"); - /* Ignore predicate (gdbarch->deprecated_register_raw_size != generic_register_size). */ + gdb_assert (gdbarch->deprecated_register_raw_size != NULL); + /* Do not check predicate: gdbarch->deprecated_register_raw_size != generic_register_size, allow call. */ if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_raw_size called\n"); return gdbarch->deprecated_register_raw_size (reg_nr); @@ -3439,10 +3404,8 @@ int gdbarch_deprecated_register_virtual_size (struct gdbarch *gdbarch, int reg_nr) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_register_virtual_size == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_register_virtual_size invalid"); - /* Ignore predicate (gdbarch->deprecated_register_virtual_size != generic_register_size). */ + gdb_assert (gdbarch->deprecated_register_virtual_size != NULL); + /* Do not check predicate: gdbarch->deprecated_register_virtual_size != generic_register_size, allow call. */ if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_virtual_size called\n"); return gdbarch->deprecated_register_virtual_size (reg_nr); @@ -3459,7 +3422,7 @@ int gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_max_register_raw_size != 0; + return gdbarch->deprecated_max_register_raw_size != NULL; } int @@ -3482,7 +3445,7 @@ int gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_max_register_virtual_size != 0; + return gdbarch->deprecated_max_register_virtual_size != NULL; } int @@ -3505,16 +3468,14 @@ int gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->unwind_dummy_id != 0; + return gdbarch->unwind_dummy_id != NULL; } struct frame_id gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info) { gdb_assert (gdbarch != NULL); - if (gdbarch->unwind_dummy_id == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_unwind_dummy_id invalid"); + gdb_assert (gdbarch->unwind_dummy_id != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n"); return gdbarch->unwind_dummy_id (gdbarch, info); @@ -3531,16 +3492,14 @@ int gdbarch_deprecated_save_dummy_frame_tos_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_save_dummy_frame_tos != 0; + return gdbarch->deprecated_save_dummy_frame_tos != NULL; } void gdbarch_deprecated_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_save_dummy_frame_tos == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_save_dummy_frame_tos invalid"); + gdb_assert (gdbarch->deprecated_save_dummy_frame_tos != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_save_dummy_frame_tos called\n"); gdbarch->deprecated_save_dummy_frame_tos (sp); @@ -3574,16 +3533,14 @@ int gdbarch_deprecated_target_read_fp_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_target_read_fp != 0; + return gdbarch->deprecated_target_read_fp != NULL; } CORE_ADDR gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_target_read_fp == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_target_read_fp invalid"); + gdb_assert (gdbarch->deprecated_target_read_fp != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_target_read_fp called\n"); return gdbarch->deprecated_target_read_fp (); @@ -3600,16 +3557,14 @@ int gdbarch_push_dummy_call_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->push_dummy_call != 0; + return gdbarch->push_dummy_call != NULL; } CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { gdb_assert (gdbarch != NULL); - if (gdbarch->push_dummy_call == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_push_dummy_call invalid"); + gdb_assert (gdbarch->push_dummy_call != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n"); return gdbarch->push_dummy_call (gdbarch, func_addr, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr); @@ -3626,16 +3581,14 @@ int gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_push_arguments != 0; + return gdbarch->deprecated_push_arguments != NULL; } CORE_ADDR gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_push_arguments == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_push_arguments invalid"); + gdb_assert (gdbarch->deprecated_push_arguments != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_arguments called\n"); return gdbarch->deprecated_push_arguments (nargs, args, sp, struct_return, struct_addr); @@ -3669,16 +3622,14 @@ int gdbarch_deprecated_push_return_address_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_push_return_address != 0; + return gdbarch->deprecated_push_return_address != NULL; } CORE_ADDR gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_push_return_address == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_push_return_address invalid"); + gdb_assert (gdbarch->deprecated_push_return_address != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_return_address called\n"); return gdbarch->deprecated_push_return_address (pc, sp); @@ -3695,16 +3646,14 @@ int gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_dummy_write_sp != 0; + return gdbarch->deprecated_dummy_write_sp != NULL; } void gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, CORE_ADDR val) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_dummy_write_sp == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_dummy_write_sp invalid"); + gdb_assert (gdbarch->deprecated_dummy_write_sp != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_dummy_write_sp called\n"); gdbarch->deprecated_dummy_write_sp (val); @@ -3754,9 +3703,7 @@ CORE_ADDR gdbarch_call_dummy_address (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->call_dummy_address == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_call_dummy_address invalid"); + gdb_assert (gdbarch->call_dummy_address != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n"); return gdbarch->call_dummy_address (); @@ -3855,7 +3802,7 @@ int gdbarch_deprecated_call_dummy_stack_adjust_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_call_dummy_stack_adjust != 0; + return gdbarch->deprecated_call_dummy_stack_adjust != NULL; } int @@ -3878,16 +3825,14 @@ int gdbarch_deprecated_fix_call_dummy_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_fix_call_dummy != 0; + return gdbarch->deprecated_fix_call_dummy != NULL; } void gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_fix_call_dummy == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_fix_call_dummy invalid"); + gdb_assert (gdbarch->deprecated_fix_call_dummy != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fix_call_dummy called\n"); gdbarch->deprecated_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p); @@ -3904,16 +3849,14 @@ int gdbarch_push_dummy_code_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->push_dummy_code != 0; + return gdbarch->push_dummy_code != NULL; } CORE_ADDR gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr) { gdb_assert (gdbarch != NULL); - if (gdbarch->push_dummy_code == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_push_dummy_code invalid"); + gdb_assert (gdbarch->push_dummy_code != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n"); return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr); @@ -3930,16 +3873,14 @@ int gdbarch_deprecated_push_dummy_frame_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_push_dummy_frame != 0; + return gdbarch->deprecated_push_dummy_frame != NULL; } void gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_push_dummy_frame == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_push_dummy_frame invalid"); + gdb_assert (gdbarch->deprecated_push_dummy_frame != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_dummy_frame called\n"); gdbarch->deprecated_push_dummy_frame (); @@ -3973,16 +3914,14 @@ int gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_do_registers_info != 0; + return gdbarch->deprecated_do_registers_info != NULL; } void gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_do_registers_info == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_do_registers_info invalid"); + gdb_assert (gdbarch->deprecated_do_registers_info != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_do_registers_info called\n"); gdbarch->deprecated_do_registers_info (reg_nr, fpregs); @@ -3999,9 +3938,7 @@ void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all) { gdb_assert (gdbarch != NULL); - if (gdbarch->print_registers_info == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_print_registers_info invalid"); + gdb_assert (gdbarch->print_registers_info != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n"); gdbarch->print_registers_info (gdbarch, file, frame, regnum, all); @@ -4018,16 +3955,14 @@ int gdbarch_print_float_info_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->print_float_info != 0; + return gdbarch->print_float_info != NULL; } void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) { gdb_assert (gdbarch != NULL); - if (gdbarch->print_float_info == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_print_float_info invalid"); + gdb_assert (gdbarch->print_float_info != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n"); gdbarch->print_float_info (gdbarch, file, frame, args); @@ -4044,16 +3979,14 @@ int gdbarch_print_vector_info_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->print_vector_info != 0; + return gdbarch->print_vector_info != NULL; } void gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) { gdb_assert (gdbarch != NULL); - if (gdbarch->print_vector_info == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_print_vector_info invalid"); + gdb_assert (gdbarch->print_vector_info != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n"); gdbarch->print_vector_info (gdbarch, file, frame, args); @@ -4070,9 +4003,7 @@ int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_sim_regno == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_sim_regno invalid"); + gdb_assert (gdbarch->register_sim_regno != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n"); return gdbarch->register_sim_regno (reg_nr); @@ -4089,16 +4020,14 @@ int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->register_bytes_ok != 0; + return gdbarch->register_bytes_ok != NULL; } int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_bytes_ok == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_bytes_ok invalid"); + gdb_assert (gdbarch->register_bytes_ok != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n"); return gdbarch->register_bytes_ok (nr_bytes); @@ -4115,9 +4044,7 @@ int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum) { gdb_assert (gdbarch != NULL); - if (gdbarch->cannot_fetch_register == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_cannot_fetch_register invalid"); + gdb_assert (gdbarch->cannot_fetch_register != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n"); return gdbarch->cannot_fetch_register (regnum); @@ -4134,9 +4061,7 @@ int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum) { gdb_assert (gdbarch != NULL); - if (gdbarch->cannot_store_register == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_cannot_store_register invalid"); + gdb_assert (gdbarch->cannot_store_register != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n"); return gdbarch->cannot_store_register (regnum); @@ -4153,16 +4078,14 @@ int gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->get_longjmp_target != 0; + return gdbarch->get_longjmp_target != NULL; } int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc) { gdb_assert (gdbarch != NULL); - if (gdbarch->get_longjmp_target == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_get_longjmp_target invalid"); + gdb_assert (gdbarch->get_longjmp_target != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n"); return gdbarch->get_longjmp_target (pc); @@ -4186,10 +4109,8 @@ int gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_pc_in_call_dummy == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_pc_in_call_dummy invalid"); - /* Ignore predicate (gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy). */ + gdb_assert (gdbarch->deprecated_pc_in_call_dummy != NULL); + /* Do not check predicate: gdbarch->deprecated_pc_in_call_dummy != generic_pc_in_call_dummy, allow call. */ if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pc_in_call_dummy called\n"); return gdbarch->deprecated_pc_in_call_dummy (pc, sp, frame_address); @@ -4206,16 +4127,14 @@ int gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_init_frame_pc_first != 0; + return gdbarch->deprecated_init_frame_pc_first != NULL; } CORE_ADDR gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_init_frame_pc_first == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_init_frame_pc_first invalid"); + gdb_assert (gdbarch->deprecated_init_frame_pc_first != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc_first called\n"); return gdbarch->deprecated_init_frame_pc_first (fromleaf, prev); @@ -4232,16 +4151,14 @@ int gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_init_frame_pc != 0; + return gdbarch->deprecated_init_frame_pc != NULL; } CORE_ADDR gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_init_frame_pc == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_init_frame_pc invalid"); + gdb_assert (gdbarch->deprecated_init_frame_pc != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc called\n"); return gdbarch->deprecated_init_frame_pc (fromleaf, prev); @@ -4290,16 +4207,14 @@ int gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_get_saved_register != 0; + return gdbarch->deprecated_get_saved_register != NULL; } void gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_get_saved_register == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_get_saved_register invalid"); + gdb_assert (gdbarch->deprecated_get_saved_register != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_get_saved_register called\n"); gdbarch->deprecated_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval); @@ -4316,9 +4231,7 @@ int gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, int nr) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_register_convertible == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_register_convertible invalid"); + gdb_assert (gdbarch->deprecated_register_convertible != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_convertible called\n"); return gdbarch->deprecated_register_convertible (nr); @@ -4335,9 +4248,7 @@ void gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_register_convert_to_virtual == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_register_convert_to_virtual invalid"); + gdb_assert (gdbarch->deprecated_register_convert_to_virtual != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_convert_to_virtual called\n"); gdbarch->deprecated_register_convert_to_virtual (regnum, type, from, to); @@ -4354,9 +4265,7 @@ void gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, const char *from, char *to) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_register_convert_to_raw == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_register_convert_to_raw invalid"); + gdb_assert (gdbarch->deprecated_register_convert_to_raw != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_convert_to_raw called\n"); gdbarch->deprecated_register_convert_to_raw (type, regnum, from, to); @@ -4373,9 +4282,7 @@ int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) { gdb_assert (gdbarch != NULL); - if (gdbarch->convert_register_p == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_convert_register_p invalid"); + gdb_assert (gdbarch->convert_register_p != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n"); return gdbarch->convert_register_p (regnum, type); @@ -4392,9 +4299,7 @@ void gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, void *buf) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_to_value == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_to_value invalid"); + gdb_assert (gdbarch->register_to_value != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n"); gdbarch->register_to_value (frame, regnum, type, buf); @@ -4411,9 +4316,7 @@ void gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const void *buf) { gdb_assert (gdbarch != NULL); - if (gdbarch->value_to_register == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_value_to_register invalid"); + gdb_assert (gdbarch->value_to_register != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n"); gdbarch->value_to_register (frame, regnum, type, buf); @@ -4430,9 +4333,7 @@ CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf) { gdb_assert (gdbarch != NULL); - if (gdbarch->pointer_to_address == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_pointer_to_address invalid"); + gdb_assert (gdbarch->pointer_to_address != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n"); return gdbarch->pointer_to_address (type, buf); @@ -4449,9 +4350,7 @@ void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr) { gdb_assert (gdbarch != NULL); - if (gdbarch->address_to_pointer == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_address_to_pointer invalid"); + gdb_assert (gdbarch->address_to_pointer != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n"); gdbarch->address_to_pointer (type, buf, addr); @@ -4468,16 +4367,14 @@ int gdbarch_integer_to_address_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->integer_to_address != 0; + return gdbarch->integer_to_address != NULL; } CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf) { gdb_assert (gdbarch != NULL); - if (gdbarch->integer_to_address == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_integer_to_address invalid"); + gdb_assert (gdbarch->integer_to_address != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n"); return gdbarch->integer_to_address (type, buf); @@ -4494,9 +4391,7 @@ int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type) { gdb_assert (gdbarch != NULL); - if (gdbarch->return_value_on_stack == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_return_value_on_stack invalid"); + gdb_assert (gdbarch->return_value_on_stack != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n"); return gdbarch->return_value_on_stack (type); @@ -4513,16 +4408,14 @@ int gdbarch_deprecated_pop_frame_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_pop_frame != 0; + return gdbarch->deprecated_pop_frame != NULL; } void gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_pop_frame == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_pop_frame invalid"); + gdb_assert (gdbarch->deprecated_pop_frame != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pop_frame called\n"); gdbarch->deprecated_pop_frame (); @@ -4539,16 +4432,14 @@ int gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_store_struct_return != 0; + return gdbarch->deprecated_store_struct_return != NULL; } void gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_store_struct_return == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_store_struct_return invalid"); + gdb_assert (gdbarch->deprecated_store_struct_return != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_struct_return called\n"); gdbarch->deprecated_store_struct_return (addr, sp); @@ -4565,9 +4456,7 @@ void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf) { gdb_assert (gdbarch != NULL); - if (gdbarch->extract_return_value == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_extract_return_value invalid"); + gdb_assert (gdbarch->extract_return_value != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n"); gdbarch->extract_return_value (type, regcache, valbuf); @@ -4584,9 +4473,7 @@ void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf) { gdb_assert (gdbarch != NULL); - if (gdbarch->store_return_value == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_store_return_value invalid"); + gdb_assert (gdbarch->store_return_value != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n"); gdbarch->store_return_value (type, regcache, valbuf); @@ -4603,9 +4490,7 @@ void gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_extract_return_value == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_extract_return_value invalid"); + gdb_assert (gdbarch->deprecated_extract_return_value != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n"); gdbarch->deprecated_extract_return_value (type, regbuf, valbuf); @@ -4622,9 +4507,7 @@ void gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_store_return_value == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_store_return_value invalid"); + gdb_assert (gdbarch->deprecated_store_return_value != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_return_value called\n"); gdbarch->deprecated_store_return_value (type, valbuf); @@ -4641,16 +4524,14 @@ int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->extract_struct_value_address != 0; + return gdbarch->extract_struct_value_address != NULL; } CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache) { gdb_assert (gdbarch != NULL); - if (gdbarch->extract_struct_value_address == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_extract_struct_value_address invalid"); + gdb_assert (gdbarch->extract_struct_value_address != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n"); return gdbarch->extract_struct_value_address (regcache); @@ -4667,16 +4548,14 @@ int gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_extract_struct_value_address != 0; + return gdbarch->deprecated_extract_struct_value_address != NULL; } CORE_ADDR gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_extract_struct_value_address == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_extract_struct_value_address invalid"); + gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n"); return gdbarch->deprecated_extract_struct_value_address (regbuf); @@ -4693,9 +4572,7 @@ int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type) { gdb_assert (gdbarch != NULL); - if (gdbarch->use_struct_convention == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_use_struct_convention invalid"); + gdb_assert (gdbarch->use_struct_convention != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n"); return gdbarch->use_struct_convention (gcc_p, value_type); @@ -4712,16 +4589,14 @@ int gdbarch_deprecated_frame_init_saved_regs_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_frame_init_saved_regs != 0; + return gdbarch->deprecated_frame_init_saved_regs != NULL; } void gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_frame_init_saved_regs == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_frame_init_saved_regs invalid"); + gdb_assert (gdbarch->deprecated_frame_init_saved_regs != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_init_saved_regs called\n"); gdbarch->deprecated_frame_init_saved_regs (frame); @@ -4738,16 +4613,14 @@ int gdbarch_deprecated_init_extra_frame_info_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_init_extra_frame_info != 0; + return gdbarch->deprecated_init_extra_frame_info != NULL; } void gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_init_extra_frame_info == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_init_extra_frame_info invalid"); + gdb_assert (gdbarch->deprecated_init_extra_frame_info != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_extra_frame_info called\n"); gdbarch->deprecated_init_extra_frame_info (fromleaf, frame); @@ -4764,9 +4637,7 @@ CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip) { gdb_assert (gdbarch != NULL); - if (gdbarch->skip_prologue == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_skip_prologue invalid"); + gdb_assert (gdbarch->skip_prologue != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n"); return gdbarch->skip_prologue (ip); @@ -4783,9 +4654,7 @@ int gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip) { gdb_assert (gdbarch != NULL); - if (gdbarch->prologue_frameless_p == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_prologue_frameless_p invalid"); + gdb_assert (gdbarch->prologue_frameless_p != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n"); return gdbarch->prologue_frameless_p (ip); @@ -4802,9 +4671,7 @@ int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs) { gdb_assert (gdbarch != NULL); - if (gdbarch->inner_than == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_inner_than invalid"); + gdb_assert (gdbarch->inner_than != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n"); return gdbarch->inner_than (lhs, rhs); @@ -4821,9 +4688,7 @@ const unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) { gdb_assert (gdbarch != NULL); - if (gdbarch->breakpoint_from_pc == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_breakpoint_from_pc invalid"); + gdb_assert (gdbarch->breakpoint_from_pc != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n"); return gdbarch->breakpoint_from_pc (pcptr, lenptr); @@ -4840,9 +4705,7 @@ int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache) { gdb_assert (gdbarch != NULL); - if (gdbarch->memory_insert_breakpoint == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_memory_insert_breakpoint invalid"); + gdb_assert (gdbarch->memory_insert_breakpoint != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n"); return gdbarch->memory_insert_breakpoint (addr, contents_cache); @@ -4859,9 +4722,7 @@ int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache) { gdb_assert (gdbarch != NULL); - if (gdbarch->memory_remove_breakpoint == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_memory_remove_breakpoint invalid"); + gdb_assert (gdbarch->memory_remove_breakpoint != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n"); return gdbarch->memory_remove_breakpoint (addr, contents_cache); @@ -4878,9 +4739,8 @@ CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->decr_pc_after_break == -1) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_decr_pc_after_break invalid"); + /* Check variable changed from pre-default. */ + gdb_assert (gdbarch->decr_pc_after_break != -1); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n"); return gdbarch->decr_pc_after_break; @@ -4897,9 +4757,8 @@ CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->function_start_offset == -1) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_function_start_offset invalid"); + /* Check variable changed from pre-default. */ + gdb_assert (gdbarch->function_start_offset != -1); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n"); return gdbarch->function_start_offset; @@ -4916,9 +4775,7 @@ void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len) { gdb_assert (gdbarch != NULL); - if (gdbarch->remote_translate_xfer_address == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_remote_translate_xfer_address invalid"); + gdb_assert (gdbarch->remote_translate_xfer_address != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n"); gdbarch->remote_translate_xfer_address (gdbarch, regcache, gdb_addr, gdb_len, rem_addr, rem_len); @@ -4935,9 +4792,8 @@ CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - if (gdbarch->frame_args_skip == -1) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_frame_args_skip invalid"); + /* Check variable changed from pre-default. */ + gdb_assert (gdbarch->frame_args_skip != -1); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n"); return gdbarch->frame_args_skip; @@ -4954,9 +4810,7 @@ int gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi) { gdb_assert (gdbarch != NULL); - if (gdbarch->frameless_function_invocation == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_frameless_function_invocation invalid"); + gdb_assert (gdbarch->frameless_function_invocation != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n"); return gdbarch->frameless_function_invocation (fi); @@ -4973,16 +4827,14 @@ int gdbarch_deprecated_frame_chain_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_frame_chain != 0; + return gdbarch->deprecated_frame_chain != NULL; } CORE_ADDR gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_frame_chain == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_frame_chain invalid"); + gdb_assert (gdbarch->deprecated_frame_chain != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_chain called\n"); return gdbarch->deprecated_frame_chain (frame); @@ -4999,16 +4851,14 @@ int gdbarch_deprecated_frame_chain_valid_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_frame_chain_valid != 0; + return gdbarch->deprecated_frame_chain_valid != NULL; } int gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_frame_chain_valid == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_frame_chain_valid invalid"); + gdb_assert (gdbarch->deprecated_frame_chain_valid != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_chain_valid called\n"); return gdbarch->deprecated_frame_chain_valid (chain, thisframe); @@ -5025,16 +4875,14 @@ int gdbarch_deprecated_frame_saved_pc_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_frame_saved_pc != 0; + return gdbarch->deprecated_frame_saved_pc != NULL; } CORE_ADDR gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_frame_saved_pc == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_frame_saved_pc invalid"); + gdb_assert (gdbarch->deprecated_frame_saved_pc != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_saved_pc called\n"); return gdbarch->deprecated_frame_saved_pc (fi); @@ -5051,16 +4899,14 @@ int gdbarch_unwind_pc_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->unwind_pc != 0; + return gdbarch->unwind_pc != NULL; } CORE_ADDR gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) { gdb_assert (gdbarch != NULL); - if (gdbarch->unwind_pc == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_unwind_pc invalid"); + gdb_assert (gdbarch->unwind_pc != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n"); return gdbarch->unwind_pc (gdbarch, next_frame); @@ -5077,16 +4923,14 @@ int gdbarch_unwind_sp_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->unwind_sp != 0; + return gdbarch->unwind_sp != NULL; } CORE_ADDR gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) { gdb_assert (gdbarch != NULL); - if (gdbarch->unwind_sp == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_unwind_sp invalid"); + gdb_assert (gdbarch->unwind_sp != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n"); return gdbarch->unwind_sp (gdbarch, next_frame); @@ -5110,10 +4954,8 @@ CORE_ADDR gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_frame_args_address == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_frame_args_address invalid"); - /* Ignore predicate (gdbarch->deprecated_frame_args_address != get_frame_base). */ + gdb_assert (gdbarch->deprecated_frame_args_address != NULL); + /* Do not check predicate: gdbarch->deprecated_frame_args_address != get_frame_base, allow call. */ if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_args_address called\n"); return gdbarch->deprecated_frame_args_address (fi); @@ -5137,10 +4979,8 @@ CORE_ADDR gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_frame_locals_address == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_frame_locals_address invalid"); - /* Ignore predicate (gdbarch->deprecated_frame_locals_address != get_frame_base). */ + gdb_assert (gdbarch->deprecated_frame_locals_address != NULL); + /* Do not check predicate: gdbarch->deprecated_frame_locals_address != get_frame_base, allow call. */ if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_locals_address called\n"); return gdbarch->deprecated_frame_locals_address (fi); @@ -5157,16 +4997,14 @@ int gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_saved_pc_after_call != 0; + return gdbarch->deprecated_saved_pc_after_call != NULL; } CORE_ADDR gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame) { gdb_assert (gdbarch != NULL); - if (gdbarch->deprecated_saved_pc_after_call == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_deprecated_saved_pc_after_call invalid"); + gdb_assert (gdbarch->deprecated_saved_pc_after_call != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_saved_pc_after_call called\n"); return gdbarch->deprecated_saved_pc_after_call (frame); @@ -5183,16 +5021,14 @@ int gdbarch_frame_num_args_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->frame_num_args != 0; + return gdbarch->frame_num_args != NULL; } int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame) { gdb_assert (gdbarch != NULL); - if (gdbarch->frame_num_args == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_frame_num_args invalid"); + gdb_assert (gdbarch->frame_num_args != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n"); return gdbarch->frame_num_args (frame); @@ -5209,16 +5045,14 @@ int gdbarch_stack_align_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->stack_align != 0; + return gdbarch->stack_align != NULL; } CORE_ADDR gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp) { gdb_assert (gdbarch != NULL); - if (gdbarch->stack_align == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_stack_align invalid"); + gdb_assert (gdbarch->stack_align != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n"); return gdbarch->stack_align (sp); @@ -5235,16 +5069,14 @@ int gdbarch_frame_align_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->frame_align != 0; + return gdbarch->frame_align != NULL; } CORE_ADDR gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address) { gdb_assert (gdbarch != NULL); - if (gdbarch->frame_align == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_frame_align invalid"); + gdb_assert (gdbarch->frame_align != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n"); return gdbarch->frame_align (gdbarch, address); @@ -5261,16 +5093,14 @@ int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->reg_struct_has_addr != 0; + return gdbarch->reg_struct_has_addr != NULL; } int gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type) { gdb_assert (gdbarch != NULL); - if (gdbarch->reg_struct_has_addr == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_reg_struct_has_addr invalid"); + gdb_assert (gdbarch->reg_struct_has_addr != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n"); return gdbarch->reg_struct_has_addr (gcc_p, type); @@ -5351,9 +5181,7 @@ CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr) { gdb_assert (gdbarch != NULL); - if (gdbarch->convert_from_func_ptr_addr == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_convert_from_func_ptr_addr invalid"); + gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n"); return gdbarch->convert_from_func_ptr_addr (addr); @@ -5370,9 +5198,7 @@ CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr) { gdb_assert (gdbarch != NULL); - if (gdbarch->addr_bits_remove == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_addr_bits_remove invalid"); + gdb_assert (gdbarch->addr_bits_remove != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n"); return gdbarch->addr_bits_remove (addr); @@ -5389,9 +5215,7 @@ CORE_ADDR gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr) { gdb_assert (gdbarch != NULL); - if (gdbarch->smash_text_address == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_smash_text_address invalid"); + gdb_assert (gdbarch->smash_text_address != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n"); return gdbarch->smash_text_address (addr); @@ -5408,16 +5232,14 @@ int gdbarch_software_single_step_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->software_single_step != 0; + return gdbarch->software_single_step != NULL; } void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p) { gdb_assert (gdbarch != NULL); - if (gdbarch->software_single_step == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_software_single_step invalid"); + gdb_assert (gdbarch->software_single_step != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n"); gdbarch->software_single_step (sig, insert_breakpoints_p); @@ -5434,9 +5256,7 @@ int gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info) { gdb_assert (gdbarch != NULL); - if (gdbarch->print_insn == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_print_insn invalid"); + gdb_assert (gdbarch->print_insn != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n"); return gdbarch->print_insn (vma, info); @@ -5453,9 +5273,7 @@ CORE_ADDR gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc) { gdb_assert (gdbarch != NULL); - if (gdbarch->skip_trampoline_code == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_skip_trampoline_code invalid"); + gdb_assert (gdbarch->skip_trampoline_code != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n"); return gdbarch->skip_trampoline_code (pc); @@ -5472,9 +5290,7 @@ int gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name) { gdb_assert (gdbarch != NULL); - if (gdbarch->in_solib_call_trampoline == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_in_solib_call_trampoline invalid"); + gdb_assert (gdbarch->in_solib_call_trampoline != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_call_trampoline called\n"); return gdbarch->in_solib_call_trampoline (pc, name); @@ -5491,9 +5307,7 @@ int gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name) { gdb_assert (gdbarch != NULL); - if (gdbarch->in_solib_return_trampoline == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_in_solib_return_trampoline invalid"); + gdb_assert (gdbarch->in_solib_return_trampoline != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n"); return gdbarch->in_solib_return_trampoline (pc, name); @@ -5510,9 +5324,7 @@ int gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name) { gdb_assert (gdbarch != NULL); - if (gdbarch->pc_in_sigtramp == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_pc_in_sigtramp invalid"); + gdb_assert (gdbarch->pc_in_sigtramp != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_sigtramp called\n"); return gdbarch->pc_in_sigtramp (pc, name); @@ -5529,16 +5341,14 @@ int gdbarch_sigtramp_start_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->sigtramp_start != 0; + return gdbarch->sigtramp_start != NULL; } CORE_ADDR gdbarch_sigtramp_start (struct gdbarch *gdbarch, CORE_ADDR pc) { gdb_assert (gdbarch != NULL); - if (gdbarch->sigtramp_start == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_sigtramp_start invalid"); + gdb_assert (gdbarch->sigtramp_start != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_sigtramp_start called\n"); return gdbarch->sigtramp_start (pc); @@ -5555,16 +5365,14 @@ int gdbarch_sigtramp_end_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->sigtramp_end != 0; + return gdbarch->sigtramp_end != NULL; } CORE_ADDR gdbarch_sigtramp_end (struct gdbarch *gdbarch, CORE_ADDR pc) { gdb_assert (gdbarch != NULL); - if (gdbarch->sigtramp_end == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_sigtramp_end invalid"); + gdb_assert (gdbarch->sigtramp_end != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_sigtramp_end called\n"); return gdbarch->sigtramp_end (pc); @@ -5581,9 +5389,7 @@ int gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr) { gdb_assert (gdbarch != NULL); - if (gdbarch->in_function_epilogue_p == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_in_function_epilogue_p invalid"); + gdb_assert (gdbarch->in_function_epilogue_p != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n"); return gdbarch->in_function_epilogue_p (gdbarch, addr); @@ -5600,9 +5406,7 @@ char * gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv) { gdb_assert (gdbarch != NULL); - if (gdbarch->construct_inferior_arguments == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_construct_inferior_arguments invalid"); + gdb_assert (gdbarch->construct_inferior_arguments != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n"); return gdbarch->construct_inferior_arguments (gdbarch, argc, argv); @@ -5619,16 +5423,14 @@ int gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->dwarf2_build_frame_info != 0; + return gdbarch->dwarf2_build_frame_info != NULL; } void gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile) { gdb_assert (gdbarch != NULL); - if (gdbarch->dwarf2_build_frame_info == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_dwarf2_build_frame_info invalid"); + gdb_assert (gdbarch->dwarf2_build_frame_info != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_build_frame_info called\n"); gdbarch->dwarf2_build_frame_info (objfile); @@ -5645,9 +5447,7 @@ void gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym) { gdb_assert (gdbarch != NULL); - if (gdbarch->elf_make_msymbol_special == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_elf_make_msymbol_special invalid"); + gdb_assert (gdbarch->elf_make_msymbol_special != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n"); gdbarch->elf_make_msymbol_special (sym, msym); @@ -5664,9 +5464,7 @@ void gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym) { gdb_assert (gdbarch != NULL); - if (gdbarch->coff_make_msymbol_special == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_coff_make_msymbol_special invalid"); + gdb_assert (gdbarch->coff_make_msymbol_special != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n"); gdbarch->coff_make_msymbol_special (val, msym); @@ -5734,16 +5532,14 @@ int gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->address_class_type_flags != 0; + return gdbarch->address_class_type_flags != NULL; } int gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class) { gdb_assert (gdbarch != NULL); - if (gdbarch->address_class_type_flags == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_address_class_type_flags invalid"); + gdb_assert (gdbarch->address_class_type_flags != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n"); return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class); @@ -5760,16 +5556,14 @@ int gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->address_class_type_flags_to_name != 0; + return gdbarch->address_class_type_flags_to_name != NULL; } const char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags) { gdb_assert (gdbarch != NULL); - if (gdbarch->address_class_type_flags_to_name == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_address_class_type_flags_to_name invalid"); + gdb_assert (gdbarch->address_class_type_flags_to_name != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n"); return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags); @@ -5786,16 +5580,14 @@ int gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->address_class_name_to_type_flags != 0; + return gdbarch->address_class_name_to_type_flags != NULL; } int gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr) { gdb_assert (gdbarch != NULL); - if (gdbarch->address_class_name_to_type_flags == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_address_class_name_to_type_flags invalid"); + gdb_assert (gdbarch->address_class_name_to_type_flags != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n"); return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr); @@ -5812,9 +5604,7 @@ int gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup) { gdb_assert (gdbarch != NULL); - if (gdbarch->register_reggroup_p == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_register_reggroup_p invalid"); + gdb_assert (gdbarch->register_reggroup_p != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n"); return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup); @@ -5831,16 +5621,14 @@ int gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->fetch_pointer_argument != 0; + return gdbarch->fetch_pointer_argument != NULL; } CORE_ADDR gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type) { gdb_assert (gdbarch != NULL); - if (gdbarch->fetch_pointer_argument == 0) - internal_error (__FILE__, __LINE__, - "gdbarch: gdbarch_fetch_pointer_argument invalid"); + gdb_assert (gdbarch->fetch_pointer_argument != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n"); return gdbarch->fetch_pointer_argument (frame, argi, type); diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 02a1dc7c6be..06885598003 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -1733,7 +1733,7 @@ do then printf " return ${predicate};\n" else - printf " return gdbarch->${function} != 0;\n" + printf " return gdbarch->${function} != NULL;\n" fi printf "}\n" fi @@ -1749,13 +1749,11 @@ do fi printf "{\n" printf " gdb_assert (gdbarch != NULL);\n" - printf " if (gdbarch->${function} == 0)\n" - printf " internal_error (__FILE__, __LINE__,\n" - printf " \"gdbarch: gdbarch_${function} invalid\");\n" + printf " gdb_assert (gdbarch->${function} != NULL);\n" if class_is_predicate_p && test -n "${predicate}" then # Allow a call to a function with a predicate. - printf " /* Ignore predicate (${predicate}). */\n" + printf " /* Do not check predicate: ${predicate}, allow call. */\n" fi printf " if (gdbarch_debug >= 2)\n" printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n" @@ -1801,14 +1799,12 @@ do printf " /* Skip verify of ${function}, invalid_p == 0 */\n" elif [ -n "${invalid_p}" ] then - printf " if (${invalid_p})\n" - printf " internal_error (__FILE__, __LINE__,\n" - printf " \"gdbarch: gdbarch_${function} invalid\");\n" + printf " /* Check variable is valid. */\n" + printf " gdb_assert (!(${invalid_p}));\n" elif [ -n "${predefault}" ] then - printf " if (gdbarch->${function} == ${predefault})\n" - printf " internal_error (__FILE__, __LINE__,\n" - printf " \"gdbarch: gdbarch_${function} invalid\");\n" + printf " /* Check variable changed from pre-default. */\n" + printf " gdb_assert (gdbarch->${function} != ${predefault});\n" fi printf " if (gdbarch_debug >= 2)\n" printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n" -- 2.30.2