From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9098 invoked by alias); 6 Jul 2002 17:33:22 -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 9082 invoked from network); 6 Jul 2002 17:33:20 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by sources.redhat.com with SMTP; 6 Jul 2002 17:33:20 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id A833C5EA11; Sat, 6 Jul 2002 12:33:18 -0500 (EST) To: Pierre Habraken Cc: gdb@sources.redhat.com Subject: Re: Expansing macro-definitions using Gdb References: <3D2706FD.DF3F5DF9@imag.fr> From: Jim Blandy In-Reply-To: <3D2706FD.DF3F5DF9@imag.fr> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Date: Sat, 06 Jul 2002 10:33:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-07/txt/msg00074.txt.bz2 Pierre Habraken writes: > The Gcc man page tells that using the option -g3 macro-definitions > present in the source program are included into the object file. > However, even when I use this option at compile time, Gdb 5.2 does not > recognize such macro-definitions. > Actually, using gcc 3.04, I compiled a C program including macro > definitions first with option -g and then with option -g3. Then, when > using cmp to compare both executables no difference is detected. > Is there a way to enable printing/displaying macro-definitions when > debugging a C program with Gdb ? Macro support was added after 5.2. To get preprocessor macro support, you'll need to get the latest GDB sources. For the compiler, you'll need to use Dwarf 2 debugging information. Try -gdwarf-2 -g3.