diff mbox series

[PULL,1/7] linux-user/aarch64: Set siginfo_t addr field for SIGTRAP signals

Message ID 20210924135631.2067582-2-laurent@vivier.eu
State Accepted
Commit 1fb6a87d0bc3a730ec90578cfdfb2ef7ac5b5d11
Headers show
Series [PULL,1/7] linux-user/aarch64: Set siginfo_t addr field for SIGTRAP signals | expand

Commit Message

Laurent Vivier Sept. 24, 2021, 1:56 p.m. UTC
From: Peter Maydell <peter.maydell@linaro.org>


When generating a TRAP_BRKPT SIGTRAP, set the siginfo_t addr field
to the PC where the breakpoint/singlestep trap occurred; this is
what the kernel does for this signal for this architecture.

Fixes: Coverity 1459154
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

Message-Id: <20210813131809.28655-2-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>

---
 linux-user/aarch64/cpu_loop.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.31.1
diff mbox series

Patch

diff --git a/linux-user/aarch64/cpu_loop.c b/linux-user/aarch64/cpu_loop.c
index 5425b85659a9..980e734e54f3 100644
--- a/linux-user/aarch64/cpu_loop.c
+++ b/linux-user/aarch64/cpu_loop.c
@@ -150,6 +150,7 @@  void cpu_loop(CPUARMState *env)
             info.si_signo = TARGET_SIGTRAP;
             info.si_errno = 0;
             info.si_code = TARGET_TRAP_BRKPT;
+            info._sifields._sigfault._addr = env->pc;
             queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
             break;
         case EXCP_SEMIHOST: