This is the mail archive of the gdb@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]

Debugging Macros with gdb DOES NOT WORK


Hi,

I have posted the mail below couple of days ago.  I got no replies.  Did
anyone face the same problem?  Could any of you please give me more
information regarding this?  Should I submit a bug report for this?

Thank you very much in advance,
Sagar.


-----Original Message-----
From: gdb-owner@sources.redhat.com [mailto:gdb-owner@sources.redhat.com]
On Behalf Of Vidyasagara Guntaka
Sent: Monday, February 14, 2005 4:52 PM
To: gdb@sources.redhat.com
Subject: Debugging Macros with gdb

Hi,

I am new to this list.  I sent a mail to the gcc-help mailing list and
got a response saying that the following issue is a gdb issue.

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)

Thanks and regards,
Sagar.




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