From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUfj6-0006Pu-Qx for qemu-devel@nongnu.org; Sun, 27 Nov 2011 09:29:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RUfj5-000495-JB for qemu-devel@nongnu.org; Sun, 27 Nov 2011 09:29:04 -0500 Received: from cantor2.suse.de ([195.135.220.15]:47905 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUfj5-00048t-AE for qemu-devel@nongnu.org; Sun, 27 Nov 2011 09:29:03 -0500 Message-ID: <4ED24909.4010902@suse.de> Date: Sun, 27 Nov 2011 15:28:25 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1322403154.50912.YahooMailClassic@web125402.mail.ne1.yahoo.com> In-Reply-To: <1322403154.50912.YahooMailClassic@web125402.mail.ne1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Add native debugger List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Rick Hodgin Cc: Blue Swirl , qemu-devel@nongnu.org Am 27.11.2011 15:12, schrieb Rick Hodgin: > --- On Sun, 11/27/11, Blue Swirl wrote: >> On Sun, Nov 27, 2011 at 04:10, Rick >> Hodgin >> wrote: >>> For i386, I'm considering writing a native debugger >> for QEMU that is not GDB. It would allow a separate/new >> windowed interface which would show disassembly, registers, >> stack, local variables, memory windows, etc., allowing the >> user to single-step through code and trap opcodes like INT >> 1, INT 3, INT 4, etc. It would be invoked with something >> like "qemu -debugger" from the command line, and would have >> a UI similar to Microsoft's Debugger in Visual Studio when >> no PDB is available, but would show a similar type of >> disassembly form. >> >> QEMU and the debugger should be kept separate. You should >> use the GDB interface to implement the debugger, that way >> you can also test it against known good configuration. For >> example, try to find out how GDB performs single stepping >> (set remote debug 1). >=20 > I appreciate this advice. I'm looking for a native implementation withi= n QEMU that is always available, always on, always active (when enabled).= In this way, whenever INT 3 opcodes are found, the debugger can intercep= t and leap into existence, and without all of the gdb protocol overhead a= nd parsing. Still I don't think a new *debugger* is what you want for what you describe. Take a look at target-i386/translate.c, that's where QEMU decodes the opcodes. Note that this is code generation time, not runtime, so that you either need to emit a call to a helper of yours whenever that int 3 opcode is found and do your processing from that helper or to realize your processing with just TCG instructions. For displaying assembly instructions you could also surely reuse existing tools from within your implementation, possibly i386-dis.c. HTH, 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