Bug 152176

Summary: gdb info macro fails even with gcc -gdwarf-2 -g3
Product: [Fedora] Fedora Reporter: David L. <idht4n>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED INSUFFICIENT_DATA QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 3CC: cagney, jakub, jslupski, mattdm
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-02-07 05:32:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Backport of PR debug/20253 to gcc-3_4-branch none

Description David L. 2005-03-25 17:15:14 UTC
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

Comment 1 Jakub Jelinek 2005-03-29 08:49:05 UTC
Created attachment 112410 [details]
Backport of PR debug/20253 to gcc-3_4-branch

Comment 2 Jakub Jelinek 2005-03-29 08:51:33 UTC
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.

Comment 3 Matthew Miller 2006-07-10 22:05:00 UTC
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!


Comment 4 petrosyan 2008-02-07 05:32:19 UTC
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.