diff options
author | Pedro Alves <palves@redhat.com> | 2011-01-28 12:58:00 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2011-01-28 12:58:00 +0000 |
commit | 85724a0e6091239d4c901a03659d5b7e8946c5c6 (patch) | |
tree | a30b8d6156b02199073b6bc5ae52273b170ab90f /gdb/gdbserver/i387-fp.c | |
parent | 0fda7d1689464292c8f137d6a2cb23a190582634 (diff) | |
download | gdb-85724a0e6091239d4c901a03659d5b7e8946c5c6.zip gdb-85724a0e6091239d4c901a03659d5b7e8946c5c6.tar.gz gdb-85724a0e6091239d4c901a03659d5b7e8946c5c6.tar.bz2 |
2011-01-28 Pedro Alves <pedro@codesourcery.com>
* i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
buffer explicit.
Diffstat (limited to 'gdb/gdbserver/i387-fp.c')
-rw-r--r-- | gdb/gdbserver/i387-fp.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/gdb/gdbserver/i387-fp.c b/gdb/gdbserver/i387-fp.c index 75531d0..3dfe06b 100644 --- a/gdb/gdbserver/i387-fp.c +++ b/gdb/gdbserver/i387-fp.c @@ -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; + if ((clear_bv & I386_XSTATE_X87) != 0) + { + for (i = 0; i < 8; i++) + supply_register (regcache, i + st0_regnum, NULL); + } else - p = (char *) buf; - - for (i = 0; i < 8; i++) { - if (p) - p = ((char *) &fp->st_space[0]) + i * 16; - supply_register (regcache, i + st0_regnum, p); + 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; + { + for (i = 0; i < num_xmm_registers; i++) + supply_register (regcache, i + xmm0_regnum, 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); + 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; + if ((clear_bv & I386_XSTATE_AVX) != 0) + { + for (i = 0; i < num_xmm_registers; i++) + supply_register (regcache, i + ymm0h_regnum, NULL); + } else - p = (char *) buf; - - for (i = 0; i < num_xmm_registers; i++) { - if (p) - p = ((char *) &fp->ymmh_space[0]) + i * 16; - supply_register (regcache, i + ymm0h_regnum, p); + p = (gdb_byte *) &fp->ymmh_space[0]; + for (i = 0; i < num_xmm_registers; i++) + supply_register (regcache, i + ymm0h_regnum, p + i * 16); } } |