regcache_cooked_read -> regcache->cooked_read

Similarly, this patch replaces regcache_cooked_read with
regcache->cooked_read.

gdb:

2018-01-22  Yao Qi  <yao.qi@linaro.org>

	* ia64-tdep.c (ia64_pseudo_register_read): Call
	regcache->cooked_read instead of regcache_cooked_read_unsigned.
	* m32c-tdep.c (m32c_cat_read): Likewise.
	(m32c_r3r2r1r0_read): Likewise.
	* m68hc11-tdep.c (m68hc11_pseudo_register_read): Likewise.
	* xtensa-tdep.c (xtensa_register_read_masked): Likewise.
This commit is contained in:
Yao Qi 2018-01-22 11:02:49 +00:00
parent 03f50fc878
commit 11f57cb67e
5 changed files with 40 additions and 30 deletions

View File

@ -1,3 +1,12 @@
2018-01-22 Yao Qi <yao.qi@linaro.org>
* ia64-tdep.c (ia64_pseudo_register_read): Call
regcache->cooked_read instead of regcache_cooked_read_unsigned.
* m32c-tdep.c (m32c_cat_read): Likewise.
(m32c_r3r2r1r0_read): Likewise.
* m68hc11-tdep.c (m68hc11_pseudo_register_read): Likewise.
* xtensa-tdep.c (xtensa_register_read_masked): Likewise.
2018-01-22 Yao Qi <yao.qi@linaro.org>
* aarch64-tdep.c (aarch64_pseudo_read_value): Call regcache

View File

@ -951,13 +951,11 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
ULONGEST bsp;
CORE_ADDR reg;
status = regcache_cooked_read_unsigned (regcache,
IA64_BSP_REGNUM, &bsp);
status = regcache->cooked_read (IA64_BSP_REGNUM, &bsp);
if (status != REG_VALID)
return status;
status = regcache_cooked_read_unsigned (regcache,
IA64_CFM_REGNUM, &cfm);
status = regcache->cooked_read (IA64_CFM_REGNUM, &cfm);
if (status != REG_VALID)
return status;
@ -982,7 +980,8 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
{
ULONGEST unatN_val;
ULONGEST unat;
status = regcache_cooked_read_unsigned (regcache, IA64_UNAT_REGNUM, &unat);
status = regcache->cooked_read (IA64_UNAT_REGNUM, &unat);
if (status != REG_VALID)
return status;
unatN_val = (unat & (1LL << (regnum - IA64_NAT0_REGNUM))) != 0;
@ -995,10 +994,12 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
ULONGEST bsp;
ULONGEST cfm;
CORE_ADDR gr_addr = 0;
status = regcache_cooked_read_unsigned (regcache, IA64_BSP_REGNUM, &bsp);
status = regcache->cooked_read (IA64_BSP_REGNUM, &bsp);
if (status != REG_VALID)
return status;
status = regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm);
status = regcache->cooked_read (IA64_CFM_REGNUM, &cfm);
if (status != REG_VALID)
return status;
@ -1013,14 +1014,13 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
{
/* Compute address of nat collection bits. */
CORE_ADDR nat_addr = gr_addr | 0x1f8;
CORE_ADDR nat_collection;
ULONGEST nat_collection;
int nat_bit;
/* If our nat collection address is bigger than bsp, we have to get
the nat collection from rnat. Otherwise, we fetch the nat
collection from the computed address. */
if (nat_addr >= bsp)
regcache_cooked_read_unsigned (regcache, IA64_RNAT_REGNUM,
&nat_collection);
regcache->cooked_read (IA64_RNAT_REGNUM, &nat_collection);
else
nat_collection = read_memory_integer (nat_addr, 8, byte_order);
nat_bit = (gr_addr >> 3) & 0x3f;
@ -1036,10 +1036,11 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
It can be calculated as the bsp - sof (sizeof frame). */
ULONGEST bsp, vbsp;
ULONGEST cfm;
status = regcache_cooked_read_unsigned (regcache, IA64_BSP_REGNUM, &bsp);
status = regcache->cooked_read (IA64_BSP_REGNUM, &bsp);
if (status != REG_VALID)
return status;
status = regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm);
status = regcache->cooked_read (IA64_CFM_REGNUM, &cfm);
if (status != REG_VALID)
return status;
@ -1054,10 +1055,11 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
ULONGEST pr;
ULONGEST cfm;
ULONGEST prN_val;
status = regcache_cooked_read_unsigned (regcache, IA64_PR_REGNUM, &pr);
status = regcache->cooked_read (IA64_PR_REGNUM, &pr);
if (status != REG_VALID)
return status;
status = regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm);
status = regcache->cooked_read (IA64_CFM_REGNUM, &cfm);
if (status != REG_VALID)
return status;

View File

@ -483,17 +483,16 @@ m32c_cat_read (struct m32c_reg *reg, struct regcache *cache, gdb_byte *buf)
if (gdbarch_byte_order (reg->arch) == BFD_ENDIAN_BIG)
{
status = regcache_cooked_read (cache, reg->rx->num, buf);
status = cache->cooked_read (reg->rx->num, buf);
if (status == REG_VALID)
status = regcache_cooked_read (cache, reg->ry->num, buf + high_bytes);
status = cache->cooked_read (reg->ry->num, buf + high_bytes);
}
else
{
status = regcache_cooked_read (cache, reg->rx->num, buf + low_bytes);
status = cache->cooked_read (reg->rx->num, buf + low_bytes);
if (status == REG_VALID)
status = regcache_cooked_read (cache, reg->ry->num, buf);
status = cache->cooked_read (reg->ry->num, buf);
}
return status;
}
@ -537,23 +536,23 @@ m32c_r3r2r1r0_read (struct m32c_reg *reg, struct regcache *cache, gdb_byte *buf)
if (gdbarch_byte_order (reg->arch) == BFD_ENDIAN_BIG)
{
status = regcache_cooked_read (cache, tdep->r0->num, buf + len * 3);
status = cache->cooked_read (tdep->r0->num, buf + len * 3);
if (status == REG_VALID)
status = regcache_cooked_read (cache, tdep->r1->num, buf + len * 2);
status = cache->cooked_read (tdep->r1->num, buf + len * 2);
if (status == REG_VALID)
status = regcache_cooked_read (cache, tdep->r2->num, buf + len * 1);
status = cache->cooked_read (tdep->r2->num, buf + len * 1);
if (status == REG_VALID)
status = regcache_cooked_read (cache, tdep->r3->num, buf);
status = cache->cooked_read (tdep->r3->num, buf);
}
else
{
status = regcache_cooked_read (cache, tdep->r0->num, buf);
status = cache->cooked_read (tdep->r0->num, buf);
if (status == REG_VALID)
status = regcache_cooked_read (cache, tdep->r1->num, buf + len * 1);
status = cache->cooked_read (tdep->r1->num, buf + len * 1);
if (status == REG_VALID)
status = regcache_cooked_read (cache, tdep->r2->num, buf + len * 2);
status = cache->cooked_read (tdep->r2->num, buf + len * 2);
if (status == REG_VALID)
status = regcache_cooked_read (cache, tdep->r3->num, buf + len * 3);
status = cache->cooked_read (tdep->r3->num, buf + len * 3);
}
return status;

View File

@ -292,14 +292,14 @@ m68hc11_pseudo_register_read (struct gdbarch *gdbarch,
const int regsize = 4;
enum register_status status;
status = regcache_cooked_read_unsigned (regcache, HARD_PC_REGNUM, &pc);
status = regcache->cooked_read (HARD_PC_REGNUM, &pc);
if (status != REG_VALID)
return status;
if (pc >= 0x8000 && pc < 0xc000)
{
ULONGEST page;
regcache_cooked_read_unsigned (regcache, HARD_PAGE_REGNUM, &page);
regcache->cooked_read (HARD_PAGE_REGNUM, &page);
pc -= 0x8000;
pc += (page << 14);
pc += 0x1000000;

View File

@ -481,7 +481,7 @@ xtensa_register_read_masked (struct regcache *regcache,
enum register_status status;
ULONGEST val;
status = regcache_cooked_read_unsigned (regcache, r, &val);
status = regcache->cooked_read (r, &val);
if (status != REG_VALID)
return status;
regval = (unsigned int) val;