From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23556 invoked by alias); 1 May 2003 23:25:35 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 23549 invoked from network); 1 May 2003 23:25:34 -0000 Received: from unknown (HELO zenia.red-bean.com) (12.222.151.100) by sources.redhat.com with SMTP; 1 May 2003 23:25:34 -0000 Received: from zenia.red-bean.com (localhost.localdomain [127.0.0.1]) by zenia.red-bean.com (8.12.5/8.12.5) with ESMTP id h41NU4Fq024464; Thu, 1 May 2003 18:30:04 -0500 Received: (from jimb@localhost) by zenia.red-bean.com (8.12.5/8.12.5/Submit) id h41NTqrX024460; Thu, 1 May 2003 18:29:52 -0500 To: "Lev Assinovsky" Cc: Subject: Re: DWARF problem - newbie question References: <3F6F4712B759A34ABD453A8B39C10D6260DC97@bagman.edm.com> From: Jim Blandy Date: Thu, 01 May 2003 23:25:00 -0000 In-Reply-To: <3F6F4712B759A34ABD453A8B39C10D6260DC97@bagman.edm.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.95 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-05/txt/msg00009.txt.bz2 "Lev Assinovsky" writes: > Hi! > I use gcc 3.2 and gdb+dejagnu-20030228. > Compile my code with -ggdb option which promises > the most expressive extra debug info. > But when in gdb I request "info macro M" > I get: > GDB has no preprocessor macro information for that code, though > I do have macro M defined in my source. > > What am I doing wrong? At the moment, to get macro information, you need to: - use the Dwarf 2 debugging format, and - pass GCC the -g3 flag, to ask it to include macro information. You don't say which platform you're using. On i686-pc-linux-gnu, GCC 3.2 defaults to using Dwarf 2. You can check for sure by running 'readelf -S foo.o' on one of your .o files, compiled with plain -g: - If it has a section named '.debug_info', then that's Dwarf 2. - If it has a section named '.stab', then that's STABS. If Dwarf 2 isn't the default, then you can request it with -gdwarf-2. So altogether, you'd need to say '-gdwarf-2 -g3'. I don't really know how -ggdb decides which format is 'the most expressive'. I think it's better to spell out what you want than to use that flag.