+2001-12-09 Andrew Cagney <ac131313@redhat.com>
+
+ * arch-utils.c (generic_register_raw_size): New function.
+ * gdbarch.sh (REGISTER_RAW_SIZE): Use generic_register_raw_size as
+ the static default.
+ * gdbarch.c: Regenerate.
+ * arch-utils.h (generic_register_raw_size): Declare.
+
+ * config/mips/tm-mips.h (REGISTER_RAW_SIZE): Delete macro.
+ * mips-tdep.c (mips_register_raw_size): Make function static.
+ (mips_gdbarch_init): Initialize register_raw_size.
+
2001-12-08 Fred Fish <fnf@redhat.com>
* dwarf2read.c (read_typedef): Replace hand crafted type
*frame_regnum = FP_REGNUM;
*frame_offset = 0;
}
+
+/* Assume the world is flat. Every register is large enough to fit a
+ target integer. */
+
+int
+generic_register_raw_size (int regnum)
+{
+ gdb_assert (regnum >= 0 && regnum < NUM_REGS + NUM_PSEUDO_REGS);
+ return TARGET_INT_BIT / HOST_CHAR_BIT;
+}
+
\f
/* Functions to manipulate the endianness of the target. */
extern int generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc);
+/* Assume all registers are the same size and a size identical to that
+ of the integer type. */
+extern int generic_register_raw_size (int regnum);
+
#endif
#define REGISTER_BYTE(N) ((N) * MIPS_REGSIZE)
-/* Number of bytes of storage in the actual machine representation for
- register N. NOTE: This indirectly defines the register size
- transfered by the GDB protocol. */
-
-extern int mips_register_raw_size (int reg_nr);
-#define REGISTER_RAW_SIZE(N) (mips_register_raw_size ((N)))
-
-
/* Covert between the RAW and VIRTUAL registers.
Some MIPS (SR, FSR, FIR) have a `raw' size of MIPS_REGSIZE but are
0,
0,
0,
- 0,
+ generic_register_raw_size,
0,
0,
0,
v:2:REGISTER_SIZE:int:register_size::::0:-1
v:2:REGISTER_BYTES:int:register_bytes::::0:-1
f:2:REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::0:0
-f:2:REGISTER_RAW_SIZE:int:register_raw_size:int reg_nr:reg_nr::0:0
+f:2:REGISTER_RAW_SIZE:int:register_raw_size:int reg_nr:reg_nr::generic_register_raw_size:0
v:2:MAX_REGISTER_RAW_SIZE:int:max_register_raw_size::::0:-1
f:2:REGISTER_VIRTUAL_SIZE:int:register_virtual_size:int reg_nr:reg_nr::0:0
v:2:MAX_REGISTER_VIRTUAL_SIZE:int:max_register_virtual_size::::0:-1
paddr_d (fi->extra_info->proc_desc->pdr.frameoffset));
}
-/* Convert between RAW and VIRTUAL registers. The RAW register size
- defines the remote-gdb packet. */
+/* Number of bytes of storage in the actual machine representation for
+ register N. NOTE: This indirectly defines the register size
+ transfered by the GDB protocol. */
static int mips64_transfers_32bit_regs_p = 0;
return MIPS_REGSIZE;
}
+/* Convert between RAW and VIRTUAL registers. The RAW register size
+ defines the remote-gdb packet. */
+
int
mips_register_convertible (int reg_nr)
{
gdbarch = gdbarch_alloc (&info, tdep);
tdep->elf_flags = elf_flags;
- /* Initially set everything according to the ABI. */
+ /* Initially set everything according to the default ABI/ISA. */
set_gdbarch_short_bit (gdbarch, 16);
set_gdbarch_int_bit (gdbarch, 32);
set_gdbarch_float_bit (gdbarch, 32);
set_gdbarch_double_bit (gdbarch, 64);
set_gdbarch_long_double_bit (gdbarch, 64);
+ set_gdbarch_register_raw_size (gdbarch, mips_register_raw_size);
tdep->mips_abi = mips_abi;
switch (mips_abi)