aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-arm-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-arm-low.c
parentb27896961a641e92a642b352627208233dfeb7f1 (diff)
downloadgdb-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-arm-low.c')
-rw-r--r--gdb/gdbserver/linux-arm-low.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index 927a6fa..57cb855 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -245,25 +245,6 @@ arm_store_vfpregset (struct regcache *regcache, const void *buf)
arm_store_vfpregset_num (regcache, buf, num);
}
-extern int debug_threads;
-
-static CORE_ADDR
-arm_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
-arm_set_pc (struct regcache *regcache, CORE_ADDR pc)
-{
- unsigned long newpc = pc;
- supply_register_by_name (regcache, "pc", &newpc);
-}
-
/* Wrapper of arm_is_thumb_mode for get_next_pcs. */
static int
get_next_pcs_is_thumb (struct arm_get_next_pcs *self)
@@ -1011,8 +992,8 @@ struct linux_target_ops the_low_target = {
arm_cannot_fetch_register,
arm_cannot_store_register,
NULL, /* fetch_register */
- arm_get_pc,
- arm_set_pc,
+ linux_get_pc_32bit,
+ linux_set_pc_32bit,
arm_breakpoint_kind_from_pc,
arm_sw_breakpoint_from_kind,
arm_gdbserver_get_next_pcs,