This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Expansing macro-definitions using Gdb
- From: Jim Blandy <jimb at redhat dot com>
- To: Pierre Habraken <Pierre dot Habraken at imag dot fr>
- Cc: gdb at sources dot redhat dot com
- Date: 06 Jul 2002 12:33:18 -0500
- Subject: Re: Expansing macro-definitions using Gdb
- References: <3D2706FD.DF3F5DF9@imag.fr>
Pierre Habraken <Pierre.Habraken@imag.fr> 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.