aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
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/infrun.c
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/infrun.c')
-rw-r--r--gdb/infrun.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 0e31dbc..ef5a505 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1289,7 +1289,7 @@ struct step_over_info
and address of the instruction the breakpoint is set at. We'll
skip inserting all breakpoints here. Valid iff ASPACE is
non-NULL. */
- struct address_space *aspace;
+ const address_space *aspace;
CORE_ADDR address;
/* The instruction being stepped over triggers a nonsteppable
@@ -1332,7 +1332,7 @@ static struct step_over_info step_over_info;
because when we need the info later the thread may be running. */
static void
-set_step_over_info (struct address_space *aspace, CORE_ADDR address,
+set_step_over_info (const address_space *aspace, CORE_ADDR address,
int nonsteppable_watchpoint_p,
int thread)
{
@@ -1760,7 +1760,7 @@ displaced_step_prepare_throw (ptid_t ptid)
struct thread_info *tp = find_thread_ptid (ptid);
struct regcache *regcache = get_thread_regcache (ptid);
struct gdbarch *gdbarch = regcache->arch ();
- struct address_space *aspace = regcache->aspace ();
+ const address_space *aspace = regcache->aspace ();
CORE_ADDR original, copy;
ULONGEST len;
struct displaced_step_closure *closure;
@@ -2388,7 +2388,7 @@ resume (enum gdb_signal sig)
struct gdbarch *gdbarch = regcache->arch ();
struct thread_info *tp = inferior_thread ();
CORE_ADDR pc = regcache_read_pc (regcache);
- struct address_space *aspace = regcache->aspace ();
+ const address_space *aspace = regcache->aspace ();
ptid_t resume_ptid;
/* This represents the user's step vs continue request. When
deciding whether "set scheduler-locking step" applies, it's the
@@ -2983,7 +2983,6 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal)
struct gdbarch *gdbarch;
struct thread_info *tp;
CORE_ADDR pc;
- struct address_space *aspace;
ptid_t resume_ptid;
struct execution_control_state ecss;
struct execution_control_state *ecs = &ecss;
@@ -3007,7 +3006,8 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal)
regcache = get_current_regcache ();
gdbarch = regcache->arch ();
- aspace = regcache->aspace ();
+ const address_space *aspace = regcache->aspace ();
+
pc = regcache_read_pc (regcache);
tp = inferior_thread ();
@@ -4070,7 +4070,6 @@ adjust_pc_after_break (struct thread_info *thread,
{
struct regcache *regcache;
struct gdbarch *gdbarch;
- struct address_space *aspace;
CORE_ADDR breakpoint_pc, decr_pc;
/* If we've hit a breakpoint, we'll normally be stopped with SIGTRAP. If
@@ -4150,7 +4149,7 @@ adjust_pc_after_break (struct thread_info *thread,
if (decr_pc == 0)
return;
- aspace = regcache->aspace ();
+ const address_space *aspace = regcache->aspace ();
/* Find the location where (if we've hit a breakpoint) the
breakpoint would be. */
@@ -4385,7 +4384,6 @@ static void
save_waitstatus (struct thread_info *tp, struct target_waitstatus *ws)
{
struct regcache *regcache;
- struct address_space *aspace;
if (debug_infrun)
{
@@ -4404,7 +4402,7 @@ save_waitstatus (struct thread_info *tp, struct target_waitstatus *ws)
tp->suspend.waitstatus_pending_p = 1;
regcache = get_thread_regcache (tp->ptid);
- aspace = regcache->aspace ();
+ const address_space *aspace = regcache->aspace ();
if (ws->kind == TARGET_WAITKIND_STOPPED
&& ws->value.sig == GDB_SIGNAL_TRAP)
@@ -5776,11 +5774,11 @@ handle_signal_stop (struct execution_control_state *ecs)
if (ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP)
{
struct regcache *regcache;
- struct address_space *aspace;
CORE_ADDR pc;
regcache = get_thread_regcache (ecs->ptid);
- aspace = regcache->aspace ();
+ const address_space *aspace = regcache->aspace ();
+
pc = regcache_read_pc (regcache);
/* However, before doing so, if this single-step breakpoint was
@@ -5871,7 +5869,7 @@ handle_signal_stop (struct execution_control_state *ecs)
inline function call sites). */
if (ecs->event_thread->control.step_range_end != 1)
{
- struct address_space *aspace =
+ const address_space *aspace =
get_thread_regcache (ecs->ptid)->aspace ();
/* skip_inline_frames is expensive, so we avoid it if we can