This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
Re: macros/2483: not even the macro debugging example from the documentationworks
- From: Christian Jaeger <christian at jaeger dot mine dot nu>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 25 Jul 2008 17:18:01 -0000
- Subject: Re: macros/2483: not even the macro debugging example from the documentationworks
- Reply-to: Christian Jaeger <christian at jaeger dot mine dot nu>
The following reply was made to PR macros/2483; it has been noted by GNATS.
From: Christian Jaeger <christian@jaeger.mine.nu>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-gnats@sources.redhat.com, nobody@sources.redhat.com,
gdb-prs@sources.redhat.com
Subject: Re: macros/2483: not even the macro debugging example from the documentation
works
Date: Fri, 25 Jul 2008 19:08:25 +0200
Tom Tromey wrote:
> I tried this on Fedora 8 and it works for me.
>
> Maybe your version of gcc is emitting the wrong information?
> What version of gcc are you using?
>
> FWIW, gcc 4.3 had a bug in this area.
>
Yes, it's gcc 4.3 (I did mention under "*Environment"):*
$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.1-2'
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc
--enable-mpfr --enable-cld --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.1 (Debian 4.3.1-2)
> You can look at the macro info with "objdump -W sample".
> That might prove interesting.
>
I've attached the output of that.
$ objdump -v
GNU objdump (GNU Binutils for Debian) 2.18.0.20080103
(...)
$ gcc-4.2 -gdwarf-2 -g3 sample.c -o sample
$ gdb sample
...
(gdb) info macro Q
Defined at /tmp/chris/sample.h:1
included at /tmp/chris/sample.c:2
#define Q <
...
(gdb) macro expand N Q M
expands to: 28 < 42
Also, macro expansion works when compiling 'my' application using gcc-4.2.
So yes it seems a bug in the current stable gcc version (as released 1.5
months ago).
What do you recommend me to do, tell the Debian maintainers to apply a
patch? (Well, I guess I'll just report a bug to the Debian bugtracker
and let them decide.)
Thanks,
Christian.