[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH v3 06/16] gdbstub: add multiprocess support to 'sC' pa
From: |
Luc Michel |
Subject: |
[Qemu-arm] [PATCH v3 06/16] gdbstub: add multiprocess support to 'sC' packets |
Date: |
Fri, 26 Oct 2018 10:16:43 +0200 |
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>
---
gdbstub.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index d1ec245d1d..17fec8a41c 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1543,13 +1543,18 @@ static int gdb_handle_packet(GDBState *s, const char
*line_buf)
type = strtoul(p, (char **)&p, 16);
sstep_flags = type;
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;
goto report_cpuinfo;
} else if (strcmp(p,"sThreadInfo") == 0) {
--
2.19.1
- [Qemu-arm] [PATCH v3 15/16] gdbstub: add multiprocess extension support, (continued)
- [Qemu-arm] [PATCH v3 15/16] gdbstub: add multiprocess extension support, Luc Michel, 2018/10/26
- [Qemu-arm] [PATCH v3 11/16] gdbstub: add support for extended mode packet, Luc Michel, 2018/10/26
- [Qemu-arm] [PATCH v3 12/16] gdbstub: add support for vAttach packets, Luc Michel, 2018/10/26
- [Qemu-arm] [PATCH v3 14/16] gdbstub: gdb_set_stop_cpu: ignore request when process is not attached, Luc Michel, 2018/10/26
- [Qemu-arm] [PATCH v3 16/16] arm/xlnx-zynqmp: put APUs and RPUs in separate CPU clusters, Luc Michel, 2018/10/26
- [Qemu-arm] [PATCH v3 08/16] gdbstub: add multiprocess support to Xfer:features:read:, Luc Michel, 2018/10/26
- [Qemu-arm] [PATCH v3 13/16] gdbstub: processes initialization on new peer connection, Luc Michel, 2018/10/26
- [Qemu-arm] [PATCH v3 05/16] gdbstub: add multiprocess support to vCont packets, Luc Michel, 2018/10/26
- [Qemu-arm] [PATCH v3 06/16] gdbstub: add multiprocess support to 'sC' packets,
Luc Michel <=
- [Qemu-arm] [PATCH v3 07/16] gdbstub: add multiprocess support to (f|s)ThreadInfo and ThreadExtraInfo, Luc Michel, 2018/10/26
- [Qemu-arm] [PATCH v3 01/16] hw/cpu: introduce CPU clusters, Luc Michel, 2018/10/26
- [Qemu-arm] [PATCH v3 09/16] gdbstub: add multiprocess support to gdb_vm_state_change(), Luc Michel, 2018/10/26
- [Qemu-arm] [PATCH v3 02/16] gdbstub: introduce GDB processes, Luc Michel, 2018/10/26
- [Qemu-arm] [PATCH v3 04/16] gdbstub: add multiprocess support to 'H' and 'T' packets, Luc Michel, 2018/10/26
- [Qemu-arm] [PATCH v3 03/16] gdbstub: add multiprocess support to '?' packets, Luc Michel, 2018/10/26