From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXXtr-00088L-0c for qemu-devel@nongnu.org; Wed, 01 May 2013 10:20:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UXXtn-0001RQ-1t for qemu-devel@nongnu.org; Wed, 01 May 2013 10:20:50 -0400 Received: from mout.web.de ([212.227.15.3]:51263) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXXtm-0001RH-A2 for qemu-devel@nongnu.org; Wed, 01 May 2013 10:20:46 -0400 Message-ID: <5181243E.7080305@web.de> Date: Wed, 01 May 2013 16:18:38 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1363109492-1901-1-git-send-email-chouteau@adacore.com> <1363109492-1901-2-git-send-email-chouteau@adacore.com> <51422A3D.7000308@siemens.com> In-Reply-To: <51422A3D.7000308@siemens.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2ENLUGUOVGDSLJJLKNLMF" Subject: Re: [Qemu-devel] [PATCH v4] Add GDB qAttached support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: "qemu-devel@nongnu.org" , Fabien Chouteau This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2ENLUGUOVGDSLJJLKNLMF Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-03-14 20:51, Jan Kiszka wrote: > With this patch QEMU handles qAttached request from gdb. When QEMU > replies 1, GDB sends a "detach" command at the end of a debugging > session otherwise GDB sends "kill". >=20 > The default value for qAttached is 1 on system emulation and 0 on user > emulation. >=20 > Based on original version by Fabien Chouteau. >=20 Ping for this and the revert of "gdbstub: Do not kill target in system emulation mode". Jan > Signed-off-by: Jan Kiszka > --- >=20 > As Fabien dropped his attempt to make this configurable, let's > preserve the value of exposing this feature to gdb statically. >=20 > gdbstub.c | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-) >=20 > diff --git a/gdbstub.c b/gdbstub.c > index e414ad9..9daee86 100644 > --- a/gdbstub.c > +++ b/gdbstub.c > @@ -42,6 +42,12 @@ > #include "sysemu/kvm.h" > #include "qemu/bitops.h" > =20 > +#ifdef CONFIG_USER_ONLY > +#define GDB_ATTACHED "0" > +#else > +#define GDB_ATTACHED "1" > +#endif > + > #ifndef TARGET_CPU_MEMORY_RW_DEBUG > static inline int target_memory_rw_debug(CPUArchState *env, target_ulo= ng addr, > uint8_t *buf, int len, int is= _write) > @@ -2491,6 +2497,10 @@ static int gdb_handle_packet(GDBState *s, const = char *line_buf) > break; > } > #endif > + if (strncmp(p, "Attached", 8) =3D=3D 0) { > + put_packet(s, GDB_ATTACHED); > + break; > + } > /* Unrecognised 'q' command. */ > goto unknown_command; > =20 >=20 ------enig2ENLUGUOVGDSLJJLKNLMF 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.16 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlGBJEUACgkQitSsb3rl5xR1IQCgnHksM54JcRnppKxIZDTTUdIJ SYMAoNx4O3JBOVQ6N78QLPieA9RCjjUg =g7Ip -----END PGP SIGNATURE----- ------enig2ENLUGUOVGDSLJJLKNLMF--