qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Rick Hodgin <foxmuldrster@yahoo.com>
Cc: Blue Swirl <blauwirbel@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Add native debugger
Date: Sun, 27 Nov 2011 15:28:25 +0100	[thread overview]
Message-ID: <4ED24909.4010902@suse.de> (raw)
In-Reply-To: <1322403154.50912.YahooMailClassic@web125402.mail.ne1.yahoo.com>

Am 27.11.2011 15:12, schrieb Rick Hodgin:
> --- On Sun, 11/27/11, Blue Swirl <blauwirbel@gmail.com> wrote:
>> On Sun, Nov 27, 2011 at 04:10, Rick
>> Hodgin <foxmuldrster@yahoo.com>
>> 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).
> 
> I appreciate this advice. I'm looking for a native implementation within QEMU that is always available, always on, always active (when enabled). In this way, whenever INT 3 opcodes are found, the debugger can intercept and leap into existence, and without all of the gdb protocol overhead and 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

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2011-11-27 14:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-27  4:10 [Qemu-devel] Add native debugger Rick Hodgin
2011-11-27 12:20 ` Blue Swirl
2011-11-27 14:12   ` Rick Hodgin
2011-11-27 14:28     ` Andreas Färber [this message]
2011-11-27 14:45       ` Rick Hodgin
2011-11-28  9:58     ` felix.matenaar@rwth-aachen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ED24909.4010902@suse.de \
    --to=afaerber@suse.de \
    --cc=blauwirbel@gmail.com \
    --cc=foxmuldrster@yahoo.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).