+2008-09-05 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * cris-tdep.c (cris_version, cris_mode): Remove.
+ (crisv32_single_step_through_delay): Use tdep->cris_mode.
+ (cris_breakpoint_from_pc): Likewise.
+ (cris_frame_unwind_cache): Use tdep->cris_version.
+ (crisv32_scan_prologue): Likewise.
+ (cris_spec_reg_applicable): Add gdbarch argument.
+ Use tdep->cris_version.
+ (cris_register_size, cris_special_register_name): Update calls.
+ (cris_special_register_name): Add gdbarch argument.
+ (cris_register_name, crisv32_register_name): Update calls.
+
2008-09-05 Ulrich Weigand <uweigand@de.ibm.com>
* m68hc11-tdep.c (gdb_print_insn_m68hc11): Use info->arch
int cris_dwarf2_cfi;
};
-/* Functions for accessing target dependent data. */
-
-static int
-cris_version (void)
-{
- return (gdbarch_tdep (current_gdbarch)->cris_version);
-}
-
-static const char *
-cris_mode (void)
-{
- return (gdbarch_tdep (current_gdbarch)->cris_mode);
-}
-
/* Sigtramp identification code copied from i386-linux-tdep.c. */
#define SIGTRAMP_INSN0 0x9c5f /* movu.w 0xXX, $r9 */
ULONGEST erp;
int ret = 0;
- if (cris_mode () == cris_mode_guru)
+ if (tdep->cris_mode == cris_mode_guru)
erp = get_frame_register_unsigned (this_frame, NRP_REGNUM);
else
erp = get_frame_register_unsigned (this_frame, ERP_REGNUM);
cris_frame_unwind_cache (struct frame_info *this_frame,
void **this_prologue_cache)
{
+ struct gdbarch *gdbarch = get_frame_arch (this_frame);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
CORE_ADDR pc;
struct cris_unwind_cache *info;
int i;
info->leaf_function = 0;
/* Prologue analysis does the rest... */
- if (cris_version () == 32)
+ if (tdep->cris_version == 32)
crisv32_scan_prologue (get_frame_func (this_frame), this_frame, info);
else
cris_scan_prologue (get_frame_func (this_frame), this_frame, info);
static CORE_ADDR
cris_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
CORE_ADDR func_addr, func_end;
struct symtab_and_line sal;
CORE_ADDR pc_after_prologue;
return sal.end;
}
- if (cris_version () == 32)
+ if (tdep->cris_version == 32)
pc_after_prologue = crisv32_scan_prologue (pc, NULL, NULL);
else
pc_after_prologue = cris_scan_prologue (pc, NULL, NULL);
static const unsigned char *
cris_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
static unsigned char break8_insn[] = {0x38, 0xe9};
static unsigned char break15_insn[] = {0x3f, 0xe9};
*lenptr = 2;
- if (cris_mode () == cris_mode_guru)
+ if (tdep->cris_mode == cris_mode_guru)
return break15_insn;
else
return break8_insn;
0 otherwise. */
static int
-cris_spec_reg_applicable (struct cris_spec_reg spec_reg)
+cris_spec_reg_applicable (struct gdbarch *gdbarch,
+ struct cris_spec_reg spec_reg)
{
- int version = cris_version ();
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ int version = tdep->cris_version;
switch (spec_reg.applicable_version)
{
for (i = 0; cris_spec_regs[i].name != NULL; i++)
{
if (cris_spec_regs[i].number == spec_regno
- && cris_spec_reg_applicable (cris_spec_regs[i]))
+ && cris_spec_reg_applicable (gdbarch, cris_spec_regs[i]))
/* Go with the first applicable register. */
return cris_spec_regs[i].reg_size;
}
unimplemented register. */
static const char *
-cris_special_register_name (int regno)
+cris_special_register_name (struct gdbarch *gdbarch, int regno)
{
int spec_regno;
int i;
for (i = 0; cris_spec_regs[i].name != NULL; i++)
{
if (cris_spec_regs[i].number == spec_regno
- && cris_spec_reg_applicable (cris_spec_regs[i]))
+ && cris_spec_reg_applicable (gdbarch, cris_spec_regs[i]))
/* Go with the first applicable register. */
return cris_spec_regs[i].name;
}
}
else if (regno >= NUM_GENREGS && regno < gdbarch_num_regs (gdbarch))
{
- return cris_special_register_name (regno);
+ return cris_special_register_name (gdbarch, regno);
}
else
{
}
else if (regno >= NUM_GENREGS && regno < (NUM_GENREGS + NUM_SPECREGS))
{
- return cris_special_register_name (regno);
+ return cris_special_register_name (gdbarch, regno);
}
else if (regno == gdbarch_pc_regnum (gdbarch))
{