Received: from eggs.gnu.org ([140.186.70.92]:60183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUfzH-0001qw-UF for qemu-devel@nongnu.org; Sun, 27 Nov 2011 09:45:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RUfzG-00063R-LT for qemu-devel@nongnu.org; Sun, 27 Nov 2011 09:45:47 -0500 Received: from nm23-vm0.bullet.mail.ne1.yahoo.com ([98.138.91.57]:40371) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RUfzG-00063N-E9 for qemu-devel@nongnu.org; Sun, 27 Nov 2011 09:45:46 -0500 Message-ID: <1322405145.67803.YahooMailClassic@web125404.mail.ne1.yahoo.com> Date: Sun, 27 Nov 2011 06:45:45 -0800 (PST) From: Rick Hodgin In-Reply-To: <4ED24909.4010902@suse.de> MIME-Version: 1.0 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: =?iso-8859-1?Q?Andreas_F=E4rber?= Cc: Blue Swirl , qemu-devel@nongnu.org Andreas,=0A=0AThank you. I guess I'll go back to Bochs. Things are simple= r there. :-)=0A=0AI do appreciate your help.=0A=0AThanks and best regards,= =0ARick C. Hodgin=0A=0A--- On Sun, 11/27/11, Andreas F=E4rber wrote:=0A=0A> From: Andreas F=E4rber =0A> Subject: = Re: [Qemu-devel] Add native debugger=0A> To: "Rick Hodgin" =0A> Cc: "Blue Swirl" , qemu-devel@nongnu.org= =0A> Date: Sunday, November 27, 2011, 9:28 AM=0A> Am 27.11.2011 15:12, schr= ieb Rick=0A> Hodgin:=0A> > --- On Sun, 11/27/11, Blue Swirl =0A> wrote:=0A> >> On Sun, Nov 27, 2011 at 04:10, Rick=0A> >> Hodgin= =0A> >> wrote:=0A> >>> For i386, I'm considering w= riting a native=0A> debugger=0A> >> for QEMU that is not GDB. It would allo= w a=0A> separate/new=0A> >> windowed interface which would show disassembly= ,=0A> registers,=0A> >> stack, local variables, memory windows, etc.,=0A> a= llowing the=0A> >> user to single-step through code and trap opcodes=0A> li= ke INT=0A> >> 1, INT 3, INT 4, etc.=A0 It would be invoked=0A> with somethi= ng=0A> >> like "qemu -debugger" from the command line, and=0A> would have= =0A> >> a UI similar to Microsoft's Debugger in Visual=0A> Studio when=0A> = >> no PDB is available, but would show a similar type=0A> of=0A> >> disasse= mbly form.=0A> >>=0A> >> QEMU and the debugger should be kept separate. You= =0A> should=0A> >> use the GDB interface to implement the debugger,=0A> tha= t way=0A> >> you can also test it against known good=0A> configuration. For= =0A> >> example, try to find out how GDB performs single=0A> stepping=0A> >= > (set remote debug 1).=0A> > =0A> > I appreciate this advice. I'm looking = for a native=0A> implementation within QEMU that is always available, alway= s=0A> on, always active (when enabled). In this way, whenever INT=0A> 3 opc= odes are found, the debugger can intercept and leap=0A> into existence, and= without all of the gdb protocol overhead=0A> and parsing.=0A> =0A> Still I= don't think a new *debugger* is what you want for=0A> what you=0A> describ= e. Take a look at target-i386/translate.c, that's=0A> where QEMU=0A> decode= s the opcodes. Note that this is code generation=0A> time, not=0A> runtime,= so that you either need to emit a call to a helper=0A> of yours=0A> whenev= er that int 3 opcode is found and do your processing=0A> from that=0A> help= er or to realize your processing with just TCG=0A> instructions.=0A> =0A> F= or displaying assembly instructions you could also surely=0A> reuse=0A> exi= sting tools from within your implementation, possibly=0A> i386-dis.c.=0A> = =0A> HTH,=0A> Andreas=0A> =0A> -- =0A> SUSE LINUX Products GmbH, Maxfeldstr= . 5, 90409 N=FCrnberg,=0A> Germany=0A> GF: Jeff Hawn, Jennifer Guild, Felix= Imend=F6rffer; HRB=0A> 16746 AG N=FCrnberg=0A> =0A>