From 6aa7d72401387cacc5a7699520045ce9083a526a Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 30 May 2018 14:54:41 -0400 Subject: [PATCH] Remove regcache_invalidate Remove regcache_invalidate, update callers to use detached_regcache::invalidate instead. gdb/ChangeLog: * regcache.h (regcache_invalidate): Remove, update callers to use detached_regcache::invalidate instead. * regcache.c (regcache_invalidate): Remove. --- gdb/ChangeLog | 6 ++++++ gdb/record-full.c | 4 ++-- gdb/regcache.c | 9 +-------- gdb/regcache.h | 2 -- gdb/sh-tdep.c | 2 +- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d1ae322a107..d0cc45abad3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2018-05-30 Simon Marchi + + * regcache.h (regcache_invalidate): Remove, update callers to + use detached_regcache::invalidate instead. + * regcache.c (regcache_invalidate): Remove. + 2018-05-30 Simon Marchi * regcache.h (regcache_raw_write_part): Remove, update callers diff --git a/gdb/record-full.c b/gdb/record-full.c index b8460d9c5d8..8c0534e2291 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -1609,10 +1609,10 @@ record_full_target::store_registers (struct regcache *regcache, int regno) for (i = 0; i < gdbarch_num_regs (regcache->arch ()); i++) - regcache_invalidate (regcache, i); + regcache->invalidate (i); } else - regcache_invalidate (regcache, regno); + regcache->invalidate (regno); error (_("Process record canceled the operation.")); } diff --git a/gdb/regcache.c b/gdb/regcache.c index 371322d9a1e..4dce9789a2b 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -238,7 +238,7 @@ public: ~regcache_invalidator () { if (m_regcache != nullptr) - regcache_invalidate (m_regcache, m_regnum); + m_regcache->invalidate (m_regnum); } DISABLE_COPY_AND_ASSIGN (regcache_invalidator); @@ -328,13 +328,6 @@ reg_buffer::get_register_status (int regnum) const return (enum register_status) m_register_status[regnum]; } -void -regcache_invalidate (struct regcache *regcache, int regnum) -{ - gdb_assert (regcache != NULL); - regcache->invalidate (regnum); -} - void detached_regcache::invalidate (int regnum) { diff --git a/gdb/regcache.h b/gdb/regcache.h index af3adf8d212..64e4cd7f094 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -50,8 +50,6 @@ extern void regcache_raw_write_unsigned (struct regcache *regcache, extern LONGEST regcache_raw_get_signed (struct regcache *regcache, int regnum); -void regcache_invalidate (struct regcache *regcache, int regnum); - /* Transfer of pseudo-registers. The read variants return a register status, as an indication of when a ``cooked'' register was constructed from valid, invalid or unavailable ``raw'' diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 7946430ffd4..97e4a75ed70 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -1703,7 +1703,7 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, regcache->raw_write (BANK_REGNUM, buffer); for (bregnum = R0_BANK0_REGNUM; bregnum < MACLB_REGNUM; ++bregnum) - regcache_invalidate (regcache, bregnum); + regcache->invalidate (bregnum); } else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM) { -- 2.30.2