* 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.
This commit is contained in:
parent
0fc087fe41
commit
1a11ba71e2
3 changed files with 63 additions and 31 deletions
|
@ -1,5 +1,24 @@
|
|||
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.
|
||||
|
||||
|
|
|
@ -220,22 +220,22 @@ extern int i386_dwarf_reg_to_regnum (int reg);
|
|||
#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
|
||||
|
|
|
@ -54,14 +54,14 @@ static char *i386_register_names[] =
|
|||
"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,
|
||||
|
@ -75,10 +75,6 @@ int i386_register_raw_size[MAX_NUM_REGS] = {
|
|||
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 *
|
||||
|
@ -92,6 +88,31 @@ i386_register_name (int reg)
|
|||
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. */
|
||||
|
||||
|
@ -1215,19 +1236,11 @@ _initialize_i386_tdep (void)
|
|||
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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue