From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31691 invoked by alias); 2 Sep 2014 03:24:34 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 31665 invoked by uid 89); 2 Sep 2014 03:24:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f46.google.com Received: from mail-qg0-f46.google.com (HELO mail-qg0-f46.google.com) (209.85.192.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 02 Sep 2014 03:24:28 +0000 Received: by mail-qg0-f46.google.com with SMTP id q107so5884910qgd.33 for ; Mon, 01 Sep 2014 20:24:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=dNXLn/1BJOy/KSRxWundgbvRNlVtZA4fZm7pQw7UGN8=; b=SgDxeQZntRJXX2sT38wXUbrr0zSHWxiMZ48ciPbc/jDY/QkVnQjJROO3qkYHm4syUa PUwRtAjw8xvTVSEvRK4/5nTmt0Ysc8nl5BKRgxUwL6JSCQsqtKKoR3zAtHcB/Q8w+lKq Ff0EcFOQ/Dt2+KT6YGLZlPXkToLaJvOLvF5vHW8NR5mkq8WdXAOT24LlXwAztLUV0B29 18JHJDELpLvj6MtcOWHrLX1DbWfXItZNUB0Ur1bGCZXsPZqJIRm/4DNjTWPkOdwMh5xw lSJUB3qdSc6nOK2Pw60Zz3SPDtos20L8c+EQM5vzIlXFUjILwqenHRdokBaUfduytVpD 6CRQ== X-Gm-Message-State: ALoCoQmb/m85u1Y7MHSAtqlD+l7pesibcZX9mJ4PVyNLhhwxVLZV5WAFkz3UOjyAmmgHYnmdTqke X-Received: by 10.224.114.74 with SMTP id d10mr39537827qaq.33.1409628266137; Mon, 01 Sep 2014 20:24:26 -0700 (PDT) Received: from mail-qc0-f179.google.com (mail-qc0-f179.google.com [209.85.216.179]) by mx.google.com with ESMTPSA id t5sm6872861qat.24.2014.09.01.20.24.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Sep 2014 20:24:25 -0700 (PDT) Received: by mail-qc0-f179.google.com with SMTP id l6so6101644qcy.38 for ; Mon, 01 Sep 2014 20:24:24 -0700 (PDT) X-Received: by 10.224.4.133 with SMTP id 5mr52328304qar.25.1409628264775; Mon, 01 Sep 2014 20:24:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.96.248.77 with HTTP; Mon, 1 Sep 2014 20:24:04 -0700 (PDT) From: Mateus Borges Date: Tue, 02 Sep 2014 03:24:00 -0000 Message-ID: Subject: Monitoring reads to members of global_options To: gcc-help Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2014-09/txt/msg00002.txt.bz2 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