From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSU7k-0005D8-EB for qemu-devel@nongnu.org; Mon, 21 Nov 2011 08:41:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSU7Z-0000vo-JM for qemu-devel@nongnu.org; Mon, 21 Nov 2011 08:41:28 -0500 Received: from cantor2.suse.de ([195.135.220.15]:49763 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSU7Z-0000v3-9g for qemu-devel@nongnu.org; Mon, 21 Nov 2011 08:41:17 -0500 Message-ID: <4ECA54D9.5080909@suse.de> Date: Mon, 21 Nov 2011 14:40:41 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Qemu breakpoints List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ankur Dahiya Cc: qemu-devel@nongnu.org Am 20.11.2011 07:43, schrieb Ankur Dahiya: > I am trying to set a breakpoint in qemu. That is, a function of mine > should run when guest eip becomes equal > to some specified address. > I set the bp using : cpu_breakpoint_insert(first_cpu, 0xc103364f, > BP_GDB, NULL) > Then I do cpu_set_debug_excp_handler(NULL) because the > default excp handler accesses some gdbserver > variables which are not available in my case as I am not running gdbser= ver. >=20 > Now, when the specified address is hit, cpu_handle_debug_exception() > is called. So, I do my required processing > here. But, I am unable to resume the vm. The guest's eip stays the same > and this function keeps > getting called over and over again. So, how should I resume the vm? > I know this is possible because gdbstub does this. But I have stepped > through the whole code and still can't figure > out how are they doing it! >=20 > P.S. I am working on qemu-0.13 and am not using kvm. Generally you may get more answers when using a more recent version of QEMU - last stable is 0.15.1 and we're about to release 1.0. Further, since you seem to be modifying QEMU's code you would be well advised to use the latest Git version. Depending on what you're trying to do, you might be interested in an instrumentation framework that was proposed by Lluis a while back. Regards, Andreas --=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