diff mbox series

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

Message ID 20210813131809.28655-2-peter.maydell@linaro.org
State Superseded
Headers show
Series linux-user: Clean up siginfo_t handling for arm, aarch64 | expand

Commit Message

Peter Maydell Aug. 13, 2021, 1:18 p.m. UTC
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>

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

-- 
2.20.1

Comments

Richard Henderson Aug. 15, 2021, 7:51 p.m. UTC | #1
On 8/13/21 3:18 AM, Peter Maydell wrote:
> 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>

> ---

>   linux-user/aarch64/cpu_loop.c | 1 +

>   1 file changed, 1 insertion(+)


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


r~
diff mbox series

Patch

diff --git a/linux-user/aarch64/cpu_loop.c b/linux-user/aarch64/cpu_loop.c
index ee72a1c20f0..5d8675944d9 100644
--- a/linux-user/aarch64/cpu_loop.c
+++ b/linux-user/aarch64/cpu_loop.c
@@ -148,6 +148,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: