[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 16/21] gdbstub: Implement step (s pkt) with new i
From: |
Jon Doron |
Subject: |
[Qemu-devel] [PATCH v7 16/21] gdbstub: Implement step (s pkt) with new infra |
Date: |
Fri, 26 Apr 2019 07:35:53 +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 9fe130f30d..9b0556f8be 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1805,6 +1805,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;
@@ -1937,13 +1947,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 const GdbCmdParseEntry step_cmd_desc = {
+ .handler = handle_step,
+ .cmd = "s",
+ .cmd_startswith = 1,
+ .schema = "L0"
+ };
+ cmd_parser = &step_cmd_desc;
}
- cpu_single_step(s->c_cpu, sstep_flags);
- gdb_continue(s);
- return RS_IDLE;
+ break;
case 'F':
{
static const GdbCmdParseEntry file_io_cmd_desc = {
--
2.20.1
- [Qemu-devel] [PATCH v7 00/21] gdbstub: Refactor command packets handler, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 17/21] gdbstub: Implement v commands with new infra, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 14/21] gdbstub: Implement read all registers (g pkt) with new infra, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 21/21] gdbstub: Clear unused variables in gdb_handle_packet, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 19/21] gdbstub: Implement generic set (Q pkt) with new infra, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 20/21] gdbstub: Implement target halted (? pkt) with new infra, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 18/21] gdbstub: Implement generic query (q pkt) with new infra, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 16/21] gdbstub: Implement step (s pkt) with new infra,
Jon Doron <=
- [Qemu-devel] [PATCH v7 15/21] gdbstub: Implement file io (F pkt) with new infra, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 13/21] gdbstub: Implement write all registers (G pkt) with new infra, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 12/21] gdbstub: Implement read memory (m pkt) with new infra, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 08/21] gdbstub: Implement remove breakpoint (z pkt) with new infra, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 07/21] gdbstub: Implement insert breakpoint (Z pkt) with new infra, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 05/21] gdbstub: Implement continue with signal (C pkt) with new infra, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 10/21] gdbstub: Implement get register (p pkt) with new infra, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 09/21] gdbstub: Implement set register (P pkt) with new infra, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 11/21] gdbstub: Implement write memory (M pkt) with new infra, Jon Doron, 2019/04/26
- [Qemu-devel] [PATCH v7 06/21] gdbstub: Implement set_thread (H pkt) with new infra, Jon Doron, 2019/04/26