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-cris-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-cris-low.c')
-rw-r--r-- | gdb/gdbserver/linux-cris-low.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/gdb/gdbserver/linux-cris-low.c b/gdb/gdbserver/linux-cris-low.c index ca0f0ff..45d4299 100644 --- a/gdb/gdbserver/linux-cris-low.c +++ b/gdb/gdbserver/linux-cris-low.c @@ -59,25 +59,6 @@ cris_cannot_fetch_register (int regno) return (regno >= cris_num_regs); } -extern int debug_threads; - -static CORE_ADDR -cris_get_pc (struct regcache *regcache) -{ - unsigned long pc; - collect_register_by_name (regcache, "pc", &pc); - if (debug_threads) - debug_printf ("stop pc is %08lx\n", pc); - return pc; -} - -static void -cris_set_pc (struct regcache *regcache, CORE_ADDR pc) -{ - unsigned long newpc = pc; - supply_register_by_name (regcache, "pc", &newpc); -} - static const unsigned short cris_breakpoint = 0xe938; #define cris_breakpoint_len 2 @@ -135,8 +116,8 @@ struct linux_target_ops the_low_target = { cris_cannot_fetch_register, cris_cannot_store_register, NULL, /* fetch_register */ - cris_get_pc, - cris_set_pc, + linux_get_pc_32bit, + linux_set_pc_32bit, NULL, /* breakpoint_kind_from_pc */ cris_sw_breakpoint_from_kind, NULL, /* get_next_pcs */ |