*/
+ int bits_big_endian;
int short_bit;
int int_bit;
int long_bit;
gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
gdbarch_register_name_ftype *register_name;
gdbarch_register_type_ftype *register_type;
- gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
+ gdbarch_dummy_id_ftype *dummy_id;
int deprecated_fp_regnum;
gdbarch_push_dummy_call_ftype *push_dummy_call;
int call_dummy_location;
gdbarch_core_read_description_ftype *core_read_description;
gdbarch_static_transform_name_ftype *static_transform_name;
int sofun_address_maybe_missing;
+ gdbarch_target_signal_from_host_ftype *target_signal_from_host;
+ gdbarch_target_signal_to_host_ftype *target_signal_to_host;
};
/*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 */
+ 0, /* dummy_id */
-1, /* deprecated_fp_regnum */
0, /* push_dummy_call */
0, /* call_dummy_location */
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 */
0, /* core_read_description */
0, /* static_transform_name */
0, /* sofun_address_maybe_missing */
+ default_target_signal_from_host, /* target_signal_from_host */
+ default_target_signal_to_host, /* target_signal_to_host */
/* startup_gdbarch() */
};
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;
gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
gdbarch->name_of_malloc = "malloc";
gdbarch->register_reggroup_p = default_register_reggroup_p;
+ gdbarch->target_signal_from_host = default_target_signal_from_host;
+ gdbarch->target_signal_to_host = default_target_signal_to_host;
/* gdbarch_alloc() */
return gdbarch;
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 */
if (gdbarch->register_name == 0)
fprintf_unfiltered (log, "\n\tregister_name");
/* Skip verify of register_type, has predicate */
- /* Skip verify of unwind_dummy_id, has predicate */
+ /* Skip verify of dummy_id, has predicate */
/* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
/* Skip verify of push_dummy_call, has predicate */
/* Skip verify of call_dummy_location, invalid_p == 0 */
/* Skip verify of core_read_description, has predicate */
/* Skip verify of static_transform_name, has predicate */
/* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
+ /* Skip verify of target_signal_from_host, invalid_p == 0 */
+ /* Skip verify of target_signal_to_host, invalid_p == 0 */
buf = ui_file_xstrdup (log, &dummy);
make_cleanup (xfree, buf);
if (strlen (buf) > 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);
fprintf_unfiltered (file,
"gdbarch_dump: double_format = %s\n",
pformat (gdbarch->double_format));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
+ gdbarch_dummy_id_p (gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: dummy_id = <0x%lx>\n",
+ (long) gdbarch->dummy_id);
fprintf_unfiltered (file,
"gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
(long) gdbarch->dwarf2_reg_to_regnum);
"gdbarch_dump: target_desc = %s\n",
paddr_d ((long) gdbarch->target_desc));
fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
- gdbarch_unwind_dummy_id_p (gdbarch));
+ "gdbarch_dump: target_signal_from_host = <0x%lx>\n",
+ (long) gdbarch->target_signal_from_host);
fprintf_unfiltered (file,
- "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
- (long) gdbarch->unwind_dummy_id);
+ "gdbarch_dump: target_signal_to_host = <0x%lx>\n",
+ (long) gdbarch->target_signal_to_host);
fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
gdbarch_unwind_pc_p (gdbarch));
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
}
int
-gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
+gdbarch_dummy_id_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- return gdbarch->unwind_dummy_id != NULL;
+ return gdbarch->dummy_id != NULL;
}
struct frame_id
-gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
+gdbarch_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
{
gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->unwind_dummy_id != NULL);
+ gdb_assert (gdbarch->dummy_id != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
- return gdbarch->unwind_dummy_id (gdbarch, info);
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_dummy_id called\n");
+ return gdbarch->dummy_id (gdbarch, this_frame);
}
void
-set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
- gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
+set_gdbarch_dummy_id (struct gdbarch *gdbarch,
+ gdbarch_dummy_id_ftype dummy_id)
{
- gdbarch->unwind_dummy_id = unwind_dummy_id;
+ gdbarch->dummy_id = dummy_id;
}
int
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
}
enum return_value_convention
-gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
+gdbarch_return_value (struct gdbarch *gdbarch, struct type *functype, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->return_value != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
- return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
+ return gdbarch->return_value (gdbarch, functype, valtype, regcache, readbuf, writebuf);
}
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
gdbarch->sofun_address_maybe_missing = sofun_address_maybe_missing;
}
+enum target_signal
+gdbarch_target_signal_from_host (struct gdbarch *gdbarch, int signo)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->target_signal_from_host != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_from_host called\n");
+ return gdbarch->target_signal_from_host (gdbarch, signo);
+}
+
+void
+set_gdbarch_target_signal_from_host (struct gdbarch *gdbarch,
+ gdbarch_target_signal_from_host_ftype target_signal_from_host)
+{
+ gdbarch->target_signal_from_host = target_signal_from_host;
+}
+
+int
+gdbarch_target_signal_to_host (struct gdbarch *gdbarch, enum target_signal ts)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->target_signal_to_host != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_to_host called\n");
+ return gdbarch->target_signal_to_host (gdbarch, ts);
+}
+
+void
+set_gdbarch_target_signal_to_host (struct gdbarch *gdbarch,
+ gdbarch_target_signal_to_host_ftype target_signal_to_host)
+{
+ gdbarch->target_signal_to_host = target_signal_to_host;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */