mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 11:00:01 +08:00
* i387-nat.c: Include "i387-nat.h". Use regnum instead of regno
consistently for parameter names. Fix comments accordingly. (i387_supply_register): New function. (i387_supply_fsave): Implement using i387_supply_register. * i387-nat.h: Use regnum instead of regno consistently for parameter names. Fix comments accordingly. (i387_supply_register): New prototype.
This commit is contained in:
@ -1,3 +1,13 @@
|
|||||||
|
2001-02-17 Mark Kettenis <kettenis@gnu.org>
|
||||||
|
|
||||||
|
* i387-nat.c: Include "i387-nat.h". Use regnum instead of regno
|
||||||
|
consistently for parameter names. Fix comments accordingly.
|
||||||
|
(i387_supply_register): New function.
|
||||||
|
(i387_supply_fsave): Implement using i387_supply_register.
|
||||||
|
* i387-nat.h: Use regnum instead of regno consistently for
|
||||||
|
parameter names. Fix comments accordingly.
|
||||||
|
(i387_supply_register): New prototype.
|
||||||
|
|
||||||
2001-02-16 Michael Snyder <msnyder@mvstp600e.cygnus.com>
|
2001-02-16 Michael Snyder <msnyder@mvstp600e.cygnus.com>
|
||||||
|
|
||||||
* remote.c (build_remote_gdbarch_data): Use new TARGET_ADDR_BIT
|
* remote.c (build_remote_gdbarch_data): Use new TARGET_ADDR_BIT
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Native-dependent code for the i387.
|
/* Native-dependent code for the i387.
|
||||||
Copyright 2000 Free Software Foundation, Inc.
|
Copyright 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
|
||||||
@ -22,15 +22,17 @@
|
|||||||
#include "inferior.h"
|
#include "inferior.h"
|
||||||
#include "value.h"
|
#include "value.h"
|
||||||
|
|
||||||
|
#include "i387-nat.h"
|
||||||
|
|
||||||
/* FIXME: kettenis/2000-05-21: Right now more than a few i386 targets
|
/* FIXME: kettenis/2000-05-21: Right now more than a few i386 targets
|
||||||
define their own routines to manage the floating-point registers in
|
define their own routines to manage the floating-point registers in
|
||||||
GDB's register array. Most (if not all) of these targets use the
|
GDB's register array. Most (if not all) of these targets use the
|
||||||
format used by the "fsave" instruction in their communication with
|
format used by the "fsave" instruction in their communication with
|
||||||
the OS. They should all be converted to use the routines below. */
|
the OS. They should all be converted to use the routines below. */
|
||||||
|
|
||||||
/* At fsave_offset[REGNO] you'll find the offset to the location in
|
/* At fsave_offset[REGNUM] you'll find the offset to the location in
|
||||||
the data structure used by the "fsave" instruction where GDB
|
the data structure used by the "fsave" instruction where GDB
|
||||||
register REGNO is stored. */
|
register REGNUM is stored. */
|
||||||
|
|
||||||
static int fsave_offset[] =
|
static int fsave_offset[] =
|
||||||
{
|
{
|
||||||
@ -55,6 +57,32 @@ static int fsave_offset[] =
|
|||||||
#define FSAVE_ADDR(fsave, regnum) (fsave + fsave_offset[regnum - FP0_REGNUM])
|
#define FSAVE_ADDR(fsave, regnum) (fsave + fsave_offset[regnum - FP0_REGNUM])
|
||||||
|
|
||||||
|
|
||||||
|
/* Fill register REGNUM in GDB's register array with the appropriate
|
||||||
|
value from *FSAVE. This function masks off any of the reserved
|
||||||
|
bits in *FSAVE. */
|
||||||
|
|
||||||
|
void
|
||||||
|
i387_supply_register (int regnum, char *fsave)
|
||||||
|
{
|
||||||
|
/* Most of the FPU control registers occupy only 16 bits in
|
||||||
|
the fsave area. Give those a special treatment. */
|
||||||
|
if (regnum >= FIRST_FPU_CTRL_REGNUM
|
||||||
|
&& regnum != FCOFF_REGNUM && regnum != FDOFF_REGNUM)
|
||||||
|
{
|
||||||
|
unsigned int val = *(unsigned short *) (FSAVE_ADDR (fsave, regnum));
|
||||||
|
|
||||||
|
if (regnum == FOP_REGNUM)
|
||||||
|
{
|
||||||
|
val &= ((1 << 11) - 1);
|
||||||
|
supply_register (regnum, (char *) &val);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
supply_register (regnum, (char *) &val);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
supply_register (regnum, FSAVE_ADDR (fsave, regnum));
|
||||||
|
}
|
||||||
|
|
||||||
/* Fill GDB's register array with the floating-point register values
|
/* Fill GDB's register array with the floating-point register values
|
||||||
in *FSAVE. This function masks off any of the reserved
|
in *FSAVE. This function masks off any of the reserved
|
||||||
bits in *FSAVE. */
|
bits in *FSAVE. */
|
||||||
@ -65,39 +93,21 @@ i387_supply_fsave (char *fsave)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = FP0_REGNUM; i <= LAST_FPU_CTRL_REGNUM; i++)
|
for (i = FP0_REGNUM; i <= LAST_FPU_CTRL_REGNUM; i++)
|
||||||
{
|
i387_supply_register (i, fsave);
|
||||||
/* Most of the FPU control registers occupy only 16 bits in
|
|
||||||
the fsave area. Give those a special treatment. */
|
|
||||||
if (i >= FIRST_FPU_CTRL_REGNUM
|
|
||||||
&& i != FCOFF_REGNUM && i != FDOFF_REGNUM)
|
|
||||||
{
|
|
||||||
unsigned int val = *(unsigned short *) (FSAVE_ADDR (fsave, i));
|
|
||||||
|
|
||||||
if (i == FOP_REGNUM)
|
|
||||||
{
|
|
||||||
val &= ((1 << 11) - 1);
|
|
||||||
supply_register (i, (char *) &val);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
supply_register (i, (char *) &val);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
supply_register (i, FSAVE_ADDR (fsave, i));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fill register REGNO (if it is a floating-point register) in *FSAVE
|
/* Fill register REGNUM (if it is a floating-point register) in *FSAVE
|
||||||
with the value in GDB's register array. If REGNO is -1, do this
|
with the value in GDB's register array. If REGNUM is -1, do this
|
||||||
for all registers. This function doesn't touch any of the reserved
|
for all registers. This function doesn't touch any of the reserved
|
||||||
bits in *FSAVE. */
|
bits in *FSAVE. */
|
||||||
|
|
||||||
void
|
void
|
||||||
i387_fill_fsave (char *fsave, int regno)
|
i387_fill_fsave (char *fsave, int regnum)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = FP0_REGNUM; i <= LAST_FPU_CTRL_REGNUM; i++)
|
for (i = FP0_REGNUM; i <= LAST_FPU_CTRL_REGNUM; i++)
|
||||||
if (regno == -1 || regno == i)
|
if (regnum == -1 || regnum == i)
|
||||||
{
|
{
|
||||||
/* Most of the FPU control registers occupy only 16 bits in
|
/* Most of the FPU control registers occupy only 16 bits in
|
||||||
the fsave area. Give those a special treatment. */
|
the fsave area. Give those a special treatment. */
|
||||||
@ -125,9 +135,9 @@ i387_fill_fsave (char *fsave, int regno)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* At fxsave_offset[REGNO] you'll find the offset to the location in
|
/* At fxsave_offset[REGNUM] you'll find the offset to the location in
|
||||||
the data structure used by the "fxsave" instruction where GDB
|
the data structure used by the "fxsave" instruction where GDB
|
||||||
register REGNO is stored. */
|
register REGNUM is stored. */
|
||||||
|
|
||||||
static int fxsave_offset[] =
|
static int fxsave_offset[] =
|
||||||
{
|
{
|
||||||
@ -223,18 +233,18 @@ i387_supply_fxsave (char *fxsave)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fill register REGNO (if it is a floating-point or SSE register) in
|
/* Fill register REGNUM (if it is a floating-point or SSE register) in
|
||||||
*FXSAVE with the value in GDB's register array. If REGNO is -1, do
|
*FXSAVE with the value in GDB's register array. If REGNUM is -1, do
|
||||||
this for all registers. This function doesn't touch any of the
|
this for all registers. This function doesn't touch any of the
|
||||||
reserved bits in *FXSAVE. */
|
reserved bits in *FXSAVE. */
|
||||||
|
|
||||||
void
|
void
|
||||||
i387_fill_fxsave (char *fxsave, int regno)
|
i387_fill_fxsave (char *fxsave, int regnum)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = FP0_REGNUM; i <= MXCSR_REGNUM; i++)
|
for (i = FP0_REGNUM; i <= MXCSR_REGNUM; i++)
|
||||||
if (regno == -1 || regno == i)
|
if (regnum == -1 || regnum == i)
|
||||||
{
|
{
|
||||||
/* Most of the FPU control registers occupy only 16 bits in
|
/* Most of the FPU control registers occupy only 16 bits in
|
||||||
the fxsave area. Give those a special treatment. */
|
the fxsave area. Give those a special treatment. */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Native-dependent code for the i387.
|
/* Native-dependent code for the i387.
|
||||||
Copyright 2000 Free Software Foundation, Inc.
|
Copyright 2000, 2001 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
|
||||||
@ -21,18 +21,24 @@
|
|||||||
#ifndef I387_NAT_H
|
#ifndef I387_NAT_H
|
||||||
#define I387_NAT_H
|
#define I387_NAT_H
|
||||||
|
|
||||||
|
/* Fill register REGNO in GDB's register array with the appropriate
|
||||||
|
value from *FSAVE. This function masks off any of the reserved
|
||||||
|
bits in *FSAVE. */
|
||||||
|
|
||||||
|
extern void i387_supply_register (int regnum, char *fsave);
|
||||||
|
|
||||||
/* Fill GDB's register array with the floating-point register values
|
/* Fill GDB's register array with the floating-point register values
|
||||||
in *FSAVE. This function masks off any of the reserved
|
in *FSAVE. This function masks off any of the reserved
|
||||||
bits in *FSAVE. */
|
bits in *FSAVE. */
|
||||||
|
|
||||||
extern void i387_supply_fsave (char *fsave);
|
extern void i387_supply_fsave (char *fsave);
|
||||||
|
|
||||||
/* Fill register REGNO (if it is a floating-point register) in *FSAVE
|
/* Fill register REGNUM (if it is a floating-point register) in *FSAVE
|
||||||
with the value in GDB's register array. If REGNO is -1, do this
|
with the value in GDB's register array. If REGNUM is -1, do this
|
||||||
for all registers. This function doesn't touch any of the reserved
|
for all registers. This function doesn't touch any of the reserved
|
||||||
bits in *FSAVE. */
|
bits in *FSAVE. */
|
||||||
|
|
||||||
extern void i387_fill_fsave (char *fsave, int regno);
|
extern void i387_fill_fsave (char *fsave, int regnum);
|
||||||
|
|
||||||
/* Fill GDB's register array with the floating-point and SSE register
|
/* Fill GDB's register array with the floating-point and SSE register
|
||||||
values in *FXSAVE. This function masks off any of the reserved
|
values in *FXSAVE. This function masks off any of the reserved
|
||||||
@ -40,11 +46,11 @@ extern void i387_fill_fsave (char *fsave, int regno);
|
|||||||
|
|
||||||
extern void i387_supply_fxsave (char *fxsave);
|
extern void i387_supply_fxsave (char *fxsave);
|
||||||
|
|
||||||
/* Fill register REGNO (if it is a floating-point or SSE register) in
|
/* Fill register REGNUM (if it is a floating-point or SSE register) in
|
||||||
*FXSAVE with the value in GDB's register array. If REGNO is -1, do
|
*FXSAVE with the value in GDB's register array. If REGNUM is -1, do
|
||||||
this for all registers. This function doesn't touch any of the
|
this for all registers. This function doesn't touch any of the
|
||||||
reserved bits in *FXSAVE. */
|
reserved bits in *FXSAVE. */
|
||||||
|
|
||||||
extern void i387_fill_fxsave (char *fxsave, int regno);
|
extern void i387_fill_fxsave (char *fxsave, int regnum);
|
||||||
|
|
||||||
#endif /* i387-nat.h */
|
#endif /* i387-nat.h */
|
||||||
|
Reference in New Issue
Block a user