mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 05:47:26 +08:00
2011-01-28 Pedro Alves <pedro@codesourcery.com>
* i387-fp.c (i387_xsave_to_cache): Make passing NULL as register buffer explicit.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2011-01-28 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
|
||||||
|
* i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
|
||||||
|
buffer explicit.
|
||||||
|
|
||||||
2011-01-25 Pedro Alves <pedro@codesourcery.com>
|
2011-01-25 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
|
||||||
* server.h (decode_xfer_write): Change prototype.
|
* server.h (decode_xfer_write): Change prototype.
|
||||||
|
@ -468,61 +468,61 @@ i387_xsave_to_cache (struct regcache *regcache, const void *buf)
|
|||||||
int i, top;
|
int i, top;
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
unsigned int clear_bv;
|
unsigned int clear_bv;
|
||||||
char *p;
|
gdb_byte *p;
|
||||||
|
|
||||||
/* The supported bits in `xstat_bv' are 1 byte. Clear part in
|
/* The supported bits in `xstat_bv' are 1 byte. Clear part in
|
||||||
vector registers if its bit in xstat_bv is zero. */
|
vector registers if its bit in xstat_bv is zero. */
|
||||||
clear_bv = (~fp->xstate_bv) & x86_xcr0;
|
clear_bv = (~fp->xstate_bv) & x86_xcr0;
|
||||||
|
|
||||||
/* Check if any x87 registers are changed. */
|
/* Check if any x87 registers are changed. */
|
||||||
if ((x86_xcr0 & I386_XSTATE_X87))
|
if ((x86_xcr0 & I386_XSTATE_X87) != 0)
|
||||||
{
|
{
|
||||||
int st0_regnum = find_regno ("st0");
|
int st0_regnum = find_regno ("st0");
|
||||||
|
|
||||||
if ((clear_bv & I386_XSTATE_X87))
|
if ((clear_bv & I386_XSTATE_X87) != 0)
|
||||||
p = NULL;
|
|
||||||
else
|
|
||||||
p = (char *) buf;
|
|
||||||
|
|
||||||
for (i = 0; i < 8; i++)
|
|
||||||
{
|
{
|
||||||
if (p)
|
for (i = 0; i < 8; i++)
|
||||||
p = ((char *) &fp->st_space[0]) + i * 16;
|
supply_register (regcache, i + st0_regnum, NULL);
|
||||||
supply_register (regcache, i + st0_regnum, p);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p = (gdb_byte *) &fp->st_space[0];
|
||||||
|
for (i = 0; i < 8; i++)
|
||||||
|
supply_register (regcache, i + st0_regnum, p + i * 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((x86_xcr0 & I386_XSTATE_SSE))
|
if ((x86_xcr0 & I386_XSTATE_SSE) != 0)
|
||||||
{
|
{
|
||||||
int xmm0_regnum = find_regno ("xmm0");
|
int xmm0_regnum = find_regno ("xmm0");
|
||||||
|
|
||||||
if ((clear_bv & I386_XSTATE_SSE))
|
if ((clear_bv & I386_XSTATE_SSE))
|
||||||
p = NULL;
|
|
||||||
else
|
|
||||||
p = (char *) buf;
|
|
||||||
|
|
||||||
for (i = 0; i < num_xmm_registers; i++)
|
|
||||||
{
|
{
|
||||||
if (p)
|
for (i = 0; i < num_xmm_registers; i++)
|
||||||
p = ((char *) &fp->xmm_space[0]) + i * 16;
|
supply_register (regcache, i + xmm0_regnum, NULL);
|
||||||
supply_register (regcache, i + xmm0_regnum, p);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p = (gdb_byte *) &fp->xmm_space[0];
|
||||||
|
for (i = 0; i < num_xmm_registers; i++)
|
||||||
|
supply_register (regcache, i + xmm0_regnum, p + i * 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((x86_xcr0 & I386_XSTATE_AVX))
|
if ((x86_xcr0 & I386_XSTATE_AVX) != 0)
|
||||||
{
|
{
|
||||||
int ymm0h_regnum = find_regno ("ymm0h");
|
int ymm0h_regnum = find_regno ("ymm0h");
|
||||||
|
|
||||||
if ((clear_bv & I386_XSTATE_AVX))
|
if ((clear_bv & I386_XSTATE_AVX) != 0)
|
||||||
p = NULL;
|
|
||||||
else
|
|
||||||
p = (char *) buf;
|
|
||||||
|
|
||||||
for (i = 0; i < num_xmm_registers; i++)
|
|
||||||
{
|
{
|
||||||
if (p)
|
for (i = 0; i < num_xmm_registers; i++)
|
||||||
p = ((char *) &fp->ymmh_space[0]) + i * 16;
|
supply_register (regcache, i + ymm0h_regnum, NULL);
|
||||||
supply_register (regcache, i + ymm0h_regnum, p);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p = (gdb_byte *) &fp->ymmh_space[0];
|
||||||
|
for (i = 0; i < num_xmm_registers; i++)
|
||||||
|
supply_register (regcache, i + ymm0h_regnum, p + i * 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user