[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 12/16] gdbstub: add support for vAttach packets
From: |
Luc Michel |
Subject: |
[Qemu-devel] [PATCH v8 12/16] gdbstub: add support for vAttach packets |
Date: |
Fri, 7 Dec 2018 10:01:30 +0100 |
Add support for the vAttach packets. In multiprocess mode, GDB sends
them to attach to additional processes.
Signed-off-by: Luc Michel <address@hidden>
Reviewed-by: Edgar E. Iglesias <address@hidden>
Acked-by: Alistair Francis <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
gdbstub.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/gdbstub.c b/gdbstub.c
index 1cf1bea428..8601be533b 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1347,10 +1347,45 @@ static int gdb_handle_packet(GDBState *s, const char
*line_buf)
break;
}
goto unknown_command;
}
break;
+ } else if (strncmp(p, "Attach;", 7) == 0) {
+ unsigned long pid;
+
+ p += 7;
+
+ if (qemu_strtoul(p, &p, 16, &pid)) {
+ put_packet(s, "E22");
+ break;
+ }
+
+ process = gdb_get_process(s, pid);
+
+ if (process == NULL) {
+ put_packet(s, "E22");
+ break;
+ }
+
+ cpu = get_first_cpu_in_process(s, process);
+
+ if (cpu == NULL) {
+ /* Refuse to attach an empty process */
+ put_packet(s, "E22");
+ break;
+ }
+
+ process->attached = true;
+
+ s->g_cpu = cpu;
+ s->c_cpu = cpu;
+
+ snprintf(buf, sizeof(buf), "T%02xthread:%s;", GDB_SIGNAL_TRAP,
+ gdb_fmt_thread_id(s, cpu, thread_id, sizeof(thread_id)));
+
+ put_packet(s, buf);
+ break;
} else {
goto unknown_command;
}
case 'k':
/* Kill the target */
--
2.19.2
- [Qemu-devel] [PATCH v8 09/16] gdbstub: add multiprocess support to gdb_vm_state_change(), (continued)
- [Qemu-devel] [PATCH v8 09/16] gdbstub: add multiprocess support to gdb_vm_state_change(), Luc Michel, 2018/12/07
- [Qemu-devel] [PATCH v8 07/16] gdbstub: add multiprocess support to (f|s)ThreadInfo and ThreadExtraInfo, Luc Michel, 2018/12/07
- [Qemu-devel] [PATCH v8 03/16] gdbstub: add multiprocess support to '?' packets, Luc Michel, 2018/12/07
- [Qemu-devel] [PATCH v8 06/16] gdbstub: add multiprocess support to 'sC' packets, Luc Michel, 2018/12/07
- [Qemu-devel] [PATCH v8 02/16] gdbstub: introduce GDB processes, Luc Michel, 2018/12/07
- [Qemu-devel] [PATCH v8 08/16] gdbstub: add multiprocess support to Xfer:features:read:, Luc Michel, 2018/12/07
- [Qemu-devel] [PATCH v8 04/16] gdbstub: add multiprocess support to 'H' and 'T' packets, Luc Michel, 2018/12/07
- [Qemu-devel] [PATCH v8 05/16] gdbstub: add multiprocess support to vCont packets, Luc Michel, 2018/12/07
- [Qemu-devel] [PATCH v8 12/16] gdbstub: add support for vAttach packets,
Luc Michel <=
- [Qemu-devel] [PATCH v8 13/16] gdbstub: processes initialization on new peer connection, Luc Michel, 2018/12/07
- [Qemu-devel] [PATCH v8 16/16] arm/xlnx-zynqmp: put APUs and RPUs in separate CPU clusters, Luc Michel, 2018/12/07
- [Qemu-devel] [PATCH v8 01/16] hw/cpu: introduce CPU clusters, Luc Michel, 2018/12/07
- [Qemu-devel] [PATCH v8 10/16] gdbstub: add multiprocess support to 'D' packets, Luc Michel, 2018/12/07
- [Qemu-devel] [PATCH v8 14/16] gdbstub: gdb_set_stop_cpu: ignore request when process is not attached, Luc Michel, 2018/12/07
- [Qemu-devel] [PATCH v8 15/16] gdbstub: add multiprocess extension support, Luc Michel, 2018/12/07
- [Qemu-devel] [PATCH v8 11/16] gdbstub: add support for extended mode packet, Luc Michel, 2018/12/07
- Re: [Qemu-devel] [PATCH v8 00/16] gdbstub: support for the multiprocess extension, Luc Michel, 2018/12/17