i386_register_byte. Made static.
(i386_register_size): Renamed from i386_register_raw_size. Made
static.
(i386_register_virtual_size): Removed.
(i386_register_byte, i386_register_raw_size,
i386_register_virtual_size): New functions.
(_initialize_i386_tdep): Initialize i386_register_offset instead
of i386_register_byte. Remove code to initialize
i386_register_virtual_size.
* config/i386/tm-i386.h (REGISTER_BYTE): Redefine to use
i386_register_byte function.
(REGISTER_RAW_SIZE): Redefine to use i386_register_raw_size
function.
(REGISTER_VIRTUAL_SIZE): Redefine to use
i386_register_virtual_size function.
(i386_register_byte, i386_register_raw_size,
i386_register_virtual_size): New functions.
2001-11-04 Mark Kettenis <kettenis@gnu.org>
+ * i386-tdep.c (i386_register_offset): Renamed from
+ i386_register_byte. Made static.
+ (i386_register_size): Renamed from i386_register_raw_size. Made
+ static.
+ (i386_register_virtual_size): Removed.
+ (i386_register_byte, i386_register_raw_size,
+ i386_register_virtual_size): New functions.
+ (_initialize_i386_tdep): Initialize i386_register_offset instead
+ of i386_register_byte. Remove code to initialize
+ i386_register_virtual_size.
+ * config/i386/tm-i386.h (REGISTER_BYTE): Redefine to use
+ i386_register_byte function.
+ (REGISTER_RAW_SIZE): Redefine to use i386_register_raw_size
+ function.
+ (REGISTER_VIRTUAL_SIZE): Redefine to use
+ i386_register_virtual_size function.
+ (i386_register_byte, i386_register_raw_size,
+ i386_register_virtual_size): New functions.
+
* Makefile.in (ALLDEPFILES): Add i387-nat.c.
(i387-nat.o): Add dependencies.
#endif
#endif
-/* Index within `registers' of the first byte of the space for register N. */
-#define REGISTER_BYTE(n) (i386_register_byte[(n)])
-extern int i386_register_byte[];
+/* Return the offset into the register array of the start of register
+ number REG. */
+#define REGISTER_BYTE(reg) i386_register_byte ((reg))
+extern int i386_register_byte (int reg);
-/* Number of bytes of storage in the actual machine representation for
- register N. */
-#define REGISTER_RAW_SIZE(n) (i386_register_raw_size[(n)])
-extern int i386_register_raw_size[];
+/* Return the number of bytes of storage in GDB's register array
+ occupied by register REG. */
+#define REGISTER_RAW_SIZE(reg) i386_register_raw_size ((reg))
+extern int i386_register_raw_size (int reg);
/* Largest value REGISTER_RAW_SIZE can have. */
#define MAX_REGISTER_RAW_SIZE 16
-/* Number of bytes of storage in the program's representation
- for register N. */
-#define REGISTER_VIRTUAL_SIZE(n) (i386_register_virtual_size[(n)])
-extern int i386_register_virtual_size[];
+/* Return the size in bytes of the virtual type of register REG. */
+#define REGISTER_VIRTUAL_SIZE(reg) i386_register_virtual_size ((reg))
+extern int i386_register_virtual_size (int reg);
/* Largest value REGISTER_VIRTUAL_SIZE can have. */
#define MAX_REGISTER_VIRTUAL_SIZE 16
"mxcsr"
};
-/* i386_register_byte[i] is the offset into the register file of the
+/* i386_register_offset[i] is the offset into the register file of the
start of register number i. We initialize this from
- i386_register_raw_size. */
-int i386_register_byte[MAX_NUM_REGS];
+ i386_register_size. */
+static int i386_register_offset[MAX_NUM_REGS];
-/* i386_register_raw_size[i] is the number of bytes of storage in
- GDB's register array occupied by register i. */
-int i386_register_raw_size[MAX_NUM_REGS] = {
+/* i386_register_size[i] is the number of bytes of storage in GDB's
+ register array occupied by register i. */
+static int i386_register_size[MAX_NUM_REGS] = {
4, 4, 4, 4,
4, 4, 4, 4,
4, 4, 4, 4,
4
};
-/* i386_register_virtual_size[i] is the size in bytes of the virtual
- type of register i. */
-int i386_register_virtual_size[MAX_NUM_REGS];
-
/* Return the name of register REG. */
char *
return i386_register_names[reg];
}
+/* Return the offset into the register array of the start of register
+ number REG. */
+int
+i386_register_byte (int reg)
+{
+ return i386_register_offset[reg];
+}
+
+/* Return the number of bytes of storage in GDB's register array
+ occupied by register REG. */
+
+int
+i386_register_raw_size (int reg)
+{
+ return i386_register_size[reg];
+}
+
+/* Return the size in bytes of the virtual type of register REG. */
+
+int
+i386_register_virtual_size (int reg)
+{
+ return TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (reg));
+}
+
/* Convert stabs register number REG to the appropriate register
number used by GDB. */
offset = 0;
for (i = 0; i < MAX_NUM_REGS; i++)
{
- i386_register_byte[i] = offset;
- offset += i386_register_raw_size[i];
+ i386_register_offset[i] = offset;
+ offset += i386_register_size[i];
}
}
- /* Initialize the table of virtual register sizes. */
- {
- int i;
-
- for (i = 0; i < MAX_NUM_REGS; i++)
- i386_register_virtual_size[i] = TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (i));
- }
-
tm_print_insn = gdb_print_insn_i386;
tm_print_insn_info.mach = bfd_lookup_arch (bfd_arch_i386, 0)->mach;