This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

symtab/1877: gdb says that tthere is no information for a macro when readelf clearly identifies the macro


>Number:         1877
>Category:       symtab
>Synopsis:       gdb says that tthere is no information for a macro when readelf clearly identifies the macro
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 23 18:08:00 UTC 2005
>Closed-Date:
>Last-Modified:
>Originator:     vguntaka@brocade.com
>Release:        GNU gdb Red Hat Linux (6.1post-1.20040607.43rh)
>Organization:
>Environment:
Linux rainbow.brocade.com 2.6.10-1.766_FC3 #1 Wed Feb 9 23:06:42 EST 2005 i686 i686 i386 GNU/Linux
>Description:
I am trying to debug macros using gdb.  I have read the gdb document which said that -gdwarf-2 and -g3 options must be present while compiling using gcc.  I did that.  Still, when I used gdb, it complained that there was no information for the macro name.  Do I need to specify any other options apart from the above?


Helow I am giving a transcript of what happened on Fedora Core 3 system:

[sagar@rainbow c]# cat x.c
#include <stdio.h>

#define ABC 257

main ()
{
    int a = 190;
    printf ("Testing (%d) .....\n", ABC);
    return (0);
}
[sagar @rainbow c]# gcc --version
gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[sagar @rainbow c]# gcc -gdwarf-2 -g3 -o x x.c [sagar @rainbow c]# gdb -nw ./x 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) info macro ABC
GDB has no preprocessor macro information for that code.
(gdb) break 8
Breakpoint 1 at 0x804838b: file x.c, line 8.
(gdb) run
Starting program: /home/sagar/programming/c/x

Breakpoint 1, main () at x.c:8
8           printf ("Testing (%d) .....\n", ABC);
(gdb) info macro ABC
The symbol `ABC' has no definition as a C/C++ preprocessor macro at
/usr/include/stdio.h:-1
(gdb)
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]