[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 04/21] gdbstub: Implement continue (c pkt) with n
From: |
Jon Doron |
Subject: |
[Qemu-devel] [PATCH v5 04/21] gdbstub: Implement continue (c pkt) with new infra |
Date: |
Wed, 24 Apr 2019 22:38:42 +0300 |
Signed-off-by: Jon Doron <address@hidden>
---
gdbstub.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index 29ca6be3df..a38f9d4ef9 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1523,6 +1523,16 @@ static void handle_thread_alive(GdbCmdContext *gdb_ctx,
void *user_ctx)
put_packet(gdb_ctx->s, "OK");
}
+static void handle_continue(GdbCmdContext *gdb_ctx, void *user_ctx)
+{
+ if (gdb_ctx->num_params) {
+ gdb_set_cpu_pc(gdb_ctx->s, gdb_ctx->params[0].val_ull);
+ }
+
+ gdb_ctx->s->signal = 0;
+ gdb_continue(gdb_ctx->s);
+}
+
static int gdb_handle_packet(GDBState *s, const char *line_buf)
{
CPUState *cpu;
@@ -1559,13 +1569,16 @@ static int gdb_handle_packet(GDBState *s, const char
*line_buf)
gdb_breakpoint_remove_all();
break;
case 'c':
- if (*p != '\0') {
- addr = strtoull(p, (char **)&p, 16);
- gdb_set_cpu_pc(s, addr);
+ {
+ static const GdbCmdParseEntry continue_cmd_desc = {
+ .handler = handle_continue,
+ .cmd = "c",
+ .cmd_startswith = 1,
+ .schema = "L0"
+ };
+ cmd_parser = &continue_cmd_desc;
}
- s->signal = 0;
- gdb_continue(s);
- return RS_IDLE;
+ break;
case 'C':
s->signal = gdb_signal_to_target (strtoul(p, (char **)&p, 16));
if (s->signal == -1)
--
2.20.1
- [Qemu-devel] [PATCH v5 01/21] gdbstub: Add infrastructure to parse cmd packets, Jon Doron, 2019/04/24
- [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 <=
- [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, 2019/04/24
- [Qemu-devel] [PATCH v5 11/21] gdbstub: Implement write memory (M pkt) with new infra, Jon Doron, 2019/04/24