public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mateus Borges <mab@cin.ufpe.br>
To: gcc-help <gcc-help@gcc.gnu.org>
Subject: Monitoring reads to members of global_options
Date: Tue, 02 Sep 2014 03:24:00 -0000	[thread overview]
Message-ID: <CAL7C8abVi4EErBEEX5xqaCkcJLPW3KQPMLbvVOrUwHY1iG_Chg@mail.gmail.com> (raw)

Hello everyone. I'm trying to instrument GCC to log reads of the
variables inside global_options. I managed to implement a (dumb)
version of this by wrapping all references of those variables with
a inline function, contained inside gcc/system.h.

To speed things up, I want to log only reads where the current
value is not the same of the previous one. After some frustrated
attempts with global variables, I'm now using a
singleton (class/members declared in system.h, implemented in a
new file) to store previous values and log the access if needed.

Now I need to compile this new file, and add the resulting object
file as input to the compilation of the instrumented source files.
Looking at the documentation, I guess that I need to edit
gcc/Makefile.in. However, I don't know exactly what to edit -
can you guys give me some pointers?

Ps: other implementation ideas are also welcome :)


Thanks,
Mateus

                 reply	other threads:[~2014-09-02  3:24 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=CAL7C8abVi4EErBEEX5xqaCkcJLPW3KQPMLbvVOrUwHY1iG_Chg@mail.gmail.com \
    --to=mab@cin.ufpe.br \
    --cc=gcc-help@gcc.gnu.org \
    /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).