From: Yao Qi Date: Mon, 22 Jan 2018 11:02:49 +0000 (+0000) Subject: regcache_cooked_read -> regcache->cooked_read X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=11f57cb67ecf5c69911eff21b54e05e93bbf2734;p=binutils-gdb.git regcache_cooked_read -> regcache->cooked_read Similarly, this patch replaces regcache_cooked_read with regcache->cooked_read. gdb: 2018-01-22 Yao Qi * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cab98ed105a..499fc5399fc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2018-01-22 Yao Qi + + * 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 * aarch64-tdep.c (aarch64_pseudo_read_value): Call regcache diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index af185a2963d..18f517dfa1b 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -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; diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index fd8ba477ae9..45dc4383fb2 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -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; diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index e4b2199db88..b34548b310b 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -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; diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index 7d7d2b10612..6eb6fd3f185 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -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;