From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29038 invoked by alias); 1 May 2012 20:37:09 -0000 Received: (qmail 28928 invoked by uid 22791); 1 May 2012 20:37:08 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_GD X-Spam-Check-By: sourceware.org Received: from mail.trekia.se (HELO mail.trekia.se) (79.99.4.40) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 May 2012 20:36:51 +0000 Received: from [192.168.0.186] (h44n4-vrr-d2.ias.bredband.telia.com [78.72.188.44]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: martin@minimum.se) by mail.trekia.se (Postfix) with ESMTP id 19821B10FBB for ; Tue, 1 May 2012 22:36:24 +0200 (CEST) Message-ID: <4FA04961.7020404@minimum.se> Date: Tue, 01 May 2012 20:37:00 -0000 From: Martin Olsson User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120411 Thunderbird/11.0.1 MIME-Version: 1.0 To: gdb@sourceware.org Subject: -ggdb3 -gdwarf-4 but "info macro BLAH" still doesn't work? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00000.txt.bz2 Hello, In a small test app built with -g3 I can print values of macros inside gdb by doing "info macro MYMACRONAME", however in a larger application I cannot get it to work despite passing the same -g3 and using the same gdb command. Just to be sure, I tried turning off stuff like pre-compiled headers etc in the large app but I still can't get the macro values to print correctly. In the large app, what I see is: (gdb) info macro MYMACRONAME The symbol `MYMACRONAME' has no definition as a C/C++ preprocessor macro at ../../platforms/linux/src/main.cpp:263 In both cases gdb "info source" reports "Includes preprocessor macro info." and also "Compiled with DWARF 2 debugging format." For the large app readelf also reports the macro I'm testing as present (so I'm assuming the gcc end is doing the right thing): $ readelf -wm binary | grep MYMACRONAME DW_MACINFO_define - lineno : 12 macro : MYMACRONAME 4096 FWIW; I'm using ubuntu 12.04 LTS which means I got gcc 4:4.6.3-1ubuntu5 and gdb 7.4-2012.02-0ubuntu2. I've also tried building with "-ggdb3 -gdwarf-4" but I still can't get values of macros and oddly gdb then still reports "Compiled with DWARF 2 debugging format", which was a bit weird? Also if I do "info macros" then I get nothing printed at all. --- What else can I try to make progress on this issue? If there is no easier way, maybe someone can recommend a breakpoint location in GDB where I can step through the code that executes the "info macro BLAH" command ? Martin