aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2018-01-22 11:02:49 +0000
committerYao Qi <yao.qi@linaro.org>2018-01-22 11:02:49 +0000
commit03f50fc878f75fcdebf0e3273f201fb4b62b0bae (patch)
treeff0d317fe0e2f6c91c569681785a1d26a11d33bb /gdb/i386-tdep.c
parentdc71152484248c0d8075618ec2146db4ea173b12 (diff)
downloadgdb-03f50fc878f75fcdebf0e3273f201fb4b62b0bae.zip
gdb-03f50fc878f75fcdebf0e3273f201fb4b62b0bae.tar.gz
gdb-03f50fc878f75fcdebf0e3273f201fb4b62b0bae.tar.bz2
Replace regcache_raw_read with regcache->raw_read
The patch later in this series will move regcache's raw_read and cooked_read methods to a new class regcache_read, and regcache is dervied from it. Also pass regcache_read instead of regcache to gdbarch methods pseudo_register_read and pseudo_register_read_value. In order to prepare for this change, this patch changes regcache_raw_read to regcache->raw_read. On the other hand, since we are in C++, I prefer using class method (regcache->raw_read). gdb: 2018-01-22 Yao Qi <yao.qi@linaro.org> * aarch64-tdep.c (aarch64_pseudo_read_value): Call regcache method raw_read instead of regcache_raw_read. * amd64-tdep.c (amd64_pseudo_register_read_value): Likewise. * arm-tdep.c (arm_neon_quad_read): Likewise. * avr-tdep.c (avr_pseudo_register_read): Likewise. * bfin-tdep.c (bfin_pseudo_register_read): Likewise. * frv-tdep.c (frv_pseudo_register_read): Likewise. * h8300-tdep.c (h8300_pseudo_register_read): Likewise. * i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise. (i386_pseudo_register_read_into_value): Likewise. * mep-tdep.c (mep_pseudo_cr32_read): Likewise. * msp430-tdep.c (msp430_pseudo_register_read): Likewise. * nds32-tdep.c (nds32_pseudo_register_read): Likewise. * rl78-tdep.c (rl78_pseudo_register_read): Likewise. * s390-linux-tdep.c (s390_pseudo_register_read): Likewise. * sparc-tdep.c (sparc32_pseudo_register_read): Likewise. * sparc64-tdep.c (sparc64_pseudo_register_read): Likewise. * spu-tdep.c (spu_pseudo_register_read_spu): Likewise. * xtensa-tdep.c (xtensa_pseudo_register_read): Likewise.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c66
1 files changed, 27 insertions, 39 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 9ce329e..cd56642 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -3256,7 +3256,7 @@ i386_mmx_regnum_to_fp_regnum (struct regcache *regcache, int regnum)
int tos;
mmxreg = regnum - tdep->mm0_regnum;
- regcache_raw_read_unsigned (regcache, I387_FSTAT_REGNUM (tdep), &fstat);
+ regcache->raw_read (I387_FSTAT_REGNUM (tdep), &fstat);
tos = (fstat >> 11) & 0x7;
fpreg = (mmxreg + tos) % 8;
@@ -3282,7 +3282,7 @@ i386_pseudo_register_read_into_value (struct gdbarch *gdbarch,
int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum);
/* Extract (always little endian). */
- status = regcache_raw_read (regcache, fpnum, raw_buf);
+ status = regcache->raw_read (fpnum, raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0,
TYPE_LENGTH (value_type (result_value)));
@@ -3297,9 +3297,8 @@ i386_pseudo_register_read_into_value (struct gdbarch *gdbarch,
regnum -= tdep->bnd0_regnum;
/* Extract (always little endian). Read lower 128bits. */
- status = regcache_raw_read (regcache,
- I387_BND0R_REGNUM (tdep) + regnum,
- raw_buf);
+ status = regcache->raw_read (I387_BND0R_REGNUM (tdep) + regnum,
+ raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0, 16);
else
@@ -3321,9 +3320,7 @@ i386_pseudo_register_read_into_value (struct gdbarch *gdbarch,
regnum -= tdep->k0_regnum;
/* Extract (always little endian). */
- status = regcache_raw_read (regcache,
- tdep->k0_regnum + regnum,
- raw_buf);
+ status = regcache->raw_read (tdep->k0_regnum + regnum, raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0, 8);
else
@@ -3336,18 +3333,16 @@ i386_pseudo_register_read_into_value (struct gdbarch *gdbarch,
if (regnum < num_lower_zmm_regs)
{
/* Extract (always little endian). Read lower 128bits. */
- status = regcache_raw_read (regcache,
- I387_XMM0_REGNUM (tdep) + regnum,
- raw_buf);
+ status = regcache->raw_read (I387_XMM0_REGNUM (tdep) + regnum,
+ raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0, 16);
else
memcpy (buf, raw_buf, 16);
/* Extract (always little endian). Read upper 128bits. */
- status = regcache_raw_read (regcache,
- tdep->ymm0h_regnum + regnum,
- raw_buf);
+ status = regcache->raw_read (tdep->ymm0h_regnum + regnum,
+ raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 16, 16);
else
@@ -3356,20 +3351,18 @@ i386_pseudo_register_read_into_value (struct gdbarch *gdbarch,
else
{
/* Extract (always little endian). Read lower 128bits. */
- status = regcache_raw_read (regcache,
- I387_XMM16_REGNUM (tdep) + regnum
- - num_lower_zmm_regs,
- raw_buf);
+ status = regcache->raw_read (I387_XMM16_REGNUM (tdep) + regnum
+ - num_lower_zmm_regs,
+ raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0, 16);
else
memcpy (buf, raw_buf, 16);
/* Extract (always little endian). Read upper 128bits. */
- status = regcache_raw_read (regcache,
- I387_YMM16H_REGNUM (tdep) + regnum
- - num_lower_zmm_regs,
- raw_buf);
+ status = regcache->raw_read (I387_YMM16H_REGNUM (tdep) + regnum
+ - num_lower_zmm_regs,
+ raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 16, 16);
else
@@ -3377,9 +3370,8 @@ i386_pseudo_register_read_into_value (struct gdbarch *gdbarch,
}
/* Read upper 256bits. */
- status = regcache_raw_read (regcache,
- tdep->zmm0h_regnum + regnum,
- raw_buf);
+ status = regcache->raw_read (tdep->zmm0h_regnum + regnum,
+ raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 32, 32);
else
@@ -3390,17 +3382,15 @@ i386_pseudo_register_read_into_value (struct gdbarch *gdbarch,
regnum -= tdep->ymm0_regnum;
/* Extract (always little endian). Read lower 128bits. */
- status = regcache_raw_read (regcache,
- I387_XMM0_REGNUM (tdep) + regnum,
- raw_buf);
+ status = regcache->raw_read (I387_XMM0_REGNUM (tdep) + regnum,
+ raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0, 16);
else
memcpy (buf, raw_buf, 16);
/* Read upper 128bits. */
- status = regcache_raw_read (regcache,
- tdep->ymm0h_regnum + regnum,
- raw_buf);
+ status = regcache->raw_read (tdep->ymm0h_regnum + regnum,
+ raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 16, 32);
else
@@ -3410,17 +3400,15 @@ i386_pseudo_register_read_into_value (struct gdbarch *gdbarch,
{
regnum -= tdep->ymm16_regnum;
/* Extract (always little endian). Read lower 128bits. */
- status = regcache_raw_read (regcache,
- I387_XMM16_REGNUM (tdep) + regnum,
- raw_buf);
+ status = regcache->raw_read (I387_XMM16_REGNUM (tdep) + regnum,
+ raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0, 16);
else
memcpy (buf, raw_buf, 16);
/* Read upper 128bits. */
- status = regcache_raw_read (regcache,
- tdep->ymm16h_regnum + regnum,
- raw_buf);
+ status = regcache->raw_read (tdep->ymm16h_regnum + regnum,
+ raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 16, 16);
else
@@ -3431,7 +3419,7 @@ i386_pseudo_register_read_into_value (struct gdbarch *gdbarch,
int gpnum = regnum - tdep->ax_regnum;
/* Extract (always little endian). */
- status = regcache_raw_read (regcache, gpnum, raw_buf);
+ status = regcache->raw_read (gpnum, raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0,
TYPE_LENGTH (value_type (result_value)));
@@ -3444,7 +3432,7 @@ i386_pseudo_register_read_into_value (struct gdbarch *gdbarch,
/* Extract (always little endian). We read both lower and
upper registers. */
- status = regcache_raw_read (regcache, gpnum % 4, raw_buf);
+ status = regcache->raw_read (gpnum % 4, raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0,
TYPE_LENGTH (value_type (result_value)));