From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNYtx-00082O-9E for qemu-devel@nongnu.org; Thu, 15 Jan 2009 15:33:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNYtw-000815-A7 for qemu-devel@nongnu.org; Thu, 15 Jan 2009 15:33:16 -0500 Received: from [199.232.76.173] (port=56601 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNYtw-00080n-0v for qemu-devel@nongnu.org; Thu, 15 Jan 2009 15:33:16 -0500 Received: from mail-qy0-f20.google.com ([209.85.221.20]:46002) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LNYtv-0007ZD-Ee for qemu-devel@nongnu.org; Thu, 15 Jan 2009 15:33:15 -0500 Received: by qyk13 with SMTP id 13so1913499qyk.10 for ; Thu, 15 Jan 2009 12:33:14 -0800 (PST) Message-ID: <496F9D75.4020802@codemonkey.ws> Date: Thu, 15 Jan 2009 14:32:53 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RESEND][PATCH] gdbstub: Add vCont support References: <496DFA33.2020606@siemens.com> In-Reply-To: <496DFA33.2020606@siemens.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Jan Kiszka wrote: > [ Also available via git://git.kiszka.org/qemu.git queue/gdb ] > > In order to set the VCPU for the next single-step command, you need gdb > 6.8 or better - and this patch. It enhances the existing support for > representing VCPUs as threads to the gdb frontend by introducing the > vCont remote gdb command. This is used by gdb to switch the debugging > focus for single-stepping multi-threaded targets. > > Signed-off-by: Jan Kiszka > I think the consensus from the last posting of this was that modeling threads was pretty broken and that we should model as processes. Did I miss something there? Regards, Anthony Liguori > --- > > gdbstub.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 files changed, 56 insertions(+), 0 deletions(-) > > diff --git a/gdbstub.c b/gdbstub.c > index 0bcd5d5..1cb20b7 100644 > --- a/gdbstub.c > +++ b/gdbstub.c > @@ -1542,6 +1542,62 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) > s->signal = 0; > gdb_continue(s); > return RS_IDLE; > + case 'v': > + if (strncmp(p, "Cont", 4) == 0) { > + int res_signal, res_thread; > + > + p += 4; > + if (*p == '?') { > + put_packet(s, "vCont;c;C;s;S"); > + break; > + } > + res = 0; > + res_signal = 0; > + res_thread = 0; > + while (*p) { > + int action, signal; > + > + if (*p++ != ';') { > + res = 0; > + break; > + } > + action = *p++; > + signal = 0; > + if (action == 'C' || action == 'S') > + signal = strtoul(p, (char **)&p, 16); > + else if (action != 'c' && action != 's') { > + res = 0; > + break; > + } > + thread = 0; > + if (*p == ':') > + thread = strtoull(p+1, (char **)&p, 16); > + > + action = tolower(action); > + if (res == 0 || (res == 'c' && action == 's')) { > + res = action; > + res_signal = signal; > + res_thread = thread; > + } > + } > + if (res) { > + if (res_thread != -1 && res_thread != 0) { > + for (env = first_cpu; env != NULL; env = env->next_cpu) > + if (env->cpu_index + 1 == res_thread) > + break; > + if (env == NULL) { > + put_packet(s, "E22"); > + break; > + } > + s->c_cpu = env; > + } > + if (res == 's') > + cpu_single_step(s->c_cpu, sstep_flags); > + gdb_continue(s); > + return RS_IDLE; > + } > + break; > + } > case 'k': > /* Kill the target */ > fprintf(stderr, "\nQEMU: Terminated via GDBstub\n"); > > >