From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LkxXI-0002gz-VN for qemu-devel@nongnu.org; Sat, 21 Mar 2009 05:30:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LkxXD-0002d3-OB for qemu-devel@nongnu.org; Sat, 21 Mar 2009 05:30:35 -0400 Received: from [199.232.76.173] (port=40279 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkxXD-0002ci-Et for qemu-devel@nongnu.org; Sat, 21 Mar 2009 05:30:31 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:48239) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LkxXC-000614-RC for qemu-devel@nongnu.org; Sat, 21 Mar 2009 05:30:31 -0400 Received: from smtp08.web.de (fmsmtp08.dlan.cinetic.de [172.20.5.216]) by fmmailgate03.web.de (Postfix) with ESMTP id C34DBF967D58 for ; Sat, 21 Mar 2009 10:30:29 +0100 (CET) Received: from [88.64.26.35] (helo=[192.168.1.2]) by smtp08.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #277) id 1LkxXB-0004ya-00 for qemu-devel@nongnu.org; Sat, 21 Mar 2009 10:30:29 +0100 Message-ID: <49C4B3A6.2020009@web.de> Date: Sat, 21 Mar 2009 10:30:14 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <20090320145101.GA20641@otto.imag.fr> In-Reply-To: <20090320145101.GA20641@otto.imag.fr> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig1B9ED7B948F78EADFE58DFC7" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: qemu-user/gdbstub : gdb remote pipe connexion addition ? 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) --------------enig1B9ED7B948F78EADFE58DFC7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Philippe Waille wrote: > Hi >=20 > Qemu gdbstub only allows GDB remote target connexion through IP socket.= >=20 > Would the GDB remote pipe connexion method be also supported in future = versions > (as does openocd for remote access to jtag interfaces), like this : >=20 > (gdb) target remote | exec openocd --pipe > (gdb) target remote | exec qemu-arm --pipe a.out >=20 > Simultaneous execution of several (user-mode arm simulators) qemu-arm b= y a=20 > set of users sharing a single server would be easier to manage with=20 > gdb connexion through pipes instead of IP port/socket. Check out [1]. It basically enhances qemu like that (the corresponding switch would be '-gdb stdio'), but only for system emulation. An add-on patch to extend user mode emulator in a similar way would be welcome! There is one more thing to solve for both emulator modes: SIGINT has to be trapped and handled by the gdbstub (currently, breaking into the target terminates qemu). These hunks do the trick for system emulation: diff --git a/gdbstub.c b/gdbstub.c index a087553..1f43264 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2446,6 +2446,14 @@ static int gdb_monitor_write(CharDriverState *chr,= const uint8_t *buf, int len) return len; } =20 +#ifndef _WIN32 +static void gdb_sigterm_handler(int signal) +{ + if (vm_running) + vm_stop(EXCP_INTERRUPT); +} +#endif + int gdbserver_start(const char *device) { GDBState *s; @@ -2462,7 +2470,15 @@ int gdbserver_start(const char *device) "%s,nowait,nodelay,server", device); device =3D gdbstub_device_name; } +#ifndef _WIN32 + else if (strcmp(device, "stdio") =3D=3D 0) { + struct sigaction act; =20 + memset(&act, 0, sizeof(act)); + act.sa_handler =3D gdb_sigterm_handler; + sigaction(SIGINT, &act, NULL); + } +#endif chr =3D qemu_chr_open("gdb", device, NULL); if (!chr) return -1; Will merge this into some -v2 of my patch. Jan [1] http://permalink.gmane.org/gmane.comp.emulators.qemu/39836 --------------enig1B9ED7B948F78EADFE58DFC7 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 iEYEARECAAYFAknEs7UACgkQniDOoMHTA+k5aACeOtpyV1CG57s0NZ9Mlv4CawBM EQkAn2SLNgWz1oi4Rh/K0FIvJ+IZNACW =u2L/ -----END PGP SIGNATURE----- --------------enig1B9ED7B948F78EADFE58DFC7--