Get and set PC correctly on aarch64 in multi-arch
gdb/gdbserver: 2015-08-04 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c (aarch64_get_pc): Get PC register on both aarch64 and aarch32. (aarch64_set_pc): Likewise.
This commit is contained in:
parent
3b53ae99fb
commit
8a7e4587c4
|
@ -1,3 +1,9 @@
|
|||
2015-08-04 Yao Qi <yao.qi@linaro.org>
|
||||
|
||||
* linux-aarch64-low.c (aarch64_get_pc): Get PC register on
|
||||
both aarch64 and aarch32.
|
||||
(aarch64_set_pc): Likewise.
|
||||
|
||||
2015-08-04 Yao Qi <yao.qi@linaro.org>
|
||||
|
||||
* configure.srv (case aarch64*-*-linux*): Append arm-with-neon.o
|
||||
|
|
|
@ -154,6 +154,8 @@ extern int debug_threads;
|
|||
|
||||
static CORE_ADDR
|
||||
aarch64_get_pc (struct regcache *regcache)
|
||||
{
|
||||
if (register_size (regcache->tdesc, 0) == 8)
|
||||
{
|
||||
unsigned long pc;
|
||||
|
||||
|
@ -162,15 +164,33 @@ aarch64_get_pc (struct regcache *regcache)
|
|||
debug_printf ("stop pc is %08lx\n", pc);
|
||||
return pc;
|
||||
}
|
||||
else
|
||||
{
|
||||
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". */
|
||||
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int newpc = pc;
|
||||
supply_register_by_name (regcache, "pc", &newpc);
|
||||
}
|
||||
}
|
||||
|
||||
#define aarch64_breakpoint_len 4
|
||||
|
||||
|
|
Loading…
Reference in New Issue