[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 16/37] gdbstub: gdb_set_stop_cpu: ignore request when
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 16/37] gdbstub: gdb_set_stop_cpu: ignore request when process is not attached |
Date: |
Mon, 7 Jan 2019 16:30:56 +0000 |
From: Luc Michel <address@hidden>
When gdb_set_stop_cpu() is called with a CPU associated to a process
currently not attached by the GDB client, return without modifying the
stop CPU. Otherwise, GDB gets confused if it receives packets with a
thread-id it does not know about.
Signed-off-by: Luc Michel <address@hidden>
Acked-by: Alistair Francis <address@hidden>
Reviewed-by: Edgar E. Iglesias <address@hidden>
Message-id: address@hidden
[PMM: fix checkpatch comment style nit]
Signed-off-by: Peter Maydell <address@hidden>
---
gdbstub.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/gdbstub.c b/gdbstub.c
index 432e7d2f7da..1517563abe1 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1798,6 +1798,16 @@ static int gdb_handle_packet(GDBState *s, const char
*line_buf)
void gdb_set_stop_cpu(CPUState *cpu)
{
+ GDBProcess *p = gdb_get_cpu_process(gdbserver_state, cpu);
+
+ if (!p->attached) {
+ /*
+ * Having a stop CPU corresponding to a process that is not attached
+ * confuses GDB. So we ignore the request.
+ */
+ return;
+ }
+
gdbserver_state->c_cpu = cpu;
gdbserver_state->g_cpu = cpu;
}
--
2.19.2
- [Qemu-devel] [PULL 11/37] gdbstub: add multiprocess support to gdb_vm_state_change(), (continued)
- [Qemu-devel] [PULL 11/37] gdbstub: add multiprocess support to gdb_vm_state_change(), Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 14/37] gdbstub: add support for vAttach packets, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 17/37] gdbstub: add multiprocess extension support, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 15/37] gdbstub: processes initialization on new peer connection, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 19/37] Revert "armv7m: Guard against no -kernel argument", Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 12/37] gdbstub: add multiprocess support to 'D' packets, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 13/37] gdbstub: add support for extended mode packet, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 20/37] hw/arm: versal: Plug memory leaks, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 18/37] arm/xlnx-zynqmp: put APUs and RPUs in separate CPU clusters, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 22/37] cpus.c: Fix race condition in cpu_stop_current(), Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 16/37] gdbstub: gdb_set_stop_cpu: ignore request when process is not attached,
Peter Maydell <=
- [Qemu-devel] [PULL 21/37] MAINTAINERS: Add ARM-related files for hw/[misc|input|timer]/, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 24/37] qtest: Add set_irq_in command to set IRQ/GPIO level, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 23/37] hw/arm/allwinner-a10: Add the 'A' SRAM and the SRAM controller, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 27/37] arm: Instantiate NRF51 random number generator, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 25/37] arm: Add header to host common definition for nRF51 SOC peripherals, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 30/37] tests/microbit-test: Add Tests for nRF51 GPIO, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 26/37] hw/misc/nrf51_rng: Add NRF51 random number generator peripheral, Peter Maydell, 2019/01/07