Hi,
In one of our projects, a GCC plugin implements a pass (operates on
GIMPLE repr.) and selects some interesting statements in the code being
compiled, mainly some of the memory accesses.
Everything is done on Linux, i586 and x86_64, GCC 4.9.
I'd like to find the positions of the machine instructions corresponding
to these selected statements in the compiled binaries (or to detect that
the compiler has eliminated those statements).
<function name>+<offset of the instruction in the function> would do.
Is it possible to do it via a GCC plugin? Or, perhaps, saving the source
code locations for the statements of interest during the GIMPLE pass and
then using debug info (with libdw or something) to get the positions of
the instructions is the best bet?
Or, maybe, there is some other way to find the instructions
corresponding to these statements?
Any ideas are appreciated.
Regards,
Eugene
--
Eugene Shatokhin, ROSA
www.rosalab.com