From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=50016 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OcD8K-0005ml-RY for qemu-devel@nongnu.org; Fri, 23 Jul 2010 03:57:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OcD8J-0000pA-Fe for qemu-devel@nongnu.org; Fri, 23 Jul 2010 03:57:28 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:34469) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OcD8J-0000ot-2v for qemu-devel@nongnu.org; Fri, 23 Jul 2010 03:57:27 -0400 Message-ID: <4C494B83.9080200@web.de> Date: Fri, 23 Jul 2010 09:57:55 +0200 From: Jan Kiszka MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig218448EBCC6CC3D2351C9DF0" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH 8/8] Rework debug exception processing for gdb use List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jun Koi Cc: Anthony Liguori , TeLeMan , Glauber Costa , Marcelo Tosatti , Alexander Graf , qemu-devel@nongnu.org, Avi Kivity This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig218448EBCC6CC3D2351C9DF0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Jun Koi wrote: > On Fri, Jul 23, 2010 at 1:58 PM, TeLeMan wrote: >> On Fri, Jun 25, 2010 at 22:56, Jan Kiszka wro= te: >>> Guest debugging is currently broken under CONFIG_IOTHREAD. The reason= is >>> inconsistent or even lacking signaling the debug events from the sour= ce >>> VCPU to the main loop and the gdbstub. >>> >>> This patch addresses the issue by pushing this signaling into a >>> CPUDebugExcpHandler: cpu_debug_handler is registered as first handler= , >>> thus will be executed last after potential breakpoint emulation >>> handlers. It sets informs the gdbstub about the debug event source, >>> requests a debug exit of the main loop and stops the current VCPU. Th= is >>> mechanism works both for TCG and KVM, with and without IO-thread. >>> >>> Signed-off-by: Jan Kiszka >>> --- >>> cpus.c | 26 ++++++++++++++++---------- >>> kvm-all.c | 2 -- >>> 2 files changed, 16 insertions(+), 12 deletions(-) >>> >>> diff --git a/cpus.c b/cpus.c >>> index c024421..a607d9a 100644 >>> --- a/cpus.c >>> +++ b/cpus.c >>> @@ -140,6 +140,13 @@ static int any_cpu_has_work(void) >>> return 0; >>> } >>> >>> +static void cpu_debug_handler(CPUState *env) >>> +{ >>> + gdb_set_stop_cpu(env); >>> + debug_requested =3D EXCP_DEBUG; >>> + vm_stop(EXCP_DEBUG); >>> +} >> Is debug_requested or vm_stop() redundant? >> >=20 > certainly that debug_requested should only take value of 0 or 1. This works analogously to vmstop_requested: The stop reason code is transfered along the request. Granted, there is only one code used here so far. This whole thing could probably be simplified if we did not have to support both single- and multi-threaded QEMU execution models. But that's the situation ATM. Jan --------------enig218448EBCC6CC3D2351C9DF0 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 iEYEARECAAYFAkxJS4MACgkQitSsb3rl5xS1BgCgzmWOjvUx0/jbDK8bjJIP87DZ ZxoAn2MqYpmUOhmHGhOZ9kxD2p6O8yvC =RigC -----END PGP SIGNATURE----- --------------enig218448EBCC6CC3D2351C9DF0--