aboutsummaryrefslogtreecommitdiff
path: root/gdbstub.c
diff options
context:
space:
mode:
authorJon Doron <arilou@gmail.com>2019-05-29 09:41:43 +0300
committerAlex Bennée <alex.bennee@linaro.org>2019-06-12 17:53:23 +0100
commit933f80dd4226155e263635b0e909836151a795b4 (patch)
tree441b2444061a582c41237377e986f8e99ffeb615 /gdbstub.c
parent4b20fab101b9e2d0fb47454209637a17fc7a13d5 (diff)
gdbstub: Implement step (s pkt) with new infra
Signed-off-by: Jon Doron <arilou@gmail.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20190529064148.19856-16-arilou@gmail.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Diffstat (limited to 'gdbstub.c')
-rw-r--r--gdbstub.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/gdbstub.c b/gdbstub.c
index d1969d5977..b457f2841d 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1812,6 +1812,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;
@@ -1944,13 +1954,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 = {