Commit 8dbbe9ac authored by Luc Michel's avatar Luc Michel Committed by Peter Maydell
Browse files

gdbstub: add multiprocess support to 'sC' packets



Change the sC packet handling to support the multiprocess extension.
Instead of returning the first thread, we return the first thread of the
current process.

Signed-off-by: default avatarLuc Michel <luc.michel@greensocs.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
Reviewed-by: default avatarEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 20181207090135.7651-7-luc.michel@greensocs.com
[PMM: corrected checkpatch comment style nit]
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent e40e5204
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -1554,9 +1554,15 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
            put_packet(s, "OK");
            break;
        } else if (strcmp(p,"C") == 0) {
            /* "Current thread" remains vague in the spec, so always return
             *  the first CPU (gdb returns the first thread). */
            put_packet(s, "QC1");
            /*
             * "Current thread" remains vague in the spec, so always return
             * the first thread of the current process (gdb returns the
             * first thread).
             */
            cpu = get_first_cpu_in_process(s, gdb_get_cpu_process(s, s->g_cpu));
            snprintf(buf, sizeof(buf), "QC%s",
                     gdb_fmt_thread_id(s, cpu, thread_id, sizeof(thread_id)));
            put_packet(s, buf);
            break;
        } else if (strcmp(p,"fThreadInfo") == 0) {
            s->query_cpu = first_cpu;