From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNDPV-0003jI-I0 for qemu-devel@nongnu.org; Wed, 14 Jan 2009 16:36:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNDPU-0003iE-PQ for qemu-devel@nongnu.org; Wed, 14 Jan 2009 16:36:25 -0500 Received: from [199.232.76.173] (port=56099 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNDPU-0003i0-Ge for qemu-devel@nongnu.org; Wed, 14 Jan 2009 16:36:24 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:60675) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LNDPT-0000F2-Pg for qemu-devel@nongnu.org; Wed, 14 Jan 2009 16:36:24 -0500 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate01.web.de (Postfix) with ESMTP id 568ADFBB4F86 for ; Wed, 14 Jan 2009 22:36:16 +0100 (CET) Received: from [88.64.30.173] (helo=[192.168.1.198]) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #273) id 1LNDPM-0001rx-00 for qemu-devel@nongnu.org; Wed, 14 Jan 2009 22:36:16 +0100 Message-ID: <496E5AC4.4060803@web.de> Date: Wed, 14 Jan 2009 22:36:04 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <496E193F.9050105@siemens.com> <58BD0469C48A7443A479A13D101685E301BB9E67@ala-mail09.corp.ad.wrs.com> In-Reply-To: <58BD0469C48A7443A479A13D101685E301BB9E67@ala-mail09.corp.ad.wrs.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig23B502CFDC749744386BA747" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH -v2] gdbstub: Add vCont support 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 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig23B502CFDC749744386BA747 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Krumme, Chris wrote: > =20 >=20 >> -----Original Message----- >> From:=20 >> qemu-devel-bounces+chris.krumme=3Dwindriver.com@nongnu.org=20 >> [mailto:qemu-devel-bounces+chris.krumme=3Dwindriver.com@nongnu.o >> rg] On Behalf Of Jan Kiszka >> Sent: Wednesday, January 14, 2009 10:57 AM >> To: qemu-devel@nongnu.org >> Subject: [Qemu-devel] [PATCH -v2] gdbstub: Add vCont support >> >> [ Fix signal forwarding, properly handle unknown v-packets. ] >> >> In order to set the VCPU for the next single-step command,=20 >> 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 >> --- >> >> gdbstub.c | 58=20 >> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 files changed, 58 insertions(+), 0 deletions(-) >> >> diff --git a/gdbstub.c b/gdbstub.c >> index 0bcd5d5..d9f197f 100644 >> --- a/gdbstub.c >> +++ b/gdbstub.c >> @@ -1542,6 +1542,64 @@ static int gdb_handle_packet(GDBState=20 >> *s, const char *line_buf) >> s->signal =3D 0; >> gdb_continue(s); >> return RS_IDLE; >> + case 'v': >> + if (strncmp(p, "Cont", 4) =3D=3D 0) { >> + int res_signal, res_thread; >> + >> + p +=3D 4; >> + if (*p =3D=3D '?') { >> + put_packet(s, "vCont;c;C;s;S"); >> + break; >> + } >> + res =3D 0; >> + res_signal =3D 0; >> + res_thread =3D 0; >> + while (*p) { >> + int action, signal; >> + >> + if (*p++ !=3D ';') { >> + res =3D 0; >> + break; >> + } >> + action =3D *p++; >> + signal =3D 0; >> + if (action =3D=3D 'C' || action =3D=3D 'S') >> + signal =3D strtoul(p, (char **)&p, 16); >> + else if (action !=3D 'c' && action !=3D 's') { >> + res =3D 0; >> + break; >> + } >> + thread =3D 0; >> + if (*p =3D=3D ':') >> + thread =3D strtoull(p+1, (char **)&p, 16); >> + >> + action =3D tolower(action); >> + if (res =3D=3D 0 || (res =3D=3D 'c' && action =3D=3D = 's')) { >> + res =3D action; >> + res_signal =3D signal; >> + res_thread =3D thread; >> + } >> + } >> + if (res) { >> + if (res_thread !=3D -1 && res_thread !=3D 0) { >> + for (env =3D first_cpu; env !=3D NULL; env =3D=20 >> env->next_cpu) >> + if (env->cpu_index + 1 =3D=3D res_thread) >> + break; >> + if (env =3D=3D NULL) { >> + put_packet(s, "E22"); >> + break; >> + } >> + s->c_cpu =3D env; >> + } >> + if (res =3D=3D 's') >> + cpu_single_step(s->c_cpu, sstep_flags); >=20 > Sorry I am not more familure with the code, but does cpu_single_step > need to know about the res_signal? >=20 Nope, cpu_single_step just toggles the switch that future guest code execution should single-step and flushes translated code buffers (when in emulation mode). Jan --------------enig23B502CFDC749744386BA747 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkluWtAACgkQniDOoMHTA+lpGgCbBnmMk2pq7oT/2nM9I7HzxXP8 hFMAni9dttkhNWqoQvvWFA7bfMJvr5Y6 =kywS -----END PGP SIGNATURE----- --------------enig23B502CFDC749744386BA747--