提交 adeb68ef 编写于 作者: W Will Deacon

arm64: debug: report TRAP_TRACE instead of TRAP_HWBRPT for singlestep

Single-step traps to userspace (e.g. via ptrace) are expected to use
the TRAP_TRACE for the si_code field of the siginfo, as opposed to
TRAP_HWBRPT that we report currently.

Fix the reported value, which has no effect on existing and legacy
builds of GDB.
Reported-by: NYao Qi <yao.qi@arm.com>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
上级 a9be2ee0
...@@ -236,7 +236,7 @@ static int single_step_handler(unsigned long addr, unsigned int esr, ...@@ -236,7 +236,7 @@ static int single_step_handler(unsigned long addr, unsigned int esr,
return 0; return 0;
if (user_mode(regs)) { if (user_mode(regs)) {
send_user_sigtrap(TRAP_HWBKPT); send_user_sigtrap(TRAP_TRACE);
/* /*
* ptrace will disable single step unless explicitly * ptrace will disable single step unless explicitly
...@@ -364,7 +364,7 @@ NOKPROBE_SYMBOL(aarch32_break_handler); ...@@ -364,7 +364,7 @@ NOKPROBE_SYMBOL(aarch32_break_handler);
static int __init debug_traps_init(void) static int __init debug_traps_init(void)
{ {
hook_debug_fault_code(DBG_ESR_EVT_HWSS, single_step_handler, SIGTRAP, hook_debug_fault_code(DBG_ESR_EVT_HWSS, single_step_handler, SIGTRAP,
TRAP_HWBKPT, "single-step handler"); TRAP_TRACE, "single-step handler");
hook_debug_fault_code(DBG_ESR_EVT_BRK, brk_handler, SIGTRAP, hook_debug_fault_code(DBG_ESR_EVT_BRK, brk_handler, SIGTRAP,
TRAP_BRKPT, "ptrace BRK handler"); TRAP_BRKPT, "ptrace BRK handler");
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册