public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Finding positions of the instructions
@ 2014-09-23  7:37 Eugene Shatokhin
  0 siblings, 0 replies; only message in thread
From: Eugene Shatokhin @ 2014-09-23  7:37 UTC (permalink / raw)
  To: gcc-help; +Cc: Nikita Komarov

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-23  7:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-23  7:37 Finding positions of the instructions Eugene Shatokhin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).