gdbstub: fixes cases where wrong threads were reported to GDB on SIGINT
commit761e3c10881b5f521b19b713cf8d16c72c47affb
authorMatheus Branco Borella <dark.ryu.550@gmail.com>
Tue, 29 Aug 2023 16:15:24 +0000 (29 17:15 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 30 Aug 2023 13:57:50 +0000 (30 14:57 +0100)
treef6ea91ed5e74bf8fe868826ef8217d39890bf8f7
parenta8fea70f656416b2ed7d388fbcc7cc6cda126a82
gdbstub: fixes cases where wrong threads were reported to GDB on SIGINT

This fix is implemented by having the vCont handler set the value of
`gdbserver_state.c_cpu` if any threads are to be resumed. The specific
CPU picked is arbitrarily from the ones to be resumed, but it should
be okay, as all GDB cares about is that it is a resumed thread.

Signed-off-by: Matheus Branco Borella <dark.ryu.550@gmail.com>
Message-Id: <20230804182633.47300-2-dark.ryu.550@gmail.com>
[AJB: style and whitespace fixes]
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1725
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230829161528.2707696-9-alex.bennee@linaro.org>
gdbstub/gdbstub.c
tests/tcg/multiarch/gdbstub/interrupt.py [new file with mode: 0644]
tests/tcg/multiarch/system/Makefile.softmmu-target
tests/tcg/multiarch/system/interrupt.c [new file with mode: 0644]