This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Generate annotations for a binary translator


ééä <chenwj@iis.sinica.edu.tw> writes:

>   Take basic block (bb) register usage as an example. It good to a binary
> translator to know that a basic block register usage information. Say, bb
> A whose binary address starts from 0x100 to 0x120 does NOT use R1, then
> the binary translator can use R1 for free.
>
>   I know there is a data structure for basic block. But in order to let
> a binary translator use the basic block register usage information, each
> basic block must be associated with its corresponding binary (virtual)
> address.
>
>   If it is possible to generating such information, which part of gcc
> should I look into first?

I don't know how you plan to emit this information.  However, the
general approach given the current compiler would be to walk the basic
blocks just before or after the variable tracking pass (var-tracking.c)
and emit the information you want.  My first guess would be that you
would want to have final.c emit basic block labels, and refer to those
labels in the information you generate.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]