[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/37] gdbstub: add multiprocess support to 'sC' pack
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 08/37] gdbstub: add multiprocess support to 'sC' packets |
Date: |
Mon, 7 Jan 2019 16:30:48 +0000 |
From: Luc Michel <address@hidden>
Change the sC packet handling to support the multiprocess extension.
Instead of returning the first thread, we return the first thread of the
current process.
Signed-off-by: Luc Michel <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
Reviewed-by: Edgar E. Iglesias <address@hidden>
Message-id: address@hidden
[PMM: corrected checkpatch comment style nit]
Signed-off-by: Peter Maydell <address@hidden>
---
gdbstub.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index 09114ea7769..1ba7aa6a28a 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1554,9 +1554,15 @@ static int gdb_handle_packet(GDBState *s, const char
*line_buf)
put_packet(s, "OK");
break;
} else if (strcmp(p,"C") == 0) {
- /* "Current thread" remains vague in the spec, so always return
- * the first CPU (gdb returns the first thread). */
- put_packet(s, "QC1");
+ /*
+ * "Current thread" remains vague in the spec, so always return
+ * the first thread of the current process (gdb returns the
+ * first thread).
+ */
+ cpu = get_first_cpu_in_process(s, gdb_get_cpu_process(s,
s->g_cpu));
+ snprintf(buf, sizeof(buf), "QC%s",
+ gdb_fmt_thread_id(s, cpu, thread_id, sizeof(thread_id)));
+ put_packet(s, buf);
break;
} else if (strcmp(p,"fThreadInfo") == 0) {
s->query_cpu = first_cpu;
--
2.19.2
- [Qemu-devel] [PULL 02/37] target/arm: SVE brk[ab] merging does not have s bit, (continued)
- [Qemu-devel] [PULL 02/37] target/arm: SVE brk[ab] merging does not have s bit, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 03/37] hw/cpu: introduce CPU clusters, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 01/37] target/arm: Convert ARM_TBFLAG_* to FIELDs, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 04/37] gdbstub: introduce GDB processes, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 05/37] gdbstub: add multiprocess support to '?' packets, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 06/37] gdbstub: add multiprocess support to 'H' and 'T' packets, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 07/37] gdbstub: add multiprocess support to vCont packets, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 09/37] gdbstub: add multiprocess support to (f|s)ThreadInfo and ThreadExtraInfo, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 08/37] gdbstub: add multiprocess support to 'sC' packets,
Peter Maydell <=
- [Qemu-devel] [PULL 10/37] gdbstub: add multiprocess support to Xfer:features:read:, Peter Maydell, 2019/01/07
- [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