Skip to contentSkip to conversation

Problems with Modifying "TranslationBlock"

Qemu-devel [email protected] 1 participant 1 message Sep 3, 2007

lore
Share & tools
lore
#0 lore raw

Hi, everybody,

I have encountered an odd problem. I want to mark the "TranslationBlock" when the code running on guest-os is a 'call' one or a 'ret' one. So I add some member variables in "TranslationBlock" of "exec-all.h". Just like the following:

typedef struct TranslationBlock {

target_ulong pc; /* simulated PC corresponding to this block (EIP + CS base) */
..........
struct TranslationBlock *jmp_first;
int is_call; // I add this if the translation block is a 'call' block
int is_ret; // I add this if the translation block is a 'ret' block
}

Moreover, I add some codes in "Translation.c" to mark the current block 'call' or 'ret'.

Although the code I add seems work well, the result is not correct. Moreover, if I add the member variables before 'pc' in TranslationBlock, qemu does not even work.

So can anyone help me? Thanks a lot in advance.

Kevin