summaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-bfin-low.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2016-01-18 14:49:50 +0000
committerYao Qi <yao.qi@linaro.org>2016-01-18 14:59:11 +0000
commit276d4552dfc2dc3906fa2bd8690ea85b3d8ec055 (patch)
tree3477da1f3b332906956ced2c680a319b97ae3a5e /gdb/gdbserver/linux-bfin-low.c
parentb27896961a641e92a642b352627208233dfeb7f1 (diff)
downloadbinutils-gdb-276d4552dfc2dc3906fa2bd8690ea85b3d8ec055.tar.gz
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-bfin-low.c')
-rw-r--r--gdb/gdbserver/linux-bfin-low.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/gdb/gdbserver/linux-bfin-low.c b/gdb/gdbserver/linux-bfin-low.c
index 5fdb7d46be6..8d08f7ac94b 100644
--- a/gdb/gdbserver/linux-bfin-low.c
+++ b/gdb/gdbserver/linux-bfin-low.c
@@ -54,24 +54,6 @@ bfin_cannot_fetch_register (int regno)
return (regno >= bfin_num_regs);
}
-static CORE_ADDR
-bfin_get_pc (struct regcache *regcache)
-{
- unsigned long pc;
-
- collect_register_by_name (regcache, "pc", &pc);
-
- return pc;
-}
-
-static void
-bfin_set_pc (struct regcache *regcache, CORE_ADDR pc)
-{
- unsigned long newpc = pc;
-
- supply_register_by_name (regcache, "pc", &newpc);
-}
-
#define bfin_breakpoint_len 2
static const gdb_byte bfin_breakpoint[bfin_breakpoint_len] = {0xa1, 0x00};
@@ -137,8 +119,8 @@ struct linux_target_ops the_low_target = {
bfin_cannot_fetch_register,
bfin_cannot_store_register,
NULL, /* fetch_register */
- bfin_get_pc,
- bfin_set_pc,
+ linux_get_pc_32bit,
+ linux_set_pc_32bit,
NULL, /* breakpoint_kind_from_pc */
bfin_sw_breakpoint_from_kind,
NULL, /* get_next_pcs */