From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2034 invoked by alias); 23 Jan 2008 12:14:02 -0000 Received: (qmail 2018 invoked by uid 22791); 23 Jan 2008 12:14:01 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 23 Jan 2008 12:13:41 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m0NCDdws004324; Wed, 23 Jan 2008 07:13:39 -0500 Received: from [10.11.14.5] (vpn-14-5.rdu.redhat.com [10.11.14.5]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m0NCDcfL013598; Wed, 23 Jan 2008 07:13:38 -0500 Message-ID: <47972F71.4080007@redhat.com> Date: Thu, 24 Jan 2008 08:46:00 -0000 From: Andrew Haley User-Agent: Thunderbird 1.5.0.12 (X11/20071019) MIME-Version: 1.0 To: Tom Browder CC: "gcc-help@gcc.gnu.org" Subject: Re: Debugging Macros References: <8bc817ee0801230409g1c9da085g933e2fbfd7404b30@mail.gmail.com> In-Reply-To: <8bc817ee0801230409g1c9da085g933e2fbfd7404b30@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2008-01/txt/msg00223.txt.bz2 Tom Browder wrote: > I'm trying to debug a gcc frontend (cobol for gcc) and get errors such as: > > ../../gcctrunk_with_cobol/gcc/cobol/cobcbei.c:462: error: invalid > application of 'sizeof' to incomplete type 'struct lang_identifier' > ../../gcctrunk_with_cobol/gcc/cobol/cobcbei.c:462: error: 'getdecls' > undeclared here (not in a function) > ../../gcctrunk_with_cobol/gcc/cobol/cobcbei.c:468: error: conflicting > types for 'tree_code_type' > > which come from nested macros in gcc code. > > Is there an easy way (such as defining an environment variable in the > build environment) to get the gcc build system to show the > preprocessed code to help backtrack the problem? Set your CC when running make: "make CC='gcc -g -save-temps -Wp,-dD ...' This will give you all macro definitions, expanded in .i files. For extra credit, run the .i files through GNU indent. Andrew.