diff options
author | Will Deacon <will.deacon@arm.com> | 2016-09-01 13:35:02 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-09-02 16:55:58 +0100 |
commit | adeb68ef85235f952b77e01c4dadfd60851890d9 (patch) | |
tree | bb239199859508474b046e9169f8d234aff9433d /arch/arm64/kernel/debug-monitors.c | |
parent | a9be2ee09385387819ca22bf6522b2437334489e (diff) | |
download | linux-stable-adeb68ef85235f952b77e01c4dadfd60851890d9.tar.gz linux-stable-adeb68ef85235f952b77e01c4dadfd60851890d9.tar.bz2 linux-stable-adeb68ef85235f952b77e01c4dadfd60851890d9.zip |
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: Yao Qi <yao.qi@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/kernel/debug-monitors.c')
-rw-r--r-- | arch/arm64/kernel/debug-monitors.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c index 30821928106f..d97fdc1f6a38 100644 --- a/arch/arm64/kernel/debug-monitors.c +++ b/arch/arm64/kernel/debug-monitors.c @@ -236,7 +236,7 @@ static int single_step_handler(unsigned long addr, unsigned int esr, return 0; if (user_mode(regs)) { - send_user_sigtrap(TRAP_HWBKPT); + send_user_sigtrap(TRAP_TRACE); /* * ptrace will disable single step unless explicitly @@ -364,7 +364,7 @@ NOKPROBE_SYMBOL(aarch32_break_handler); static int __init debug_traps_init(void) { 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, TRAP_BRKPT, "ptrace BRK handler"); return 0; |