From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29205 invoked by alias); 16 Jul 2011 17:05:37 -0000 Received: (qmail 29195 invoked by uid 22791); 16 Jul 2011 17:05:36 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from seketeli.net (HELO ms.seketeli.net) (91.121.166.71) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 Jul 2011 17:05:20 +0000 Received: from localhost (torimasen.com [82.237.12.13]) by ms.seketeli.net (Postfix) with ESMTP id 03A1EEA040; Sat, 16 Jul 2011 18:59:50 +0200 (CEST) Received: by localhost (Postfix, from userid 500) id 5CBA629C058; Sat, 16 Jul 2011 19:05:18 +0200 (CEST) From: Dodji Seketeli To: Tobias Burnus Cc: gcc-patches@gcc.gnu.org, tromey@redhat.com, gdr@integrable-solutions.net, joseph@codesourcery.com, charlet@act-europe.fr, bonzini@gnu.org, jason@redhat.com Subject: Re: [PATCH 0/7] Tracking locations of tokens resulting from macro expansion References: <1291979498-1604-1-git-send-email-dodji@redhat.com> <4E21AF83.80101@net-b.de> X-URL: http://www.seketeli.net/~dodji Date: Sat, 16 Jul 2011 17:57:00 -0000 In-Reply-To: <4E21AF83.80101@net-b.de> (Tobias Burnus's message of "Sat, 16 Jul 2011 17:34:27 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-07/txt/msg01333.txt.bz2 Tobias Burnus a =C3=A9crit: > Dodji Seketeli wrote: >> Support -fdebug-cpp option > > Regarding Fortran: I think having a full support for the macro > expansion would be quite a lot of work, I know nothing about Fortran, but I would hope that adding support for this feature to it should not be hard. Here is what happens basically, when -ftrack-macro-expansion is on: 1/ locations that are instance of source_location are now virtual locations. They encode locations of tokens across macro expansion. 2/ the code that unwinds and prints the "stack" of macro expansion is the function maybe_unwind_expanded_macro_loc, and is called by the diagnostic finalizer, which passes it the (now virtual) location of the diagnostic. Each front ends provide its own diagnostic finalizer. By default (in general_init) I have set this diagnostic finalizer to virt_loc_aware_diagnostic_finalizer which calls maybe_unwind_expanded_macro_loc. This is done in the patch "[PATCH 3/7] Emit macro expansion related diagnostics". If Fortran provides its own different diagnostic finalizer, it can call maybe_unwind_expanded_macro_loc in there. I believe this should be enough. > but I think -fdebug-cpp comes for free as it is handled by libcpp. > Thus, how about adding support for that flag also to Fortran? Except that I know zilsh about Fortran and it would take me some time, at least for testing. But yes, I think it would be good to have it for Fortran. I'll put that on my TODO list, unless someone beats me to it. --=20 Dodji