===8<===
define my-si
set $instr = *(int *)$pc
set $opsr = $cpsr
set $cpsr = $cpsr | 0x80
stepi
# If interrupt was enabled before stepi, restore the I flag.
if !($opsr & 0x80)
# msr daifset, <val>
if (($instr & 0xfffff0ff) == 0xd50340df)
if !($instr & 0x200)
set $cpsr = $cpsr & ~0x80
end
else
# msr daif, <reg>
if (($instr & 0xffffffe0) == 0xd51b4220)
eval "set $val = $x%d", $instr & 0x1f
if !($val & 0x80)
set $cpsr = $cpsr & ~0x80
end
else
set $cpsr = $cpsr & ~0x80
end
end
end
end
===>8===
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Jason Wessel <jason.wessel@windriver.com>
---
arch/arm64/kernel/kgdb.c | 4 ++++
1 file changed, 4 insertions(+)
@@ -253,6 +253,10 @@ static int kgdb_step_brk_fn(struct pt_regs *regs, unsigned int esr)
return DBG_HOOK_ERROR;
kgdb_handle_exception(1, SIGTRAP, 0, regs);
+
+ /* rewind a single step */
+ regs->pstate |= DBG_SPSR_SS;
+
return 0;
}
NOKPROBE_SYMBOL(kgdb_step_brk_fn);