Received: from eggs.gnu.org ([2001:4830:134:3::10]:48013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ0b1-0002MH-Jd for qemu-devel@nongnu.org; Wed, 04 Feb 2015 09:06:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJ0ax-0002SW-1E for qemu-devel@nongnu.org; Wed, 04 Feb 2015 09:06:23 -0500 Message-ID: <54D2274F.4040008@web.de> Date: Wed, 04 Feb 2015 15:06:07 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <54CCA038.8000704@web.de> <54D2204B.3010903@redhat.com> In-Reply-To: <54D2204B.3010903@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PxvNoS8IEIQcTe64Ve5kmmfgIJTTqbJ9u" Subject: Re: [Qemu-devel] [PATCH 1/2] Add GDB qAttached support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pedro Alves , qemu-trivial Cc: qemu-devel , Fabien Chouteau This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PxvNoS8IEIQcTe64Ve5kmmfgIJTTqbJ9u Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 2015-02-04 14:36, Pedro Alves wrote: > Hi, I was skimming the list, and noticed: >=20 > On 01/31/2015 10:28 AM, Jan Kiszka wrote: >> @@ -1187,6 +1193,10 @@ static int gdb_handle_packet(GDBState *s, const= char *line_buf) >> put_packet_binary(s, buf, len + 1); >> break; >> } >> + if (strncmp(p, "Attached", 8) =3D=3D 0) { >=20 > This looks like it'd mishandle a future qAttached2 packet. >=20 > It should be doing something like: >=20 > if (strncmp(p, "Attached", 8) =3D=3D 0 && > (p[8] =3D=3D '\0' || p[8] =3D=3D ':')) { >=20 > or: >=20 > if (strcmp(p, "Attached") =3D=3D 0 || strncmp(p, "Attached:", 9)= =3D=3D 0) { >=20 >=20 > Likewise other packets, if they have the same issue. > (I'm not familiar with qemu's stub's internals.) Thanks for the remark! Will update the patch using the easier readable second variant. Jan --PxvNoS8IEIQcTe64Ve5kmmfgIJTTqbJ9u 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 iEYEARECAAYFAlTSJ08ACgkQitSsb3rl5xQ5FACgpk2XTf3kTvbQPApWSkDjsBm2 AgsAnA7Q4kypxCmdHWR9XFNbEQBUquid =7b5H -----END PGP SIGNATURE----- --PxvNoS8IEIQcTe64Ve5kmmfgIJTTqbJ9u--