qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Bonifazi <stefboombastic@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] classic emulator Vs QEMU-TCG
Date: Fri, 17 Dec 2010 14:49:46 +0100	[thread overview]
Message-ID: <4D0B6A7A.3060502@gmail.com> (raw)
In-Reply-To: <AANLkTimWjKcrXs7JpRdJ6feFrhDbo6SeXXcLOE-5jJ=a@mail.gmail.com>

On 12/16/2010 04:41 PM, Peter Maydell wrote:
> Some hints:
>   * go and look up the C syntax for function pointers and
> casting things to function pointers
Yup! See the reply to Mr. Santosa, thank you!
>   * code_gen_prologue[] contains code which has been generated
> once on startup -- go and find the function which is doing this,
> which ought to tell you what the prologue code actually does...
Is that the following?
> /* init global prologue and epilogue */
>     s->code_buf = code_gen_prologue;
>     s->code_ptr = s->code_buf;
>     tcg_target_qemu_prologue(s);


Trying to understand the pseudo-assembly in tcg_target_qemu_prologue (in 
file tcg-target.c), I think it builds an assembly function scheleton 
storying it inside code_gen_prologue array..
Cosidering the implementation of that function for i386 I think the jmp 
*%eax is the actual code that jumps to the host binary produced by TCG 
from the target binary.. in fact, if I am not wrong,this binary function 
is what is actually called by tcg_qemu_tb_exec(tb_ptr) macro with tb_ptr 
passed to the function in %eax, thus "jmp *%eax" starts the execution of 
the binary code .. am I wrong?

>   * try single stepping individual machine instructions in the
> debugger as you go through tcg_qemu_tb_exec() and matching
> this up with what is really happening here and with the bits of
> qemu which generated that code.
>
> -- PMM
I would have already done that.. unluckily I have always used IDE with 
integrated debuggers, and I can't find an IDE for loading this project.. 
I guess I have no other choice than learning also gdb
Thank you for your tips! :)
Best Regards!
Stefano B.

  reply	other threads:[~2010-12-17 13:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-16 15:20 [Qemu-devel] classic emulator Vs QEMU-TCG Stefano Bonifazi
2010-12-16 15:41 ` Peter Maydell
2010-12-17 13:49   ` Stefano Bonifazi [this message]
2010-12-16 15:57 ` Mulyadi Santosa
2010-12-17  9:47   ` Stefano Bonifazi
2010-12-17 10:18     ` Mulyadi Santosa
2010-12-17 13:51     ` Andreas Färber

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=4D0B6A7A.3060502@gmail.com \
    --to=stefboombastic@gmail.com \
    --cc=peter.maydell@linaro.org \
    --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).