*/
+ int bits_big_endian;
int short_bit;
int int_bit;
int long_bit;
/*per-architecture data-pointers and swap regions */
0, NULL, NULL,
/* Multi-arch values */
+ 1, /* bits_big_endian */
8 * sizeof (short), /* short_bit */
8 * sizeof (int), /* int_bit */
8 * sizeof (long), /* long_bit */
-1, /* pc_regnum */
-1, /* ps_regnum */
0, /* fp0_regnum */
- 0, /* stab_reg_to_regnum */
- 0, /* ecoff_reg_to_regnum */
- 0, /* dwarf_reg_to_regnum */
- 0, /* sdb_reg_to_regnum */
- 0, /* dwarf2_reg_to_regnum */
+ no_op_reg_to_regnum, /* stab_reg_to_regnum */
+ no_op_reg_to_regnum, /* ecoff_reg_to_regnum */
+ no_op_reg_to_regnum, /* dwarf_reg_to_regnum */
+ no_op_reg_to_regnum, /* sdb_reg_to_regnum */
+ no_op_reg_to_regnum, /* dwarf2_reg_to_regnum */
0, /* register_name */
0, /* register_type */
0, /* unwind_dummy_id */
default_print_registers_info, /* print_registers_info */
0, /* print_float_info */
0, /* print_vector_info */
- 0, /* register_sim_regno */
- 0, /* cannot_fetch_register */
- 0, /* cannot_store_register */
+ legacy_register_sim_regno, /* register_sim_regno */
+ cannot_register_not, /* cannot_fetch_register */
+ cannot_register_not, /* cannot_store_register */
0, /* get_longjmp_target */
0, /* believe_pcc_promotion */
generic_convert_register_p, /* convert_register_p */
0, /* inner_than */
0, /* breakpoint_from_pc */
0, /* adjust_breakpoint_address */
- 0, /* memory_insert_breakpoint */
- 0, /* memory_remove_breakpoint */
+ default_memory_insert_breakpoint, /* memory_insert_breakpoint */
+ default_memory_remove_breakpoint, /* memory_remove_breakpoint */
0, /* decr_pc_after_break */
0, /* deprecated_function_start_offset */
default_remote_register_number, /* remote_register_number */
gdbarch->target_desc = info->target_desc;
/* Force the explicit initialization of these. */
+ gdbarch->bits_big_endian = (gdbarch->byte_order == BFD_ENDIAN_BIG);
gdbarch->short_bit = 2*TARGET_CHAR_BIT;
gdbarch->int_bit = 4*TARGET_CHAR_BIT;
gdbarch->long_bit = 4*TARGET_CHAR_BIT;
if (gdbarch->bfd_arch_info == NULL)
fprintf_unfiltered (log, "\n\tbfd_arch_info");
/* Check those that need to be defined for the given multi-arch level. */
+ /* Skip verify of bits_big_endian, invalid_p == 0 */
/* Skip verify of short_bit, invalid_p == 0 */
/* Skip verify of int_bit, invalid_p == 0 */
/* Skip verify of long_bit, invalid_p == 0 */
void
gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
{
- const char *gdb_xm_file = "<not-defined>";
const char *gdb_nm_file = "<not-defined>";
- const char *gdb_tm_file = "<not-defined>";
-#if defined (GDB_XM_FILE)
- gdb_xm_file = GDB_XM_FILE;
-#endif
- fprintf_unfiltered (file,
- "gdbarch_dump: GDB_XM_FILE = %s\n",
- gdb_xm_file);
#if defined (GDB_NM_FILE)
gdb_nm_file = GDB_NM_FILE;
#endif
fprintf_unfiltered (file,
"gdbarch_dump: GDB_NM_FILE = %s\n",
gdb_nm_file);
-#if defined (GDB_TM_FILE)
- gdb_tm_file = GDB_TM_FILE;
-#endif
- fprintf_unfiltered (file,
- "gdbarch_dump: GDB_TM_FILE = %s\n",
- gdb_tm_file);
fprintf_unfiltered (file,
"gdbarch_dump: addr_bit = %s\n",
paddr_d (gdbarch->addr_bit));
fprintf_unfiltered (file,
"gdbarch_dump: bfd_arch_info = %s\n",
gdbarch_bfd_arch_info (gdbarch)->printable_name);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: bits_big_endian = %s\n",
+ paddr_d (gdbarch->bits_big_endian));
fprintf_unfiltered (file,
"gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
(long) gdbarch->breakpoint_from_pc);
return gdbarch->target_desc;
}
+int
+gdbarch_bits_big_endian (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ /* Skip verify of bits_big_endian, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_bits_big_endian called\n");
+ return gdbarch->bits_big_endian;
+}
+
+void
+set_gdbarch_bits_big_endian (struct gdbarch *gdbarch,
+ int bits_big_endian)
+{
+ gdbarch->bits_big_endian = bits_big_endian;
+}
+
int
gdbarch_short_bit (struct gdbarch *gdbarch)
{
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);
+ return gdbarch->stab_reg_to_regnum (gdbarch, stab_regnr);
}
void
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);
+ return gdbarch->ecoff_reg_to_regnum (gdbarch, ecoff_regnr);
}
void
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);
+ return gdbarch->dwarf_reg_to_regnum (gdbarch, dwarf_regnr);
}
void
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);
+ return gdbarch->sdb_reg_to_regnum (gdbarch, sdb_regnr);
}
void
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);
+ return gdbarch->dwarf2_reg_to_regnum (gdbarch, dwarf2_regnr);
}
void
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);
+ return gdbarch->register_sim_regno (gdbarch, reg_nr);
}
void
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);
+ return gdbarch->cannot_fetch_register (gdbarch, regnum);
}
void
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);
+ return gdbarch->cannot_store_register (gdbarch, regnum);
}
void
gdb_assert (gdbarch->skip_prologue != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
- return gdbarch->skip_prologue (ip);
+ return gdbarch->skip_prologue (gdbarch, ip);
}
void
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 (bp_tgt);
+ return gdbarch->memory_insert_breakpoint (gdbarch, bp_tgt);
}
void
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 (bp_tgt);
+ return gdbarch->memory_remove_breakpoint (gdbarch, bp_tgt);
}
void