From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26728 invoked by alias); 25 Nov 2004 08:13:35 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 26666 invoked from network); 25 Nov 2004 08:13:22 -0000 Received: from unknown (HELO smtp02.mrf.mail.rcn.net) (207.172.4.61) by sourceware.org with SMTP; 25 Nov 2004 08:13:22 -0000 Received: from 216-80-66-212.lem-bsr1.chi-lem.il.cable.rcn.com ([216.80.66.212] helo=192.168.49.31) by smtp02.mrf.mail.rcn.net with esmtp (Exim 3.35 #7) id 1CXEkk-0002sT-00 for gcc-help@gcc.gnu.org; Thu, 25 Nov 2004 03:13:22 -0500 Subject: Howto dump syntax tree of erroneous program? From: Bob Gustafson Reply-To: bobgus@rcn.com To: gcc-help@gcc.gnu.org Content-Type: text/plain Date: Thu, 25 Nov 2004 08:13:00 -0000 Message-Id: <1101370401.11351.0.camel@hoho2.chidig.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2004-11/txt/msg00178.txt.bz2 I have a heavily templated C++ program (w/ macros too), written by someone else, which compiles and runs using an earlier version of g++ (but not by me). I have managed to find a number of tweeks (this-> additions) which enable the compile to move along. However, I am stumped at the moment. I have used -E, -Q, -dy, and -save-temps options to g++, but the info obtained is not quite enough. I could use something that would dump the source code file name, line number, name of syntactic element observed (e.g., template, non-type template-parameter, template specialization, etc.) and the source text snippet at that point. This is just an aid so that I can be sure that the compiler and I are thinking about the same thing in the same way. The output could be spit out as an xml file. XSLT post-processor tools would spring up to handle that format. Does this exist already? If not, what piece of gcc compiler code would I hack to product this output? Thanks for any replies. BobG