diff options
author | Yao Qi <yao.qi@linaro.org> | 2016-01-18 14:49:50 +0000 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2016-01-18 14:59:11 +0000 |
commit | 276d4552dfc2dc3906fa2bd8690ea85b3d8ec055 (patch) | |
tree | 3477da1f3b332906956ced2c680a319b97ae3a5e /gdb/gdbserver/linux-nios2-low.c | |
parent | b27896961a641e92a642b352627208233dfeb7f1 (diff) | |
download | gdb-276d4552dfc2dc3906fa2bd8690ea85b3d8ec055.zip gdb-276d4552dfc2dc3906fa2bd8690ea85b3d8ec055.tar.gz gdb-276d4552dfc2dc3906fa2bd8690ea85b3d8ec055.tar.bz2 |
Replace some $ARCH_{get,set}_pc with linux_{get,set}_pc_32bit
This patch adds a pair of new functions linux_get_pc_32bit and
linux_set_pc_32bit which get and set 32-bit register "pc" from
regcache. This function can be used some targets and these own
$ARCH_{get,set}_pc are replaced by linux_{get,set}_pc_32bit
respectively.
This patch touches many targets, but I only have arm board to
test and no regression. I also rebuilt nios2-linux GDBserver.
If it is right to go, I'll post the 64-bit counterpart later.
gdb/gdbserver:
2016-01-18 Yao Qi <yao.qi@linaro.org>
* linux-arm-low.c (debug_threads): Remove declaration.
(arm_get_pc, arm_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-bfin-low.c (bfin_get_pc, bfin_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-cris-low.c (debug_threads): Remove declaration.
(cris_get_pc, cris_set_pc,): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-crisv32-low.c (debug_threads): Remove declaration.
(cris_get_pc, cris_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-low.c: Include inttypes.h.
(linux_get_pc_32bit, linux_set_pc_32bit): New functions.
* linux-low.h (linux_get_pc_32bit, linux_set_pc_32bit): Declare.
* linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-m68k-low.c (m68k_get_pc, m68k_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-nios2-low.c (nios2_get_pc, nios2_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-sh-low.c (sh_get_pc, sh_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
* linux-xtensa-low.c (xtensa_get_pc, xtensa_set_pc): Remove.
(the_low_target): Use linux_get_pc_32bit and
linux_set_pc_32bit.
Diffstat (limited to 'gdb/gdbserver/linux-nios2-low.c')
-rw-r--r-- | gdb/gdbserver/linux-nios2-low.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/gdb/gdbserver/linux-nios2-low.c b/gdb/gdbserver/linux-nios2-low.c index ba852ac..ea0ded1 100644 --- a/gdb/gdbserver/linux-nios2-low.c +++ b/gdb/gdbserver/linux-nios2-low.c @@ -95,28 +95,6 @@ nios2_cannot_store_register (int regno) return 0; } -/* Implement the get_pc linux_target_ops method. */ - -static CORE_ADDR -nios2_get_pc (struct regcache *regcache) -{ - union nios2_register pc; - - collect_register_by_name (regcache, "pc", pc.buf); - return pc.reg32; -} - -/* Implement the set_pc linux_target_ops method. */ - -static void -nios2_set_pc (struct regcache *regcache, CORE_ADDR pc) -{ - union nios2_register newpc; - - newpc.reg32 = pc; - supply_register_by_name (regcache, "pc", newpc.buf); -} - /* Breakpoint support. Also see comments on nios2_breakpoint_from_pc in nios2-tdep.c. */ @@ -263,8 +241,8 @@ struct linux_target_ops the_low_target = nios2_cannot_fetch_register, nios2_cannot_store_register, NULL, - nios2_get_pc, - nios2_set_pc, + linux_get_pc_32bit, + linux_set_pc_32bit, NULL, /* breakpoint_kind_from_pc */ nios2_sw_breakpoint_from_kind, NULL, /* get_next_pcs */ |