qemu/gdbstub
Nicholas Piggin 108e8180c6 gdbstub: Fix client Ctrl-C handling
The gdb remote protocol has a special interrupt character (0x03) that is
transmitted outside the regular packet processing, and represents a
Ctrl-C pressed in the client. Despite not being a regular packet, it
does expect a regular stop response if the stub successfully stops the
running program.

See: https://sourceware.org/gdb/onlinedocs/gdb/Interrupts.html

Inhibiting the stop reply packet can lead to gdb client hang. So permit
a stop response when receiving a character from gdb that stops the vm.
Additionally, add a warning if that was not a 0x03 character, because
the gdb session is likely to end up getting confused if this happens.

Cc: qemu-stable@nongnu.org
Fixes: 758370052f ("gdbstub: only send stop-reply packets when allowed to")
Reported-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Tested-by: Joel Stanley <joel@jms.id.au>
Message-id: 20230711085903.304496-1-npiggin@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2023-07-31 14:57:32 +01:00
..
gdbstub.c gdbstub: Fix client Ctrl-C handling 2023-07-31 14:57:32 +01:00
internals.h gdbstub: Add support for info proc mappings 2023-07-03 12:52:34 +01:00
meson.build meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
softmmu.c gdbstub: lightly refactor connection to avoid snprintf 2023-07-03 12:52:30 +01:00
syscalls.c gdbstub: Build syscall.c once 2023-03-07 20:44:09 +00:00
trace-events gdbstub: move chunk of softmmu functionality to own file 2023-03-07 17:06:41 +00:00
trace.h gdbstub: move into its own sub directory 2022-10-06 11:53:41 +01:00
user-target.c gdbstub: Add support for info proc mappings 2023-07-03 12:52:34 +01:00
user.c gdbstub: only send stop-reply packets when allowed to 2023-05-18 12:40:52 -07:00