From: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
To: gcc-help@gcc.gnu.org
Cc: Nikita Komarov <nikita@kmrov.ru>
Subject: Finding positions of the instructions
Date: Tue, 23 Sep 2014 07:37:00 -0000 [thread overview]
Message-ID: <54212321.3020709@rosalab.ru> (raw)
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
reply other threads:[~2014-09-23 7:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54212321.3020709@rosalab.ru \
--to=eugene.shatokhin@rosalab.ru \
--cc=gcc-help@gcc.gnu.org \
--cc=nikita@kmrov.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).