[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 35/52] gdbstub: Implement thread_alive (T pkt) with n
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PULL 35/52] gdbstub: Implement thread_alive (T pkt) with new infra |
Date: |
Fri, 7 Jun 2019 10:05:34 +0100 |
From: Jon Doron <address@hidden>
Signed-off-by: Jon Doron <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
diff --git a/gdbstub.c b/gdbstub.c
index 120e52f5d2..ad00f223f2 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1507,6 +1507,30 @@ static void handle_detach(GdbCmdContext *gdb_ctx, void
*user_ctx)
put_packet(s, "OK");
}
+static void handle_thread_alive(GdbCmdContext *gdb_ctx, void *user_ctx)
+{
+ CPUState *cpu;
+
+ if (!gdb_ctx->num_params) {
+ put_packet(gdb_ctx->s, "E22");
+ return;
+ }
+
+ if (gdb_ctx->params[0].thread_id.kind == GDB_READ_THREAD_ERR) {
+ put_packet(gdb_ctx->s, "E22");
+ return;
+ }
+
+ cpu = gdb_get_cpu(gdb_ctx->s, gdb_ctx->params[0].thread_id.pid,
+ gdb_ctx->params[0].thread_id.tid);
+ if (!cpu) {
+ put_packet(gdb_ctx->s, "E22");
+ return;
+ }
+
+ put_packet(gdb_ctx->s, "OK");
+}
+
static int gdb_handle_packet(GDBState *s, const char *line_buf)
{
CPUState *cpu;
@@ -1807,17 +1831,14 @@ static int gdb_handle_packet(GDBState *s, const char
*line_buf)
}
break;
case 'T':
- thread_kind = read_thread_id(p, &p, &pid, &tid);
- if (thread_kind == GDB_READ_THREAD_ERR) {
- put_packet(s, "E22");
- break;
- }
- cpu = gdb_get_cpu(s, pid, tid);
-
- if (cpu != NULL) {
- put_packet(s, "OK");
- } else {
- put_packet(s, "E22");
+ {
+ static const GdbCmdParseEntry thread_alive_cmd_desc = {
+ .handler = handle_thread_alive,
+ .cmd = "T",
+ .cmd_startswith = 1,
+ .schema = "t0"
+ };
+ cmd_parser = &thread_alive_cmd_desc;
}
break;
case 'q':
--
2.20.1
- [Qemu-devel] [PULL 13/52] tests/vm: python3 fixes, (continued)
- [Qemu-devel] [PULL 13/52] tests/vm: python3 fixes, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 25/52] tests/vm: ubuntu.i386: apt proxy setup, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 27/52] cputlb: use uint64_t for interim values for unaligned load, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 44/52] gdbstub: Implement write all registers (G pkt) with new infra, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 50/52] gdbstub: Implement target halted (? pkt) with new infra, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 28/52] tests/tcg: better detect truncated reads, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 46/52] gdbstub: Implement file io (F pkt) with new infra, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 33/52] gdbstub: Add infrastructure to parse cmd packets, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 47/52] gdbstub: Implement step (s pkt) with new infra, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 41/52] gdbstub: Implement get register (p pkt) with new infra, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 35/52] gdbstub: Implement thread_alive (T pkt) with new infra,
Alex Bennée <=
- [Qemu-devel] [PULL 37/52] gdbstub: Implement continue with signal (C pkt) with new infra, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 16/52] tests/vm: run test builds on snapshot, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 34/52] gdbstub: Implement deatch (D pkt) with new infra, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 21/52] tests/vm: openbsd autoinstall, using serial console, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 22/52] tests/vm: freebsd autoinstall, using serial console, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 14/52] tests/vm: send proxy environment variables over ssh, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 31/52] MAINTAINERS: put myself forward for gdbstub, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 19/52] tests/vm: add DEBUG=1 to help text, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 39/52] gdbstub: Implement breakpoint commands (Z/z pkt) with new infra, Alex Bennée, 2019/06/07
- [Qemu-devel] [PULL 52/52] gdbstub: Implement qemu physical memory mode, Alex Bennée, 2019/06/07