]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
linux-user/arm: Set siginfo_t addr field for SIGTRAP signals
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 13 Aug 2021 13:18:04 +0000 (14:18 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 23 Sep 2021 12:42:55 +0000 (14:42 +0200)
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.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210813131809.28655-3-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/arm/cpu_loop.c

index 07032b3006100f2d03b495a6a40aad96c7a459c2..0900d18105a124709ef3ab0fa02b31338db782a9 100644 (file)
@@ -455,6 +455,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->regs[15];
             queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
             break;
         case EXCP_KERNEL_TRAP: