aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-05-03 21:05:36 +0000
committerAndrew Cagney <cagney@redhat.com>2002-05-03 21:05:36 +0000
commit8de9bdc4dfe26bfe7aa7782b8cbb233c9c56b3b5 (patch)
tree293787e1bad47eeae39501927ae3196b5ebcddb0
parent7c5fcef7ab6d53fff7cc301cb00b8cb9ea1797fe (diff)
downloadgdb-8de9bdc4dfe26bfe7aa7782b8cbb233c9c56b3b5.zip
gdb-8de9bdc4dfe26bfe7aa7782b8cbb233c9c56b3b5.tar.gz
gdb-8de9bdc4dfe26bfe7aa7782b8cbb233c9c56b3b5.tar.bz2
* gdbarch.sh: Assert that gdbarch is non-NULL.
* gdbarch.c: Regenerate.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/gdbarch.c146
-rwxr-xr-xgdb/gdbarch.sh4
3 files changed, 155 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6340748..35004d8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2002-05-03 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh: Assert that gdbarch is non-NULL.
+ * gdbarch.c: Regenerate.
+
2002-05-03 Jason Merrill <jason@redhat.com>
* gnu-v3-abi.c (gnuv3_rtti_type): If we get confused, just warn
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index f7248fc..ce4540d 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -2170,6 +2170,7 @@ gdbarch_tdep (struct gdbarch *gdbarch)
const struct bfd_arch_info *
gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
return gdbarch->bfd_arch_info;
@@ -2178,6 +2179,7 @@ gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
int
gdbarch_byte_order (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
return gdbarch->byte_order;
@@ -2186,6 +2188,7 @@ gdbarch_byte_order (struct gdbarch *gdbarch)
int
gdbarch_short_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of short_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
@@ -2202,6 +2205,7 @@ set_gdbarch_short_bit (struct gdbarch *gdbarch,
int
gdbarch_int_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of int_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
@@ -2218,6 +2222,7 @@ set_gdbarch_int_bit (struct gdbarch *gdbarch,
int
gdbarch_long_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of long_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
@@ -2234,6 +2239,7 @@ set_gdbarch_long_bit (struct gdbarch *gdbarch,
int
gdbarch_long_long_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of long_long_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
@@ -2250,6 +2256,7 @@ set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
int
gdbarch_float_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of float_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
@@ -2266,6 +2273,7 @@ set_gdbarch_float_bit (struct gdbarch *gdbarch,
int
gdbarch_double_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of double_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
@@ -2282,6 +2290,7 @@ set_gdbarch_double_bit (struct gdbarch *gdbarch,
int
gdbarch_long_double_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of long_double_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
@@ -2298,6 +2307,7 @@ set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
int
gdbarch_ptr_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of ptr_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
@@ -2314,6 +2324,7 @@ set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
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");
@@ -2332,6 +2343,7 @@ set_gdbarch_addr_bit (struct gdbarch *gdbarch,
int
gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of bfd_vma_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
@@ -2348,6 +2360,7 @@ set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
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");
@@ -2366,6 +2379,7 @@ set_gdbarch_char_signed (struct gdbarch *gdbarch,
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");
@@ -2384,6 +2398,7 @@ set_gdbarch_read_pc (struct gdbarch *gdbarch,
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");
@@ -2402,6 +2417,7 @@ set_gdbarch_write_pc (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_read_fp (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->read_fp == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_read_fp invalid");
@@ -2420,6 +2436,7 @@ set_gdbarch_read_fp (struct gdbarch *gdbarch,
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");
@@ -2438,6 +2455,7 @@ set_gdbarch_read_sp (struct gdbarch *gdbarch,
void
gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->write_sp == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_write_sp invalid");
@@ -2456,6 +2474,7 @@ set_gdbarch_write_sp (struct gdbarch *gdbarch,
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");
@@ -2474,12 +2493,14 @@ set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
int
gdbarch_register_read_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->register_read != 0;
}
void
gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_read == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_read invalid");
@@ -2498,12 +2519,14 @@ set_gdbarch_register_read (struct gdbarch *gdbarch,
int
gdbarch_register_write_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->register_write != 0;
}
void
gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_write == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_write invalid");
@@ -2522,6 +2545,7 @@ set_gdbarch_register_write (struct gdbarch *gdbarch,
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");
@@ -2540,6 +2564,7 @@ set_gdbarch_num_regs (struct gdbarch *gdbarch,
int
gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of num_pseudo_regs, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
@@ -2556,6 +2581,7 @@ set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
int
gdbarch_sp_regnum (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of sp_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
@@ -2572,6 +2598,7 @@ set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
int
gdbarch_fp_regnum (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of fp_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
@@ -2588,6 +2615,7 @@ set_gdbarch_fp_regnum (struct gdbarch *gdbarch,
int
gdbarch_pc_regnum (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of pc_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
@@ -2604,6 +2632,7 @@ set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
int
gdbarch_ps_regnum (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of ps_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
@@ -2620,6 +2649,7 @@ set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
int
gdbarch_fp0_regnum (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of fp0_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
@@ -2636,6 +2666,7 @@ set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
int
gdbarch_npc_regnum (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of npc_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n");
@@ -2652,6 +2683,7 @@ set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
int
gdbarch_nnpc_regnum (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of nnpc_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_nnpc_regnum called\n");
@@ -2668,6 +2700,7 @@ set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch,
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");
@@ -2686,6 +2719,7 @@ set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
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");
@@ -2704,6 +2738,7 @@ set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
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");
@@ -2722,6 +2757,7 @@ set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
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");
@@ -2740,6 +2776,7 @@ set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
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");
@@ -2758,6 +2795,7 @@ set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
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");
@@ -2776,6 +2814,7 @@ set_gdbarch_register_name (struct gdbarch *gdbarch,
int
gdbarch_register_size (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_size == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_size invalid");
@@ -2794,6 +2833,7 @@ set_gdbarch_register_size (struct gdbarch *gdbarch,
int
gdbarch_register_bytes (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_bytes == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_bytes invalid");
@@ -2812,6 +2852,7 @@ set_gdbarch_register_bytes (struct gdbarch *gdbarch,
int
gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_byte == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_byte invalid");
@@ -2830,6 +2871,7 @@ set_gdbarch_register_byte (struct gdbarch *gdbarch,
int
gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_raw_size == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_raw_size invalid");
@@ -2848,6 +2890,7 @@ set_gdbarch_register_raw_size (struct gdbarch *gdbarch,
int
gdbarch_max_register_raw_size (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->max_register_raw_size == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_max_register_raw_size invalid");
@@ -2866,6 +2909,7 @@ set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch,
int
gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_virtual_size == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_virtual_size invalid");
@@ -2884,6 +2928,7 @@ set_gdbarch_register_virtual_size (struct gdbarch *gdbarch,
int
gdbarch_max_register_virtual_size (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->max_register_virtual_size == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_max_register_virtual_size invalid");
@@ -2902,6 +2947,7 @@ set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch,
struct type *
gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_virtual_type == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_virtual_type invalid");
@@ -2920,6 +2966,7 @@ set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
void
gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->do_registers_info == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_do_registers_info invalid");
@@ -2938,6 +2985,7 @@ set_gdbarch_do_registers_info (struct gdbarch *gdbarch,
void
gdbarch_print_float_info (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->print_float_info == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_print_float_info invalid");
@@ -2956,6 +3004,7 @@ set_gdbarch_print_float_info (struct gdbarch *gdbarch,
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");
@@ -2974,12 +3023,14 @@ set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
int
gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->register_bytes_ok != 0;
}
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");
@@ -2998,6 +3049,7 @@ set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
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");
@@ -3016,6 +3068,7 @@ set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
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");
@@ -3034,12 +3087,14 @@ set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
int
gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->get_longjmp_target != 0;
}
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");
@@ -3058,6 +3113,7 @@ set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
int
gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->use_generic_dummy_frames == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_use_generic_dummy_frames invalid");
@@ -3076,6 +3132,7 @@ set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch,
int
gdbarch_call_dummy_location (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_location == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_location invalid");
@@ -3094,6 +3151,7 @@ set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
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");
@@ -3112,6 +3170,7 @@ set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_start_offset == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_start_offset invalid");
@@ -3130,6 +3189,7 @@ set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
@@ -3148,6 +3208,7 @@ set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
int
gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_breakpoint_offset_p == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
@@ -3166,6 +3227,7 @@ set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch,
int
gdbarch_call_dummy_length (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_length == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_length invalid");
@@ -3184,6 +3246,7 @@ set_gdbarch_call_dummy_length (struct gdbarch *gdbarch,
int
gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->pc_in_call_dummy == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_pc_in_call_dummy invalid");
@@ -3202,6 +3265,7 @@ set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch,
int
gdbarch_call_dummy_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_p == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_p invalid");
@@ -3220,6 +3284,7 @@ set_gdbarch_call_dummy_p (struct gdbarch *gdbarch,
LONGEST *
gdbarch_call_dummy_words (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of call_dummy_words, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
@@ -3236,6 +3301,7 @@ set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
int
gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
@@ -3252,6 +3318,7 @@ set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch,
int
gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_stack_adjust_p == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
@@ -3270,6 +3337,7 @@ set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch,
int
gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_stack_adjust invalid");
@@ -3288,6 +3356,7 @@ set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch,
void
gdbarch_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->fix_call_dummy == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_fix_call_dummy invalid");
@@ -3306,6 +3375,7 @@ set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
void
gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->init_frame_pc_first == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_init_frame_pc_first invalid");
@@ -3324,6 +3394,7 @@ set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch,
void
gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->init_frame_pc == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_init_frame_pc invalid");
@@ -3342,6 +3413,7 @@ set_gdbarch_init_frame_pc (struct gdbarch *gdbarch,
int
gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
return gdbarch->believe_pcc_promotion;
@@ -3357,6 +3429,7 @@ set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
int
gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n");
return gdbarch->believe_pcc_promotion_type;
@@ -3372,6 +3445,7 @@ set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
int
gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->coerce_float_to_double == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_coerce_float_to_double invalid");
@@ -3390,6 +3464,7 @@ set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch,
void
gdbarch_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->get_saved_register == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_get_saved_register invalid");
@@ -3408,6 +3483,7 @@ set_gdbarch_get_saved_register (struct gdbarch *gdbarch,
int
gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_convertible == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_convertible invalid");
@@ -3426,6 +3502,7 @@ set_gdbarch_register_convertible (struct gdbarch *gdbarch,
void
gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_convert_to_virtual == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_convert_to_virtual invalid");
@@ -3444,6 +3521,7 @@ set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch,
void
gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_convert_to_raw == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_convert_to_raw invalid");
@@ -3462,12 +3540,14 @@ set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch,
int
gdbarch_fetch_pseudo_register_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->fetch_pseudo_register != 0;
}
void
gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->fetch_pseudo_register == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_fetch_pseudo_register invalid");
@@ -3486,12 +3566,14 @@ set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch,
int
gdbarch_store_pseudo_register_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->store_pseudo_register != 0;
}
void
gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->store_pseudo_register == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_store_pseudo_register invalid");
@@ -3510,6 +3592,7 @@ set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->pointer_to_address == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_pointer_to_address invalid");
@@ -3528,6 +3611,7 @@ set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
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");
@@ -3546,12 +3630,14 @@ set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
int
gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->integer_to_address != 0;
}
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");
@@ -3570,6 +3656,7 @@ set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
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");
@@ -3588,6 +3675,7 @@ set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
void
gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->extract_return_value == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_extract_return_value invalid");
@@ -3606,6 +3694,7 @@ set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_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->push_arguments == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_push_arguments invalid");
@@ -3624,6 +3713,7 @@ set_gdbarch_push_arguments (struct gdbarch *gdbarch,
void
gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->push_dummy_frame == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_push_dummy_frame invalid");
@@ -3642,12 +3732,14 @@ set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch,
int
gdbarch_push_return_address_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->push_return_address != 0;
}
CORE_ADDR
gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->push_return_address == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_push_return_address invalid");
@@ -3666,6 +3758,7 @@ set_gdbarch_push_return_address (struct gdbarch *gdbarch,
void
gdbarch_pop_frame (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->pop_frame == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_pop_frame invalid");
@@ -3684,6 +3777,7 @@ set_gdbarch_pop_frame (struct gdbarch *gdbarch,
void
gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->store_struct_return == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_store_struct_return invalid");
@@ -3702,6 +3796,7 @@ set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
void
gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->store_return_value == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_store_return_value invalid");
@@ -3720,12 +3815,14 @@ set_gdbarch_store_return_value (struct gdbarch *gdbarch,
int
gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->extract_struct_value_address != 0;
}
CORE_ADDR
gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->extract_struct_value_address == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_extract_struct_value_address invalid");
@@ -3744,6 +3841,7 @@ set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch,
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");
@@ -3762,6 +3860,7 @@ set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
void
gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frame_init_saved_regs == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frame_init_saved_regs invalid");
@@ -3780,12 +3879,14 @@ set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch,
int
gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->init_extra_frame_info != 0;
}
void
gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->init_extra_frame_info == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_init_extra_frame_info invalid");
@@ -3804,6 +3905,7 @@ set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch,
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");
@@ -3822,6 +3924,7 @@ set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
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");
@@ -3840,6 +3943,7 @@ set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch,
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");
@@ -3858,6 +3962,7 @@ set_gdbarch_inner_than (struct gdbarch *gdbarch,
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");
@@ -3876,6 +3981,7 @@ set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
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");
@@ -3894,6 +4000,7 @@ set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
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");
@@ -3912,6 +4019,7 @@ set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
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");
@@ -3930,6 +4038,7 @@ set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
int
gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->prepare_to_proceed == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_prepare_to_proceed invalid");
@@ -3948,6 +4057,7 @@ set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch,
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");
@@ -3966,6 +4076,7 @@ set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
void
gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, 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");
@@ -3984,6 +4095,7 @@ set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
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");
@@ -4002,6 +4114,7 @@ set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
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");
@@ -4020,6 +4133,7 @@ set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frame_chain == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frame_chain invalid");
@@ -4038,6 +4152,7 @@ set_gdbarch_frame_chain (struct gdbarch *gdbarch,
int
gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frame_chain_valid == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frame_chain_valid invalid");
@@ -4056,6 +4171,7 @@ set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frame_saved_pc == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frame_saved_pc invalid");
@@ -4074,6 +4190,7 @@ set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frame_args_address == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frame_args_address invalid");
@@ -4092,6 +4209,7 @@ set_gdbarch_frame_args_address (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frame_locals_address == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frame_locals_address invalid");
@@ -4110,6 +4228,7 @@ set_gdbarch_frame_locals_address (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->saved_pc_after_call == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_saved_pc_after_call invalid");
@@ -4128,6 +4247,7 @@ set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch,
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");
@@ -4146,12 +4266,14 @@ set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
int
gdbarch_stack_align_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->stack_align != 0;
}
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");
@@ -4170,6 +4292,7 @@ set_gdbarch_stack_align (struct gdbarch *gdbarch,
int
gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n");
@@ -4186,12 +4309,14 @@ set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch,
int
gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->reg_struct_has_addr != 0;
}
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");
@@ -4210,12 +4335,14 @@ set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch,
int
gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->save_dummy_frame_tos != 0;
}
void
gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->save_dummy_frame_tos == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_save_dummy_frame_tos invalid");
@@ -4234,6 +4361,7 @@ set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
int
gdbarch_parm_boundary (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_parm_boundary called\n");
return gdbarch->parm_boundary;
@@ -4249,6 +4377,7 @@ set_gdbarch_parm_boundary (struct gdbarch *gdbarch,
const struct floatformat *
gdbarch_float_format (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
return gdbarch->float_format;
@@ -4264,6 +4393,7 @@ set_gdbarch_float_format (struct gdbarch *gdbarch,
const struct floatformat *
gdbarch_double_format (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
return gdbarch->double_format;
@@ -4279,6 +4409,7 @@ set_gdbarch_double_format (struct gdbarch *gdbarch,
const struct floatformat *
gdbarch_long_double_format (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
return gdbarch->long_double_format;
@@ -4294,6 +4425,7 @@ set_gdbarch_long_double_format (struct gdbarch *gdbarch,
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");
@@ -4312,6 +4444,7 @@ set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
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");
@@ -4330,6 +4463,7 @@ set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
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");
@@ -4348,12 +4482,14 @@ set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
int
gdbarch_software_single_step_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->software_single_step != 0;
}
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");
@@ -4372,6 +4508,7 @@ set_gdbarch_software_single_step (struct gdbarch *gdbarch,
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");
@@ -4390,6 +4527,7 @@ set_gdbarch_print_insn (struct gdbarch *gdbarch,
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");
@@ -4408,6 +4546,7 @@ set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
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");
@@ -4426,6 +4565,7 @@ set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch,
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");
@@ -4444,6 +4584,7 @@ set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch,
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");
@@ -4462,6 +4603,7 @@ set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
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");
@@ -4480,12 +4622,14 @@ set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
int
gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->dwarf2_build_frame_info != 0;
}
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");
@@ -4504,6 +4648,7 @@ set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch,
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");
@@ -4522,6 +4667,7 @@ set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
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");
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index e1442f3..1dd2990 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -1628,6 +1628,7 @@ do
printf "int\n"
printf "gdbarch_${function}_p (struct gdbarch *gdbarch)\n"
printf "{\n"
+ printf " gdb_assert (gdbarch != NULL);\n"
if [ -n "${valid_p}" ]
then
printf " return ${valid_p};\n"
@@ -1647,6 +1648,7 @@ do
printf "gdbarch_${function} (struct gdbarch *gdbarch, ${formal})\n"
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"
@@ -1688,6 +1690,7 @@ do
printf "${returntype}\n"
printf "gdbarch_${function} (struct gdbarch *gdbarch)\n"
printf "{\n"
+ printf " gdb_assert (gdbarch != NULL);\n"
if [ "x${invalid_p}" = "x0" ]
then
printf " /* Skip verify of ${function}, invalid_p == 0 */\n"
@@ -1719,6 +1722,7 @@ do
printf "${returntype}\n"
printf "gdbarch_${function} (struct gdbarch *gdbarch)\n"
printf "{\n"
+ printf " gdb_assert (gdbarch != NULL);\n"
printf " if (gdbarch_debug >= 2)\n"
printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n"
printf " return gdbarch->${function};\n"