[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 16/20] gdbstub: Implement step (s pkt) with new i
From: |
arilou |
Subject: |
[Qemu-devel] [PATCH v3 16/20] gdbstub: Implement step (s pkt) with new infra |
Date: |
Wed, 24 Apr 2019 17:27:10 +0300 |
From: Jon Doron <address@hidden>
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 a71fbc800d..273216beb6 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1821,6 +1821,16 @@ static void handle_file_io(GdbCmdContext *gdb_ctx, void
*user_ctx)
gdb_continue(gdb_ctx->s);
}
+static void handle_step(GdbCmdContext *gdb_ctx, void *user_ctx)
+{
+ if (gdb_ctx->num_params) {
+ gdb_set_cpu_pc(gdb_ctx->s, (target_ulong)gdb_ctx->params[0].val_ull);
+ }
+
+ cpu_single_step(gdb_ctx->s->c_cpu, sstep_flags);
+ gdb_continue(gdb_ctx->s);
+}
+
static int gdb_handle_packet(GDBState *s, const char *line_buf)
{
CPUState *cpu;
@@ -1952,13 +1962,16 @@ static int gdb_handle_packet(GDBState *s, const char
*line_buf)
}
break;
case 's':
- if (*p != '\0') {
- addr = strtoull(p, (char **)&p, 16);
- gdb_set_cpu_pc(s, addr);
+ {
+ static GdbCmdParseEntry step_cmd_desc = {
+ .handler = handle_step,
+ .cmd = "s",
+ .cmd_startswith = 1,
+ .schema = "L0"
+ };
+ process_string_cmd(s, NULL, line_buf, &step_cmd_desc, 1);
}
- cpu_single_step(s->c_cpu, sstep_flags);
- gdb_continue(s);
- return RS_IDLE;
+ break;
case 'F':
{
static GdbCmdParseEntry file_io_cmd_desc = {
--
2.20.1
- [Qemu-devel] [PATCH v3 01/20] gdbstub: Add infrastructure to parse cmd packets, arilou, 2019/04/24
- [Qemu-devel] [PATCH v3 19/20] gdbstub: Implement generic set (Q pkt) with new infra, arilou, 2019/04/24
- [Qemu-devel] [PATCH v3 03/20] gdbstub: Implement thread_alive (T pkt) with new infra, arilou, 2019/04/24
- [Qemu-devel] [PATCH v3 18/20] gdbstub: Implement generic query (q pkt) with new infra, arilou, 2019/04/24
- [Qemu-devel] [PATCH v3 17/20] gdbstub: Implement v commands with new infra, arilou, 2019/04/24
- [Qemu-devel] [PATCH v3 16/20] gdbstub: Implement step (s pkt) with new infra,
arilou <=
- [Qemu-devel] [PATCH v3 14/20] gdbstub: Implement read all registers (g pkt) with new infra, arilou, 2019/04/24
- [Qemu-devel] [PATCH v3 20/20] gdbstub: Refactor parse handle packet to work with a static array, arilou, 2019/04/24
- [Qemu-devel] [PATCH v3 15/20] gdbstub: Implement file io (F pkt) with new infra, arilou, 2019/04/24
- [Qemu-devel] [PATCH v3 10/20] gdbstub: Implement get register (p pkt) with new infra, arilou, 2019/04/24
- [Qemu-devel] [PATCH v3 07/20] gdbstub: Implement insert breakpoint (Z pkt) with new infra, arilou, 2019/04/24
- [Qemu-devel] [PATCH v3 06/20] gdbstub: Implement set_thread (H pkt) with new infra, arilou, 2019/04/24
- [Qemu-devel] [PATCH v3 05/20] gdbstub: Implement continue with signal (C pkt) with new infra, arilou, 2019/04/24
- [Qemu-devel] [PATCH v3 08/20] gdbstub: Implement remove breakpoint (z pkt) with new infra, arilou, 2019/04/24