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.
This commit is contained in:
Yao Qi 2018-01-22 11:02:49 +00:00
parent dc71152484
commit 03f50fc878
24 changed files with 145 additions and 138 deletions

View File

@ -1,3 +1,25 @@
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.
2018-01-22 Yao Qi <yao.qi@linaro.org>
* Makefile.in (ALL_TARGET_OBS): Remove mt-tdep.o.

View File

@ -2245,7 +2245,7 @@ aarch64_pseudo_read_value (struct gdbarch *gdbarch,
unsigned v_regnum;
v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_Q0_REGNUM;
status = regcache_raw_read (regcache, v_regnum, reg_buf);
status = regcache->raw_read (v_regnum, reg_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0,
TYPE_LENGTH (value_type (result_value)));
@ -2260,7 +2260,7 @@ aarch64_pseudo_read_value (struct gdbarch *gdbarch,
unsigned v_regnum;
v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_D0_REGNUM;
status = regcache_raw_read (regcache, v_regnum, reg_buf);
status = regcache->raw_read (v_regnum, reg_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0,
TYPE_LENGTH (value_type (result_value)));
@ -2275,7 +2275,7 @@ aarch64_pseudo_read_value (struct gdbarch *gdbarch,
unsigned v_regnum;
v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_S0_REGNUM;
status = regcache_raw_read (regcache, v_regnum, reg_buf);
status = regcache->raw_read (v_regnum, reg_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0,
TYPE_LENGTH (value_type (result_value)));
@ -2290,7 +2290,7 @@ aarch64_pseudo_read_value (struct gdbarch *gdbarch,
unsigned v_regnum;
v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_H0_REGNUM;
status = regcache_raw_read (regcache, v_regnum, reg_buf);
status = regcache->raw_read (v_regnum, reg_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0,
TYPE_LENGTH (value_type (result_value)));
@ -2305,7 +2305,7 @@ aarch64_pseudo_read_value (struct gdbarch *gdbarch,
unsigned v_regnum;
v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_B0_REGNUM;
status = regcache_raw_read (regcache, v_regnum, reg_buf);
status = regcache->raw_read (v_regnum, reg_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0,
TYPE_LENGTH (value_type (result_value)));

View File

@ -369,9 +369,8 @@ amd64_pseudo_register_read_value (struct gdbarch *gdbarch,
if (gpnum >= AMD64_NUM_LOWER_BYTE_REGS)
{
/* Special handling for AH, BH, CH, DH. */
status = regcache_raw_read (regcache,
gpnum - AMD64_NUM_LOWER_BYTE_REGS,
raw_buf);
status = regcache->raw_read (gpnum - AMD64_NUM_LOWER_BYTE_REGS,
raw_buf);
if (status == REG_VALID)
memcpy (buf, raw_buf + 1, 1);
else
@ -380,7 +379,7 @@ amd64_pseudo_register_read_value (struct gdbarch *gdbarch,
}
else
{
status = regcache_raw_read (regcache, gpnum, raw_buf);
status = regcache->raw_read (gpnum, raw_buf);
if (status == REG_VALID)
memcpy (buf, raw_buf, 1);
else
@ -392,7 +391,7 @@ amd64_pseudo_register_read_value (struct gdbarch *gdbarch,
{
int gpnum = regnum - tdep->eax_regnum;
/* Extract (always little endian). */
status = regcache_raw_read (regcache, gpnum, raw_buf);
status = regcache->raw_read (gpnum, raw_buf);
if (status == REG_VALID)
memcpy (buf, raw_buf, 4);
else

View File

@ -8696,13 +8696,13 @@ arm_neon_quad_read (struct gdbarch *gdbarch, struct regcache *regcache,
else
offset = 0;
status = regcache_raw_read (regcache, double_regnum, reg_buf);
status = regcache->raw_read (double_regnum, reg_buf);
if (status != REG_VALID)
return status;
memcpy (buf + offset, reg_buf, 8);
offset = 8 - offset;
status = regcache_raw_read (regcache, double_regnum + 1, reg_buf);
status = regcache->raw_read (double_regnum + 1, reg_buf);
if (status != REG_VALID)
return status;
memcpy (buf + offset, reg_buf, 8);
@ -8742,7 +8742,7 @@ arm_pseudo_read (struct gdbarch *gdbarch, struct regcache *regcache,
double_regnum = user_reg_map_name_to_regnum (gdbarch, name_buf,
strlen (name_buf));
status = regcache_raw_read (regcache, double_regnum, reg_buf);
status = regcache->raw_read (double_regnum, reg_buf);
if (status == REG_VALID)
memcpy (buf, reg_buf + offset, 4);
return status;

View File

@ -391,7 +391,7 @@ avr_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
switch (regnum)
{
case AVR_PSEUDO_PC_REGNUM:
status = regcache_raw_read_unsigned (regcache, AVR_PC_REGNUM, &val);
status = regcache->raw_read (AVR_PC_REGNUM, &val);
if (status != REG_VALID)
return status;
val >>= 1;

View File

@ -699,7 +699,7 @@ bfin_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
_("invalid register number %d"), regnum);
/* Extract the CC bit from the ASTAT register. */
status = regcache_raw_read (regcache, BFIN_ASTAT_REGNUM, buf);
status = regcache->raw_read (BFIN_ASTAT_REGNUM, buf);
if (status == REG_VALID)
{
buffer[1] = buffer[2] = buffer[3] = 0;

View File

@ -302,9 +302,9 @@ frv_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
if (reg == iacc0_regnum)
{
status = regcache_raw_read (regcache, iacc0h_regnum, buffer);
status = regcache->raw_read (iacc0h_regnum, buffer);
if (status == REG_VALID)
status = regcache_raw_read (regcache, iacc0l_regnum, (bfd_byte *) buffer + 4);
status = regcache->raw_read (iacc0l_regnum, (bfd_byte *) buffer + 4);
}
else if (accg0_regnum <= reg && reg <= accg7_regnum)
{
@ -315,7 +315,7 @@ frv_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
int byte_num = (reg - accg0_regnum) % 4;
gdb_byte buf[4];
status = regcache_raw_read (regcache, raw_regnum, buf);
status = regcache->raw_read (raw_regnum, buf);
if (status == REG_VALID)
{
memset (buffer, 0, 4);

View File

@ -1167,7 +1167,7 @@ pseudo_from_raw_register (struct gdbarch *gdbarch, struct regcache *regcache,
enum register_status status;
ULONGEST val;
status = regcache_raw_read_unsigned (regcache, raw_regno, &val);
status = regcache->raw_read (raw_regno, &val);
if (status == REG_VALID)
store_unsigned_integer (buf,
register_size (gdbarch, pseudo_regno),
@ -1205,7 +1205,7 @@ h8300_pseudo_register_read (struct gdbarch *gdbarch,
regno, E_EXR_REGNUM);
}
else
return regcache_raw_read (regcache, regno, buf);
return regcache->raw_read (regno, buf);
}
static void

View File

@ -2754,7 +2754,7 @@ hppa_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
ULONGEST tmp;
enum register_status status;
status = regcache_raw_read_unsigned (regcache, regnum, &tmp);
status = regcache->raw_read (regnum, &tmp);
if (status == REG_VALID)
{
if (regnum == HPPA_PCOQ_HEAD_REGNUM || regnum == HPPA_PCOQ_TAIL_REGNUM)

View File

@ -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)));

View File

@ -312,7 +312,7 @@ static m32c_write_reg_t m32c_r3r2r1r0_write;
static enum register_status
m32c_raw_read (struct m32c_reg *reg, struct regcache *cache, gdb_byte *buf)
{
return regcache_raw_read (cache, reg->num, buf);
return cache->raw_read (reg->num, buf);
}
@ -333,7 +333,8 @@ m32c_read_flg (struct regcache *cache)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (cache->arch ());
ULONGEST flg;
regcache_raw_read_unsigned (cache, tdep->flg->num, &flg);
cache->raw_read (tdep->flg->num, &flg);
return flg & 0xffff;
}
@ -354,7 +355,7 @@ static enum register_status
m32c_banked_read (struct m32c_reg *reg, struct regcache *cache, gdb_byte *buf)
{
struct m32c_reg *bank_reg = m32c_banked_register (reg, cache);
return regcache_raw_read (cache, bank_reg->num, buf);
return cache->raw_read (bank_reg->num, buf);
}
@ -447,7 +448,7 @@ m32c_part_read (struct m32c_reg *reg, struct regcache *cache, gdb_byte *buf)
memset (buf, 0, TYPE_LENGTH (reg->type));
m32c_find_part (reg, &offset, &len);
return regcache_cooked_read_part (cache, reg->rx->num, offset, len, buf);
return cache->cooked_read_part (reg->rx->num, offset, len, buf);
}

View File

@ -1136,7 +1136,7 @@ mep_pseudo_cr32_read (struct gdbarch *gdbarch,
gdb_assert (TYPE_LENGTH (register_type (gdbarch, rawnum)) == sizeof (buf64));
gdb_assert (TYPE_LENGTH (register_type (gdbarch, cookednum)) == 4);
status = regcache_raw_read (regcache, rawnum, buf64);
status = regcache->raw_read (rawnum, buf64);
if (status == REG_VALID)
{
/* Slow, but legible. */
@ -1153,7 +1153,7 @@ mep_pseudo_cr64_read (struct gdbarch *gdbarch,
int cookednum,
gdb_byte *buf)
{
return regcache_raw_read (regcache, mep_pseudo_to_raw[cookednum], buf);
return regcache->raw_read (mep_pseudo_to_raw[cookednum], buf);
}
@ -1165,7 +1165,7 @@ mep_pseudo_register_read (struct gdbarch *gdbarch,
{
if (IS_CSR_REGNUM (cookednum)
|| IS_CCR_REGNUM (cookednum))
return regcache_raw_read (regcache, mep_pseudo_to_raw[cookednum], buf);
return regcache->raw_read (mep_pseudo_to_raw[cookednum], buf);
else if (IS_CR32_REGNUM (cookednum)
|| IS_FP_CR32_REGNUM (cookednum))
return mep_pseudo_cr32_read (gdbarch, regcache, cookednum, buf);

View File

@ -744,19 +744,19 @@ mips_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
gdb_assert (cookednum >= gdbarch_num_regs (gdbarch)
&& cookednum < 2 * gdbarch_num_regs (gdbarch));
if (register_size (gdbarch, rawnum) == register_size (gdbarch, cookednum))
return regcache_raw_read (regcache, rawnum, buf);
return regcache->raw_read (rawnum, buf);
else if (register_size (gdbarch, rawnum) >
register_size (gdbarch, cookednum))
{
if (gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p)
return regcache_raw_read_part (regcache, rawnum, 0, 4, buf);
return regcache->raw_read_part (rawnum, 0, 4, buf);
else
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
LONGEST regval;
enum register_status status;
status = regcache_raw_read_signed (regcache, rawnum, &regval);
status = regcache->raw_read (rawnum, &regval);
if (status == REG_VALID)
store_signed_integer (buf, 4, byte_order, regval);
return status;

View File

@ -229,7 +229,7 @@ msp430_pseudo_register_read (struct gdbarch *gdbarch,
int regsize = register_size (gdbarch, regnum);
int raw_regnum = regnum - MSP430_NUM_REGS;
status = regcache_raw_read_unsigned (regcache, raw_regnum, &val);
status = regcache->raw_read (raw_regnum, &val);
if (status == REG_VALID)
store_unsigned_integer (buffer, regsize, byte_order, val);

View File

@ -462,7 +462,7 @@ nds32_pseudo_register_read (struct gdbarch *gdbarch,
offset = (regnum & 1) ? 0 : 4;
fdr_regnum = NDS32_FD0_REGNUM + (regnum >> 1);
status = regcache_raw_read (regcache, fdr_regnum, reg_buf);
status = regcache->raw_read (fdr_regnum, reg_buf);
if (status == REG_VALID)
memcpy (buf, reg_buf + offset, 4);

View File

@ -650,68 +650,67 @@ rl78_pseudo_register_read (struct gdbarch *gdbarch,
int raw_regnum = RL78_RAW_BANK0_R0_REGNUM
+ (reg - RL78_BANK0_R0_REGNUM);
status = regcache_raw_read (regcache, raw_regnum, buffer);
status = regcache->raw_read (raw_regnum, buffer);
}
else if (RL78_BANK0_RP0_REGNUM <= reg && reg <= RL78_BANK3_RP3_REGNUM)
{
int raw_regnum = 2 * (reg - RL78_BANK0_RP0_REGNUM)
+ RL78_RAW_BANK0_R0_REGNUM;
status = regcache_raw_read (regcache, raw_regnum, buffer);
status = regcache->raw_read (raw_regnum, buffer);
if (status == REG_VALID)
status = regcache_raw_read (regcache, raw_regnum + 1, buffer + 1);
status = regcache->raw_read (raw_regnum + 1, buffer + 1);
}
else if (RL78_BANK0_RP0_PTR_REGNUM <= reg && reg <= RL78_BANK3_RP3_PTR_REGNUM)
{
int raw_regnum = 2 * (reg - RL78_BANK0_RP0_PTR_REGNUM)
+ RL78_RAW_BANK0_R0_REGNUM;
status = regcache_raw_read (regcache, raw_regnum, buffer);
status = regcache->raw_read (raw_regnum, buffer);
if (status == REG_VALID)
status = regcache_raw_read (regcache, raw_regnum + 1, buffer + 1);
status = regcache->raw_read (raw_regnum + 1, buffer + 1);
}
else if (reg == RL78_SP_REGNUM)
{
status = regcache_raw_read (regcache, RL78_SPL_REGNUM, buffer);
status = regcache->raw_read (RL78_SPL_REGNUM, buffer);
if (status == REG_VALID)
status = regcache_raw_read (regcache, RL78_SPH_REGNUM, buffer + 1);
status = regcache->raw_read (RL78_SPH_REGNUM, buffer + 1);
}
else if (reg == RL78_PC_REGNUM)
{
gdb_byte rawbuf[4];
status = regcache_raw_read (regcache, RL78_RAW_PC_REGNUM, rawbuf);
status = regcache->raw_read (RL78_RAW_PC_REGNUM, rawbuf);
memcpy (buffer, rawbuf, 3);
}
else if (RL78_X_REGNUM <= reg && reg <= RL78_H_REGNUM)
{
ULONGEST psw;
status = regcache_raw_read_unsigned (regcache, RL78_PSW_REGNUM, &psw);
status = regcache->raw_read (RL78_PSW_REGNUM, &psw);
if (status == REG_VALID)
{
/* RSB0 is at bit 3; RSBS1 is at bit 5. */
int bank = ((psw >> 3) & 1) | ((psw >> 4) & 1);
int raw_regnum = RL78_RAW_BANK0_R0_REGNUM + bank * RL78_REGS_PER_BANK
+ (reg - RL78_X_REGNUM);
status = regcache_raw_read (regcache, raw_regnum, buffer);
status = regcache->raw_read (raw_regnum, buffer);
}
}
else if (RL78_AX_REGNUM <= reg && reg <= RL78_HL_REGNUM)
{
ULONGEST psw;
status = regcache_raw_read_unsigned (regcache, RL78_PSW_REGNUM, &psw);
status = regcache->raw_read (RL78_PSW_REGNUM, &psw);
if (status == REG_VALID)
{
/* RSB0 is at bit 3; RSBS1 is at bit 5. */
int bank = ((psw >> 3) & 1) | ((psw >> 4) & 1);
int raw_regnum = RL78_RAW_BANK0_R0_REGNUM + bank * RL78_REGS_PER_BANK
+ 2 * (reg - RL78_AX_REGNUM);
status = regcache_raw_read (regcache, raw_regnum, buffer);
status = regcache->raw_read (raw_regnum, buffer);
if (status == REG_VALID)
status = regcache_raw_read (regcache, raw_regnum + 1,
buffer + 1);
status = regcache->raw_read (raw_regnum + 1, buffer + 1);
}
}
else

View File

@ -2746,19 +2746,19 @@ dfp_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
/* Read two FP registers to form a whole dl register. */
status = regcache_raw_read (regcache, tdep->ppc_fp0_regnum +
2 * reg_index, buffer);
status = regcache->raw_read (tdep->ppc_fp0_regnum +
2 * reg_index, buffer);
if (status == REG_VALID)
status = regcache_raw_read (regcache, tdep->ppc_fp0_regnum +
2 * reg_index + 1, buffer + 8);
status = regcache->raw_read (tdep->ppc_fp0_regnum +
2 * reg_index + 1, buffer + 8);
}
else
{
status = regcache_raw_read (regcache, tdep->ppc_fp0_regnum +
2 * reg_index + 1, buffer);
status = regcache->raw_read (tdep->ppc_fp0_regnum +
2 * reg_index + 1, buffer);
if (status == REG_VALID)
status = regcache_raw_read (regcache, tdep->ppc_fp0_regnum +
2 * reg_index, buffer + 8);
status = regcache->raw_read (tdep->ppc_fp0_regnum +
2 * reg_index, buffer + 8);
}
return status;
@ -2801,25 +2801,25 @@ vsx_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
/* Read the portion that overlaps the VMX registers. */
if (reg_index > 31)
status = regcache_raw_read (regcache, tdep->ppc_vr0_regnum +
reg_index - 32, buffer);
status = regcache->raw_read (tdep->ppc_vr0_regnum +
reg_index - 32, buffer);
else
/* Read the portion that overlaps the FPR registers. */
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
status = regcache_raw_read (regcache, tdep->ppc_fp0_regnum +
reg_index, buffer);
status = regcache->raw_read (tdep->ppc_fp0_regnum +
reg_index, buffer);
if (status == REG_VALID)
status = regcache_raw_read (regcache, tdep->ppc_vsr0_upper_regnum +
reg_index, buffer + 8);
status = regcache->raw_read (tdep->ppc_vsr0_upper_regnum +
reg_index, buffer + 8);
}
else
{
status = regcache_raw_read (regcache, tdep->ppc_fp0_regnum +
reg_index, buffer + 8);
status = regcache->raw_read (tdep->ppc_fp0_regnum +
reg_index, buffer + 8);
if (status == REG_VALID)
status = regcache_raw_read (regcache, tdep->ppc_vsr0_upper_regnum +
reg_index, buffer);
status = regcache->raw_read (tdep->ppc_vsr0_upper_regnum +
reg_index, buffer);
}
return status;

View File

@ -399,7 +399,7 @@ s390_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
{
enum register_status status;
status = regcache_raw_read_unsigned (regcache, S390_PSWA_REGNUM, &val);
status = regcache->raw_read (S390_PSWA_REGNUM, &val);
if (status == REG_VALID)
{
if (register_size (gdbarch, S390_PSWA_REGNUM) == 4)
@ -413,7 +413,7 @@ s390_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
{
enum register_status status;
status = regcache_raw_read_unsigned (regcache, S390_PSWM_REGNUM, &val);
status = regcache->raw_read (S390_PSWM_REGNUM, &val);
if (status == REG_VALID)
{
if (register_size (gdbarch, S390_PSWA_REGNUM) == 4)
@ -432,10 +432,10 @@ s390_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
regnum -= tdep->gpr_full_regnum;
status = regcache_raw_read_unsigned (regcache, S390_R0_REGNUM + regnum, &val);
status = regcache->raw_read (S390_R0_REGNUM + regnum, &val);
if (status == REG_VALID)
status = regcache_raw_read_unsigned (regcache, S390_R0_UPPER_REGNUM + regnum,
&val_upper);
status = regcache->raw_read (S390_R0_UPPER_REGNUM + regnum,
&val_upper);
if (status == REG_VALID)
{
val |= val_upper << 32;
@ -450,10 +450,9 @@ s390_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
regnum -= tdep->v0_full_regnum;
status = regcache_raw_read (regcache, S390_F0_REGNUM + regnum, buf);
status = regcache->raw_read (S390_F0_REGNUM + regnum, buf);
if (status == REG_VALID)
status = regcache_raw_read (regcache,
S390_V0_LOWER_REGNUM + regnum, buf + 8);
status = regcache->raw_read (S390_V0_LOWER_REGNUM + regnum, buf + 8);
return status;
}

View File

@ -1640,7 +1640,7 @@ pseudo_register_read_portions (struct gdbarch *gdbarch,
gdb_byte *b;
b = buffer + register_size (gdbarch, base_regnum) * portion;
status = regcache_raw_read (regcache, base_regnum + portion, b);
status = regcache->raw_read (base_regnum + portion, b);
if (status != REG_VALID)
return status;
}
@ -1656,7 +1656,7 @@ sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
enum register_status status;
if (reg_nr == PSEUDO_BANK_REGNUM)
return regcache_raw_read (regcache, BANK_REGNUM, buffer);
return regcache->raw_read (BANK_REGNUM, buffer);
else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
{
/* Enough space for two float registers. */

View File

@ -1516,7 +1516,7 @@ pseudo_register_read_portions (struct gdbarch *gdbarch,
gdb_byte *b;
b = buffer + register_size (gdbarch, base_regnum) * portion;
status = regcache_raw_read (regcache, base_regnum + portion, b);
status = regcache->raw_read (base_regnum + portion, b);
if (status != REG_VALID)
return status;
}
@ -1587,7 +1587,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
base_regnum = sh64_compact_reg_base_num (gdbarch, reg_nr);
/* Build the value in the provided buffer. */
status = regcache_raw_read (regcache, base_regnum, temp_buffer);
status = regcache->raw_read (base_regnum, temp_buffer);
if (status != REG_VALID)
return status;
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
@ -1605,7 +1605,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
/* Build the value in the provided buffer. */
/* Floating point registers map 1-1 to the media fp regs,
they have the same size and endianness. */
return regcache_raw_read (regcache, base_regnum, buffer);
return regcache->raw_read (base_regnum, buffer);
}
else if (reg_nr >= DR0_C_REGNUM
@ -1692,7 +1692,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
/* FPUL_C register is floating point register 32,
same size, same endianness. */
return regcache_raw_read (regcache, base_regnum, buffer);
return regcache->raw_read (base_regnum, buffer);
}
else
gdb_assert_not_reached ("invalid pseudo register number");

View File

@ -512,9 +512,9 @@ sparc32_pseudo_register_read (struct gdbarch *gdbarch,
gdb_assert (regnum >= SPARC32_D0_REGNUM && regnum <= SPARC32_D30_REGNUM);
regnum = SPARC_F0_REGNUM + 2 * (regnum - SPARC32_D0_REGNUM);
status = regcache_raw_read (regcache, regnum, buf);
status = regcache->raw_read (regnum, buf);
if (status == REG_VALID)
status = regcache_raw_read (regcache, regnum + 1, buf + 4);
status = regcache->raw_read (regnum + 1, buf + 4);
return status;
}

View File

@ -910,27 +910,27 @@ sparc64_pseudo_register_read (struct gdbarch *gdbarch,
if (regnum >= SPARC64_D0_REGNUM && regnum <= SPARC64_D30_REGNUM)
{
regnum = SPARC_F0_REGNUM + 2 * (regnum - SPARC64_D0_REGNUM);
status = regcache_raw_read (regcache, regnum, buf);
status = regcache->raw_read (regnum, buf);
if (status == REG_VALID)
status = regcache_raw_read (regcache, regnum + 1, buf + 4);
status = regcache->raw_read (regnum + 1, buf + 4);
return status;
}
else if (regnum >= SPARC64_D32_REGNUM && regnum <= SPARC64_D62_REGNUM)
{
regnum = SPARC64_F32_REGNUM + (regnum - SPARC64_D32_REGNUM);
return regcache_raw_read (regcache, regnum, buf);
return regcache->raw_read (regnum, buf);
}
else if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q28_REGNUM)
{
regnum = SPARC_F0_REGNUM + 4 * (regnum - SPARC64_Q0_REGNUM);
status = regcache_raw_read (regcache, regnum, buf);
status = regcache->raw_read (regnum, buf);
if (status == REG_VALID)
status = regcache_raw_read (regcache, regnum + 1, buf + 4);
status = regcache->raw_read (regnum + 1, buf + 4);
if (status == REG_VALID)
status = regcache_raw_read (regcache, regnum + 2, buf + 8);
status = regcache->raw_read (regnum + 2, buf + 8);
if (status == REG_VALID)
status = regcache_raw_read (regcache, regnum + 3, buf + 12);
status = regcache->raw_read (regnum + 3, buf + 12);
return status;
}
@ -938,9 +938,9 @@ sparc64_pseudo_register_read (struct gdbarch *gdbarch,
{
regnum = SPARC64_F32_REGNUM + 2 * (regnum - SPARC64_Q32_REGNUM);
status = regcache_raw_read (regcache, regnum, buf);
status = regcache->raw_read (regnum, buf);
if (status == REG_VALID)
status = regcache_raw_read (regcache, regnum + 1, buf + 8);
status = regcache->raw_read (regnum + 1, buf + 8);
return status;
}
@ -951,7 +951,7 @@ sparc64_pseudo_register_read (struct gdbarch *gdbarch,
{
ULONGEST state;
status = regcache_raw_read_unsigned (regcache, SPARC64_STATE_REGNUM, &state);
status = regcache->raw_read (SPARC64_STATE_REGNUM, &state);
if (status != REG_VALID)
return status;

View File

@ -193,7 +193,7 @@ spu_pseudo_register_read_spu (struct regcache *regcache, const char *regname,
ULONGEST id;
ULONGEST ul;
status = regcache_raw_read_unsigned (regcache, SPU_ID_REGNUM, &id);
status = regcache->raw_read (SPU_ID_REGNUM, &id);
if (status != REG_VALID)
return status;
xsnprintf (annex, sizeof annex, "%d/%s", (int) id, regname);
@ -218,14 +218,14 @@ spu_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
switch (regnum)
{
case SPU_SP_REGNUM:
status = regcache_raw_read (regcache, SPU_RAW_SP_REGNUM, reg);
status = regcache->raw_read (SPU_RAW_SP_REGNUM, reg);
if (status != REG_VALID)
return status;
memcpy (buf, reg, 4);
return status;
case SPU_FPSCR_REGNUM:
status = regcache_raw_read_unsigned (regcache, SPU_ID_REGNUM, &id);
status = regcache->raw_read (SPU_ID_REGNUM, &id);
if (status != REG_VALID)
return status;
xsnprintf (annex, sizeof annex, "%d/fpcr", (int) id);

View File

@ -562,9 +562,8 @@ xtensa_pseudo_register_read (struct gdbarch *gdbarch,
ULONGEST value;
enum register_status status;
status = regcache_raw_read_unsigned (regcache,
gdbarch_tdep (gdbarch)->wb_regnum,
&value);
status = regcache->raw_read (gdbarch_tdep (gdbarch)->wb_regnum,
&value);
if (status != REG_VALID)
return status;
regnum = arreg_number (gdbarch, regnum, value);
@ -572,7 +571,7 @@ xtensa_pseudo_register_read (struct gdbarch *gdbarch,
/* We can always read non-pseudo registers. */
if (regnum >= 0 && regnum < gdbarch_num_regs (gdbarch))
return regcache_raw_read (regcache, regnum, buffer);
return regcache->raw_read (regnum, buffer);
/* We have to find out how to deal with priveleged registers.
Let's treat them as pseudo-registers, but we cannot read/write them. */
@ -629,7 +628,7 @@ xtensa_pseudo_register_read (struct gdbarch *gdbarch,
return xtensa_register_read_masked (regcache, reg, buffer);
/* Assume that we can read the register. */
return regcache_raw_read (regcache, regnum, buffer);
return regcache->raw_read (regnum, buffer);
}
else
internal_error (__FILE__, __LINE__,