From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNmTt-0006vj-JP for qemu-devel@nongnu.org; Wed, 12 Mar 2014 12:58:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNmTn-00056c-PB for qemu-devel@nongnu.org; Wed, 12 Mar 2014 12:58:13 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41388 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNmTn-00056U-IK for qemu-devel@nongnu.org; Wed, 12 Mar 2014 12:58:07 -0400 Message-ID: <5320921E.2080307@suse.de> Date: Wed, 12 Mar 2014 17:58:06 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <51E65168.5080907@siemens.com> <51F2BF4F.8030107@siemens.com> In-Reply-To: <51F2BF4F.8030107@siemens.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 1/2] Add GDB qAttached support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Peter Maydell , Anthony Liguori , qemu-devel , Fabien Chouteau Am 26.07.2013 20:26, schrieb Jan Kiszka: > With this patch QEMU handles qAttached request from gdb. When QEMU "With this patch" is always weird to read in Git history, also a "gdbstub: " prefix would've been nice for consistency. > 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. If this is based on code by Fabien, shouldn't it carry his Signed-off-by before yours? Since "GDB stub" is in "Odd Fixes" state, maybe just step up as maintainer and send a pull like for SLIRP? :) Cheers, Andreas >=20 > Signed-off-by: Jan Kiszka > --- >=20 > v2: Rebase over master >=20 > gdbstub.c | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-) >=20 > diff --git a/gdbstub.c b/gdbstub.c > index 35ca7c2..4a6cc51 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 > + > static inline int target_memory_rw_debug(CPUState *cpu, target_ulong a= ddr, > uint8_t *buf, int len, bool i= s_write) > { > @@ -2489,6 +2495,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 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg