mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2025-01-24 18:35:28 +00: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:
parent
0fda7d1689
commit
85724a0e60
@ -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>
|
||||
|
||||
* server.h (decode_xfer_write): Change prototype.
|
||||
|
@ -468,61 +468,61 @@ i387_xsave_to_cache (struct regcache *regcache, const void *buf)
|
||||
int i, top;
|
||||
unsigned long val;
|
||||
unsigned int clear_bv;
|
||||
char *p;
|
||||
gdb_byte *p;
|
||||
|
||||
/* The supported bits in `xstat_bv' are 1 byte. Clear part in
|
||||
vector registers if its bit in xstat_bv is zero. */
|
||||
clear_bv = (~fp->xstate_bv) & x86_xcr0;
|
||||
|
||||
/* 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");
|
||||
|
||||
if ((clear_bv & I386_XSTATE_X87))
|
||||
p = NULL;
|
||||
else
|
||||
p = (char *) buf;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
if ((clear_bv & I386_XSTATE_X87) != 0)
|
||||
{
|
||||
if (p)
|
||||
p = ((char *) &fp->st_space[0]) + i * 16;
|
||||
supply_register (regcache, i + st0_regnum, p);
|
||||
for (i = 0; i < 8; i++)
|
||||
supply_register (regcache, i + st0_regnum, NULL);
|
||||
}
|
||||
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");
|
||||
|
||||
if ((clear_bv & I386_XSTATE_SSE))
|
||||
p = NULL;
|
||||
else
|
||||
p = (char *) buf;
|
||||
|
||||
for (i = 0; i < num_xmm_registers; i++)
|
||||
{
|
||||
if (p)
|
||||
p = ((char *) &fp->xmm_space[0]) + i * 16;
|
||||
supply_register (regcache, i + xmm0_regnum, p);
|
||||
for (i = 0; i < num_xmm_registers; i++)
|
||||
supply_register (regcache, i + xmm0_regnum, NULL);
|
||||
}
|
||||
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");
|
||||
|
||||
if ((clear_bv & I386_XSTATE_AVX))
|
||||
p = NULL;
|
||||
else
|
||||
p = (char *) buf;
|
||||
|
||||
for (i = 0; i < num_xmm_registers; i++)
|
||||
if ((clear_bv & I386_XSTATE_AVX) != 0)
|
||||
{
|
||||
if (p)
|
||||
p = ((char *) &fp->ymmh_space[0]) + i * 16;
|
||||
supply_register (regcache, i + ymm0h_regnum, p);
|
||||
for (i = 0; i < num_xmm_registers; i++)
|
||||
supply_register (regcache, i + ymm0h_regnum, NULL);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user