[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 05/21] gdbstub: Implement continue with signal (C
From: |
Jon Doron |
Subject: |
[Qemu-devel] [PATCH v5 05/21] gdbstub: Implement continue with signal (C pkt) with new infra |
Date: |
Wed, 24 Apr 2019 22:38:43 +0300 |
Signed-off-by: Jon Doron <address@hidden>
---
gdbstub.c | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index a38f9d4ef9..8e922a2df4 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1533,6 +1533,21 @@ static void handle_continue(GdbCmdContext *gdb_ctx, void
*user_ctx)
gdb_continue(gdb_ctx->s);
}
+static void handle_cont_with_sig(GdbCmdContext *gdb_ctx, void *user_ctx)
+{
+ unsigned long signal = 0;
+
+ if (gdb_ctx->num_params) {
+ signal = gdb_ctx->params[0].val_ul;
+ }
+
+ gdb_ctx->s->signal = gdb_signal_to_target(signal);
+ if (gdb_ctx->s->signal == -1) {
+ gdb_ctx->s->signal = 0;
+ }
+ gdb_continue(gdb_ctx->s);
+}
+
static int gdb_handle_packet(GDBState *s, const char *line_buf)
{
CPUState *cpu;
@@ -1580,11 +1595,16 @@ static int gdb_handle_packet(GDBState *s, const char
*line_buf)
}
break;
case 'C':
- s->signal = gdb_signal_to_target (strtoul(p, (char **)&p, 16));
- if (s->signal == -1)
- s->signal = 0;
- gdb_continue(s);
- return RS_IDLE;
+ {
+ static const GdbCmdParseEntry cont_with_sig_cmd_desc = {
+ .handler = handle_cont_with_sig,
+ .cmd = "C",
+ .cmd_startswith = 1,
+ .schema = "l0"
+ };
+ cmd_parser = &cont_with_sig_cmd_desc;
+ }
+ break;
case 'v':
if (strncmp(p, "Cont", 4) == 0) {
p += 4;
--
2.20.1
- [Qemu-devel] [PATCH v5 03/21] gdbstub: Implement thread_alive (T pkt) with new infra, (continued)
- [Qemu-devel] [PATCH v5 03/21] gdbstub: Implement thread_alive (T pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 04/21] gdbstub: Implement continue (c pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 02/21] gdbstub: Implement deatch (D pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 09/21] gdbstub: Implement set register (P pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 06/21] gdbstub: Implement set_thread (H pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 07/21] gdbstub: Implement insert breakpoint (Z pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 10/21] gdbstub: Implement get register (p pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 08/21] gdbstub: Implement remove breakpoint (z pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 12/21] gdbstub: Implement read memory (m pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 14/21] gdbstub: Implement read all registers (g pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 05/21] gdbstub: Implement continue with signal (C pkt) with new infra,
Jon Doron <=
- [Qemu-devel] [PATCH v5 11/21] gdbstub: Implement write memory (M pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 13/21] gdbstub: Implement write all registers (G pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 15/21] gdbstub: Implement file io (F pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 16/21] gdbstub: Implement step (s pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 17/21] gdbstub: Implement v commands with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 18/21] gdbstub: Implement generic query (q pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 19/21] gdbstub: Implement generic set (Q pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 20/21] gdbstub Implement target halted (? pkt) with new infra, Jon Doron, 2019/04/24
- [Qemu-devel] [PATCH v5 21/21] gdbstub: Clear unused variables in gdb_handle_packet, Jon Doron, 2019/04/24