aboutsummaryrefslogtreecommitdiff
path: root/gdbstub.c
diff options
context:
space:
mode:
authorJon Doron <arilou@gmail.com>2019-05-29 09:41:32 +0300
committerAlex Bennée <alex.bennee@linaro.org>2019-06-12 17:53:23 +0100
commit4d6e3fe2794f6b586d59dfe26ce3969e7a7cf36a (patch)
treedcfe46163a9c56af2e9fa07e5e3654f30b1286fb /gdbstub.c
parent44ffded013b193414f45bc0cb5df74ab7174b8bc (diff)
gdbstub: Implement continue (c 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-5-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 89d5dcf07a..53149c565a 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1535,6 +1535,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;
@@ -1571,13 +1581,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)