mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-30 00:52:16 +08:00
Add more debugging output to aarch64_displaced_step_fixup
While debugging the step-over-syscall problem, i wanted to see a bit more debugging output to try to determine the root cause. This patch does this. gdb/ChangeLog: 2020-01-21 Luis Machado <luis.machado@linaro.org> * aarch64-tdep.c (aarch64_displaced_step_fixup): Add more debugging output.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2020-01-21 Luis Machado <luis.machado@linaro.org>
|
||||||
|
|
||||||
|
* aarch64-tdep.c (aarch64_displaced_step_fixup): Add more debugging
|
||||||
|
output.
|
||||||
|
|
||||||
2020-01-21 Luis Machado <luis.machado@linaro.org>
|
2020-01-21 Luis Machado <luis.machado@linaro.org>
|
||||||
|
|
||||||
* aarch64-tdep.c (struct aarch64_displaced_step_closure )
|
* aarch64-tdep.c (struct aarch64_displaced_step_closure )
|
||||||
|
@ -3037,8 +3037,16 @@ aarch64_displaced_step_fixup (struct gdbarch *gdbarch,
|
|||||||
|
|
||||||
regcache_cooked_read_unsigned (regs, AARCH64_PC_REGNUM, &pc);
|
regcache_cooked_read_unsigned (regs, AARCH64_PC_REGNUM, &pc);
|
||||||
|
|
||||||
|
if (debug_displaced)
|
||||||
|
debug_printf ("Displaced: PC after stepping: %s (was %s).\n",
|
||||||
|
paddress (gdbarch, pc), paddress (gdbarch, to));
|
||||||
|
|
||||||
if (dsc->cond)
|
if (dsc->cond)
|
||||||
{
|
{
|
||||||
|
if (debug_displaced)
|
||||||
|
debug_printf ("Displaced: [Conditional] pc_adjust before: %d\n",
|
||||||
|
dsc->pc_adjust);
|
||||||
|
|
||||||
if (pc - to == 8)
|
if (pc - to == 8)
|
||||||
{
|
{
|
||||||
/* Condition is true. */
|
/* Condition is true. */
|
||||||
@ -3050,8 +3058,18 @@ aarch64_displaced_step_fixup (struct gdbarch *gdbarch,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
gdb_assert_not_reached ("Unexpected PC value after displaced stepping");
|
gdb_assert_not_reached ("Unexpected PC value after displaced stepping");
|
||||||
|
|
||||||
|
if (debug_displaced)
|
||||||
|
debug_printf ("Displaced: [Conditional] pc_adjust after: %d\n",
|
||||||
|
dsc->pc_adjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug_displaced)
|
||||||
|
debug_printf ("Displaced: %s PC by %d\n",
|
||||||
|
dsc->pc_adjust? "adjusting" : "not adjusting",
|
||||||
|
dsc->pc_adjust);
|
||||||
|
|
||||||
|
|
||||||
if (dsc->pc_adjust != 0)
|
if (dsc->pc_adjust != 0)
|
||||||
{
|
{
|
||||||
/* Make sure the previous instruction was executed (that is, the PC
|
/* Make sure the previous instruction was executed (that is, the PC
|
||||||
@ -3059,11 +3077,16 @@ aarch64_displaced_step_fixup (struct gdbarch *gdbarch,
|
|||||||
offset. Otherwise we may skip an instruction before its execution
|
offset. Otherwise we may skip an instruction before its execution
|
||||||
took place. */
|
took place. */
|
||||||
if ((pc - to) == 0)
|
if ((pc - to) == 0)
|
||||||
dsc->pc_adjust = 0;
|
{
|
||||||
|
if (debug_displaced)
|
||||||
|
debug_printf ("Displaced: PC did not move. Discarding PC "
|
||||||
|
"adjustment.\n");
|
||||||
|
dsc->pc_adjust = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (debug_displaced)
|
if (debug_displaced)
|
||||||
{
|
{
|
||||||
debug_printf ("displaced: fixup: set PC to %s:%d\n",
|
debug_printf ("Displaced: fixup: set PC to %s:%d\n",
|
||||||
paddress (gdbarch, from), dsc->pc_adjust);
|
paddress (gdbarch, from), dsc->pc_adjust);
|
||||||
}
|
}
|
||||||
regcache_cooked_write_unsigned (regs, AARCH64_PC_REGNUM,
|
regcache_cooked_write_unsigned (regs, AARCH64_PC_REGNUM,
|
||||||
|
Reference in New Issue
Block a user