aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-aarch64-low.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2016-02-12 16:08:25 +0000
committerYao Qi <yao.qi@linaro.org>2016-02-12 16:08:25 +0000
commita5652c21a829088da97a525fbcd9c9912b64c9dc (patch)
treea9997ac55dae0620ea7065ac0ab4c28d45ed23bd /gdb/gdbserver/linux-aarch64-low.c
parent01113bc1c50ff1202517377afd7162861e66846f (diff)
downloadgdb-a5652c21a829088da97a525fbcd9c9912b64c9dc.zip
gdb-a5652c21a829088da97a525fbcd9c9912b64c9dc.tar.gz
gdb-a5652c21a829088da97a525fbcd9c9912b64c9dc.tar.bz2
[gdbserver, aarch64] Use linux_{set,get}_pc_{64,32}bit
We can use shared functions linux_{set,get}_pc_{64,32}bit in linux-aarch64-low.c to write and read pc. gdb/gdbserver: 2016-02-12 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c (aarch64_get_pc): Call linux_get_pc_64bit or linux_get_pc_32bit. (aarch64_set_pc): Call linux_set_pc_64bit or linux_set_pc_32bit.
Diffstat (limited to 'gdb/gdbserver/linux-aarch64-low.c')
-rw-r--r--gdb/gdbserver/linux-aarch64-low.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c
index 806a762..12fe2e6 100644
--- a/gdb/gdbserver/linux-aarch64-low.c
+++ b/gdb/gdbserver/linux-aarch64-low.c
@@ -163,23 +163,9 @@ static CORE_ADDR
aarch64_get_pc (struct regcache *regcache)
{
if (register_size (regcache->tdesc, 0) == 8)
- {
- unsigned long pc;
-
- collect_register_by_name (regcache, "pc", &pc);
- if (debug_threads)
- debug_printf ("stop pc is %08lx\n", pc);
- return pc;
- }
+ return linux_get_pc_64bit (regcache);
else
- {
- unsigned int pc;
-
- collect_register_by_name (regcache, "pc", &pc);
- if (debug_threads)
- debug_printf ("stop pc is %04x\n", pc);
- return pc;
- }
+ return linux_get_pc_32bit (regcache);
}
/* Implementation of linux_target_ops method "set_pc". */
@@ -188,15 +174,9 @@ static void
aarch64_set_pc (struct regcache *regcache, CORE_ADDR pc)
{
if (register_size (regcache->tdesc, 0) == 8)
- {
- unsigned long newpc = pc;
- supply_register_by_name (regcache, "pc", &newpc);
- }
+ linux_set_pc_64bit (regcache, pc);
else
- {
- unsigned int newpc = pc;
- supply_register_by_name (regcache, "pc", &newpc);
- }
+ linux_set_pc_32bit (regcache, pc);
}
#define aarch64_breakpoint_len 4