From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041111 Firefox/1.0 Description of problem: Can't see macro info from gdb even when compiling with -gdwarf-2 -g3 flags Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Implemented the example from http://sources.redhat.com/gdb/current/onlinedocs/gdb_10.html 2. 3. Actual Results: gdb responds with: The symbol `ADD' has no definition as a C/C++ preprocessor macro at /usr/include/stdio.h:-1 Expected Results: gdb to respond with something like: Defined at /tmp/sample.c:5 Additional info: In case the above mention website is retired before this bug, here's how to reproduce the problem: $ cat sample.c #include <stdio.h> #include "sample.h" #define M 42 #define ADD(x) (M + x) main () { #define N 28 printf ("Hello, world!\n"); #undef N printf ("We're so creative.\n"); #define N 1729 printf ("Goodbye, world!\n"); } $ cat sample.h #define Q < $ gcc -gdwarf-2 -g3 sample.c -o sample $ gdb -nw sample GNU gdb Red Hat Linux (6.1post-1.20040607.43rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) list main 3 4 #define M 42 5 #define ADD(x) (M + x) 6 7 main () 8 { 9 #define N 28 10 printf ("Hello, world!\n"); 11 #undef N 12 printf ("We're so creative.\n"); (gdb) info macro ADD The symbol `ADD' has no definition as a C/C++ preprocessor macro at /usr/include/stdio.h:-1
Created attachment 112410 [details] Backport of PR debug/20253 to gcc-3_4-branch
Unfortunately, gdb segfaults on the binary produced by the fixed GCC (as well as gcc4-4.0.0-0.34.fc3), so IMHO it doesn't make sense to apply this patch for FC3 until gdb is fixed.
Fedora Core 3 is now maintained by the Fedora Legacy project for security updates only. If this problem is a security issue, please reopen and reassign to the Fedora Legacy product. If it is not a security issue and hasn't been resolved in the current FC5 updates or in the FC6 test release, reopen and change the version to match. Thank you!
Fedora Core 3 is not maintained anymore. Setting status to "INSUFFICIENT_DATA". If you can reproduce this bug in the current Fedora release please reopen this bug and assign it to the corresponding Fedora version.