forked from Imagelibrary/binutils-gdb
[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.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
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.
|
||||||
|
|
||||||
2016-02-12 Yao Qi <yao.qi@linaro.org>
|
2016-02-12 Yao Qi <yao.qi@linaro.org>
|
||||||
|
|
||||||
* linux-arm-low.c (get_next_pcs_ops): Initialize it with
|
* linux-arm-low.c (get_next_pcs_ops): Initialize it with
|
||||||
|
|||||||
@@ -163,23 +163,9 @@ static CORE_ADDR
|
|||||||
aarch64_get_pc (struct regcache *regcache)
|
aarch64_get_pc (struct regcache *regcache)
|
||||||
{
|
{
|
||||||
if (register_size (regcache->tdesc, 0) == 8)
|
if (register_size (regcache->tdesc, 0) == 8)
|
||||||
{
|
return linux_get_pc_64bit (regcache);
|
||||||
unsigned long pc;
|
|
||||||
|
|
||||||
collect_register_by_name (regcache, "pc", &pc);
|
|
||||||
if (debug_threads)
|
|
||||||
debug_printf ("stop pc is %08lx\n", pc);
|
|
||||||
return pc;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
return linux_get_pc_32bit (regcache);
|
||||||
unsigned int pc;
|
|
||||||
|
|
||||||
collect_register_by_name (regcache, "pc", &pc);
|
|
||||||
if (debug_threads)
|
|
||||||
debug_printf ("stop pc is %04x\n", pc);
|
|
||||||
return pc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Implementation of linux_target_ops method "set_pc". */
|
/* Implementation of linux_target_ops method "set_pc". */
|
||||||
@@ -188,15 +174,9 @@ static void
|
|||||||
aarch64_set_pc (struct regcache *regcache, CORE_ADDR pc)
|
aarch64_set_pc (struct regcache *regcache, CORE_ADDR pc)
|
||||||
{
|
{
|
||||||
if (register_size (regcache->tdesc, 0) == 8)
|
if (register_size (regcache->tdesc, 0) == 8)
|
||||||
{
|
linux_set_pc_64bit (regcache, pc);
|
||||||
unsigned long newpc = pc;
|
|
||||||
supply_register_by_name (regcache, "pc", &newpc);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
linux_set_pc_32bit (regcache, pc);
|
||||||
unsigned int newpc = pc;
|
|
||||||
supply_register_by_name (regcache, "pc", &newpc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define aarch64_breakpoint_len 4
|
#define aarch64_breakpoint_len 4
|
||||||
|
|||||||
Reference in New Issue
Block a user