aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache.h
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2017-11-02 15:15:42 +0000
committerYao Qi <yao.qi@linaro.org>2017-11-02 15:15:42 +0000
commit8b86c9592117b3ba52921af11868dc0b81ce4858 (patch)
treea8c5f1df5458f489d4edc05e8a13d7f89e2f48f2 /gdb/regcache.h
parenta01bda5221f75031ea2b6d05860e46c7b9b58b55 (diff)
downloadgdb-8b86c9592117b3ba52921af11868dc0b81ce4858.zip
gdb-8b86c9592117b3ba52921af11868dc0b81ce4858.tar.gz
gdb-8b86c9592117b3ba52921af11868dc0b81ce4858.tar.bz2
const-fy regcache::m_aspace
regcache::m_aspace is a const, never changed during the lifetime of regcache object. The address_space object is a const object too. gdb: 2017-11-02 Yao Qi <yao.qi@linaro.org> * breakpoint.c (insert_single_step_breakpoints): Update. * frame.c (struct frame_info) <aspace>: Add const. (frame_save_as_regcache): Add const. (get_frame_address_space): Return const address_space *. * frame.h (get_frame_address_space): Update declaration. * infrun.c (struct step_over_info) <aspace>: Add const. (set_step_over_info): Make aspace const. (displaced_step_prepare_throw): Change variable const. (resume): Likewise. (proceed): Likewise. (adjust_pc_after_break): Likewise. (save_waitstatus): Likewise. (handle_signal_stop): Likewise. (keep_going_pass_signal): Likewise. * jit.c (jit_frame_sniffer): Add const. * mips-tdep.c (mips_single_step_through_delay): Likewise. * ppc-linux-tdep.c (ppu2spu_sniffer): Likewise. * record-full.c (record_full_wait_1): Likewise. * regcache.c (regcache::regcache): Change parameter to const. * regcache.h (regcache::regcache): Likewise. (regcache::aspace): Return const address_space *. (regcache) <m_aspace>: Add const.
Diffstat (limited to 'gdb/regcache.h')
-rw-r--r--gdb/regcache.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 861a6d2..7eb56a7 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -232,7 +232,7 @@ typedef struct cached_reg
class regcache
{
public:
- regcache (gdbarch *gdbarch, address_space *aspace_)
+ regcache (gdbarch *gdbarch, const address_space *aspace_)
: regcache (gdbarch, aspace_, true)
{}
@@ -254,7 +254,7 @@ public:
gdbarch *arch () const;
/* Return REGCACHE's address space. */
- address_space *aspace () const
+ const address_space *aspace () const
{
return m_aspace;
}
@@ -338,7 +338,7 @@ public:
static void regcache_thread_ptid_changed (ptid_t old_ptid, ptid_t new_ptid);
protected:
- regcache (gdbarch *gdbarch, address_space *aspace_, bool readonly_p_);
+ regcache (gdbarch *gdbarch, const address_space *aspace_, bool readonly_p_);
int num_raw_registers () const;
@@ -364,7 +364,7 @@ private:
/* The address space of this register cache (for registers where it
makes sense, like PC or SP). */
- struct address_space *m_aspace;
+ const address_space * const m_aspace;
/* The register buffers. A read-only register cache can hold the
full [0 .. gdbarch_num_regs + gdbarch_num_pseudo_regs) while a read/write