[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] classic emulator Vs QEMU-TCG
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] classic emulator Vs QEMU-TCG |
Date: |
Thu, 16 Dec 2010 15:41:25 +0000 |
On 16 December 2010 15:20, Stefano Bonifazi <address@hidden> wrote:
> so I thought tcg_qemu_tb_exec "function" should do the work of executing the
> translated binary in the host.
> But then I found out it is just a define in tcg.h:
>
>> #define tcg_qemu_tb_exec(tb_ptr) ((long REGPARM (*)(void
>> *))code_gen_prologue)(tb_ptr)
>
> and again in exec.c
>
>> uint8_t code_gen_prologue[1024] code_gen_section;
>
> Maybe I have some problems with that C syntax, but I really don't understand
> what happens there.. how the execution happens!
Some hints:
* go and look up the C syntax for function pointers and
casting things to function pointers
* 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...
* 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