]> git.proxmox.com Git - mirror_qemu.git/commit - linux-user/s390x/cpu_loop.c
linux-user: Don't call gdb_handlesig() before queue_signal()
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 19 Oct 2018 17:49:57 +0000 (18:49 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 12 Nov 2018 14:48:00 +0000 (15:48 +0100)
commitb10089a14cad93ca5cdcd441a23f522d1e15f554
tree68d25c7d18ec1b99279f9c3b783a6277766575e6
parente285977e77e534f128413b86cabab68bbffcbe4c
linux-user: Don't call gdb_handlesig() before queue_signal()

The CPU main-loop routines for linux-user generally
call gdb_handlesig() when they're about to queue a
SIGTRAP signal. This is wrong, because queue_signal()
will cause us to pend a signal, and process_pending_signals()
will then call gdb_handlesig() itself. So the effect is that
we notify gdb of the SIGTRAP, and then if gdb says "OK,
continue with signal X" we will incorrectly notify
gdb of the signal X as well. We don't do this double-notify
for anything else, only SIGTRAP.

Remove this unnecessary and incorrect code from all
the targets except for nios2 (whose main loop is
doing something different and broken, and will be handled
in a separate patch).

This bug only manifests if the user responds to the reported
SIGTRAP using "signal SIGFOO" rather than "continue"; since
the latter is the overwhelmingly common thing to do after a
breakpoint most people won't have hit this.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20181019174958.26616-2-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
16 files changed:
linux-user/aarch64/cpu_loop.c
linux-user/alpha/cpu_loop.c
linux-user/arm/cpu_loop.c
linux-user/cris/cpu_loop.c
linux-user/hppa/cpu_loop.c
linux-user/i386/cpu_loop.c
linux-user/m68k/cpu_loop.c
linux-user/microblaze/cpu_loop.c
linux-user/mips/cpu_loop.c
linux-user/openrisc/cpu_loop.c
linux-user/ppc/cpu_loop.c
linux-user/riscv/cpu_loop.c
linux-user/s390x/cpu_loop.c
linux-user/sh4/cpu_loop.c
linux-user/sparc/cpu_loop.c
linux-user/xtensa/cpu_loop.c