qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Translation block identification.


From: Alex Bennée
Subject: Re: [Qemu-devel] Translation block identification.
Date: Tue, 01 May 2018 11:43:25 +0100
User-agent: mu4e 1.1.0; emacs 26.1

Rafael Kioji <address@hidden> writes:

> This logging flag prints what I want. But I really wanted is to get
> this info inside the QEMU source code. Why am I not able to lookup the
> symbols in the translator.c file the way I showed?

Without a failing patch it's hard to say, after all the working
disassembly is called at the bottom of translator_loop():

  ops->disas_log(db, cpu);

>
> Kind regards,
> Rafael
>
> On 5/1/2018 6:04 PM, Alex Bennée wrote:
>> Rafael Kioji <address@hidden> writes:
>>
>>> Dear all,
>>>
>>> During translation how can I identify what is the basic block of the
>>> guest code? I wanted to know whether the block being translated is the
>>> beginning of a function and get its name.
>>>
>>> My current approach involves looking up the symbol associated with the
>>> first PC of the translation block. But no symbol is ever found. What I
>>> did was to add the following code in the function "translator_loop" at
>>> "accel/tcg/translator.c":
>>>
>>>   printf("sym: %lu %s\n", tb->pc, lookup_symbol(tb->pc));
>>>
>>> The function lookup_symbol is defined in the file "./disas.c". I am
>>> compiling my application with symbols (-g). My target arch is ARM.
>> If you run QEMU with the debug flags you should see name resolution for
>> each basic block. e.g.
>>
>>    qemu-arm -d in_asm prog
>>
>> --
>> Alex Bennée


--
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]