From d80209703ec2fc85e0a4b3d4d23e7ed448987aca Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Tue, 26 Jan 2016 14:08:26 +0000 Subject: [PATCH] [GDBserver] Use regcache_read_pc in install_software_single_step_breakpoints In install_software_single_step_breakpoints, we've got the regcache of current_thread, so we don't have to bother get_pc to get pc, instead we can get pc from regcache directly. Note that the callers of install_software_single_step_breakpoints have already switched current_thread to LWP. Since the pc is got from regcache_read_pc, in the next patch, we can get pc inside the implementation of *the_low_target.get_next_pcs and stop passing pc to *the_low_target.get_next_pcs. gdb/gdbserver: 2016-01-26 Yao Qi * linux-low.c (install_software_single_step_breakpoints): Call regcache_read_pc instead of get_pc. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/linux-low.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 0ba902e7c03..8c1677de821 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2016-01-26 Yao Qi + + * linux-low.c (install_software_single_step_breakpoints): Call + regcache_read_pc instead of get_pc. + 2016-01-26 Yao Qi * remote-utils.c (remote_close) [!USE_WIN32API]: Ignore SIGIO. diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 1f3fc0825f6..b35b5693e94 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -4103,7 +4103,8 @@ install_software_single_step_breakpoints (struct lwp_info *lwp) VEC (CORE_ADDR) *next_pcs = NULL; struct cleanup *old_chain = make_cleanup (VEC_cleanup (CORE_ADDR), &next_pcs); - pc = get_pc (lwp); + pc = regcache_read_pc (regcache); + next_pcs = (*the_low_target.get_next_pcs) (pc, regcache); for (i = 0; VEC_iterate (CORE_ADDR, next_pcs, i, pc); ++i) -- 2.39.5