From 8b86c9592117b3ba52921af11868dc0b81ce4858 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Thu, 2 Nov 2017 15:15:42 +0000 Subject: 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 * breakpoint.c (insert_single_step_breakpoints): Update. * frame.c (struct frame_info) : 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) : 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) : Add const. --- gdb/frame.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdb/frame.c') diff --git a/gdb/frame.c b/gdb/frame.c index 5380c7d..e40685f 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -99,7 +99,7 @@ struct frame_info struct program_space *pspace; /* The frame's address space. */ - struct address_space *aspace; + const address_space *aspace; /* The frame's low-level unwinder and corresponding cache. The low-level unwinder is responsible for unwinding register values @@ -1020,7 +1020,7 @@ do_frame_register_read (void *src, int regnum, gdb_byte *buf) std::unique_ptr frame_save_as_regcache (struct frame_info *this_frame) { - struct address_space *aspace = get_frame_address_space (this_frame); + const address_space *aspace = get_frame_address_space (this_frame); std::unique_ptr regcache (new struct regcache (get_frame_arch (this_frame), aspace)); @@ -2643,7 +2643,7 @@ frame_unwind_program_space (struct frame_info *this_frame) return this_frame->pspace; } -struct address_space * +const address_space * get_frame_address_space (struct frame_info *frame) { return frame->aspace; -- cgit v1.1