Jon Doron <ari...@gmail.com> writes:
> Signed-off-by: Jon Doron <ari...@gmail.com> > --- > gdbstub.c | 79 ++++++++++++++++++++++++++++++++++--------------------- > 1 file changed, 49 insertions(+), 30 deletions(-) > > diff --git a/gdbstub.c b/gdbstub.c > index 469aaeb875..21cdaf4678 100644 > --- a/gdbstub.c > +++ b/gdbstub.c > @@ -1547,6 +1547,47 @@ static void handle_cont_with_sig(GdbCmdContext > *gdb_ctx, void *user_ctx) > gdb_continue(gdb_ctx->s); > } > > +static void handle_set_thread(GdbCmdContext *gdb_ctx, void *user_ctx) > +{ > + CPUState *cpu; > + > + if (gdb_ctx->num_params < 2) { Given we should have a fixed number of parameters != 2 perhaps? > + put_packet(gdb_ctx->s, "E22"); > + return; > + } > + > + if (gdb_ctx->params[1].thread_id.kind == GDB_READ_THREAD_ERR) { > + put_packet(gdb_ctx->s, "E22"); > + return; > + } > + > + if (gdb_ctx->params[1].thread_id.kind != GDB_ONE_THREAD) { > + put_packet(gdb_ctx->s, "OK"); > + return; > + } > + > + cpu = gdb_get_cpu(gdb_ctx->s, gdb_ctx->params[1].thread_id.pid, > + gdb_ctx->params[1].thread_id.tid); > + if (!cpu) { > + put_packet(gdb_ctx->s, "E22"); > + return; > + } > + > + switch (gdb_ctx->params[0].opcode) { Perhaps a comment here to say this is a legacy command and modern gdb's should be using vCont? > + case 'c': > + gdb_ctx->s->c_cpu = cpu; > + put_packet(gdb_ctx->s, "OK"); > + break; > + case 'g': > + gdb_ctx->s->g_cpu = cpu; > + put_packet(gdb_ctx->s, "OK"); > + break; > + default: > + put_packet(gdb_ctx->s, "E22"); > + break; > + } > +} <snip> Otherwise: Reviewed-by: Alex Bennée <alex.ben...@linaro.org> -- Alex Bennée