int mips_linux_restart_reg_p (struct gdbarch *gdbarch) { /* If we do not have a target description with registers, then MIPS_RESTART_REGNUM will not be included in the register set. */ if (!tdesc_has_registers (gdbarch_target_desc (gdbarch))) return 0; /* If we do, then MIPS_RESTART_REGNUM is safe to check; it will either be GPR-sized or missing. */ return register_size (gdbarch, MIPS_RESTART_REGNUM) > 0; }
/* Return 1 if PPC_ORIG_R3_REGNUM and PPC_TRAP_REGNUM are usable. */ int ppc_linux_trap_reg_p (struct gdbarch *gdbarch) { /* If we do not have a target description with registers, then the special registers will not be included in the register set. */ if (!tdesc_has_registers (gdbarch_target_desc (gdbarch))) return 0; /* If we do, then it is safe to check the size. */ return register_size (gdbarch, PPC_ORIG_R3_REGNUM) > 0 && register_size (gdbarch, PPC_TRAP_REGNUM) > 0; }
static const char * tic6x_register_name (struct gdbarch *gdbarch, int regno) { if (regno < 0) return NULL; if (tdesc_has_registers (gdbarch_target_desc (gdbarch))) return tdesc_register_name (gdbarch, regno); else if (regno >= ARRAY_SIZE (tic6x_register_names)) return ""; else return tic6x_register_names[regno]; }
static struct type * nios2_register_type (struct gdbarch *gdbarch, int regno) { /* If the XML description has register information, use that to determine the register type. */ if (tdesc_has_registers (gdbarch_target_desc (gdbarch))) return tdesc_register_type (gdbarch, regno); if (regno == NIOS2_PC_REGNUM) return builtin_type (gdbarch)->builtin_func_ptr; else if (regno == NIOS2_SP_REGNUM) return builtin_type (gdbarch)->builtin_data_ptr; else return builtin_type (gdbarch)->builtin_uint32; }