This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/11816] New: Incorrect debugging information for anonymous structures
- From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Aug 2003 23:21:56 -0000
- Subject: [Bug debug/11816] New: Incorrect debugging information for anonymous structures
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11816
Summary: Incorrect debugging information for anonymous structures
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: alfonso_acosta_mail at yahoo dot es
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-pc-linux-gnu
GCC host triplet: i386-pc-linux-gnu
GCC target triplet: i386-pc-linux-gnu
When I define an anonymous structure inside an anonymous union, I cannot refer to the structure fields while debugging with gdb. I think debugging symbols are not generated properly. Might be a gdb bug.
Environment:
System: Linux SuSiTO 2.4.21 #4 lun jul 28 04:12:48 CEST 2003 i686 GNU/Linux
Architecture: i686
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i386-linux
How-To-Repeat:
I define some types:
//calc.c
typedef struct expr *exptr;
typedef struct expr {
exprkind kind;
union{
struct { /* binary operators */
exptr binleft;
exptr binright;
};
struct { /* asignment expression */
exptr asigleft; /* should be a func or identifier */
exptr asigright;
};
format_t format; /* format directive */
char *varname; /* variable name */
double constant;
struct { /* function */
char *functname;
exptr *args; /* NULL ended argument array */
};
};
} expr_t;
$ make calc
gcc -Wall -g -ggdb -o calc calc.c
$ gdb calc
gdb calc
GNU gdb 5.3.90_2003-06-29-cvs-debian
Copyright 2003 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-linux"...
(gdb) ptype expr_t
type = struct expr {
exprkind kind;
union {
format_t format;
char *varname;
double constant;
};
}
Of course, I cannot refer to any member of a expr_t variable different from the ones printed above. 2º level anonymous structs are ignored.
$ p expr_tpointer->binleft
There is no member named binleft