public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/11816] New: Incorrect debugging information for anonymous structures
@ 2003-08-05 23:21 gcc-bugzilla at gcc dot gnu dot org
  2003-08-05 23:27 ` [Bug debug/11816] " pinskia at physics dot uc dot edu
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2003-08-05 23:21 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2852 bytes --]

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debug/11816] Incorrect debugging information for anonymous structures
  2003-08-05 23:21 [Bug debug/11816] New: Incorrect debugging information for anonymous structures gcc-bugzilla at gcc dot gnu dot org
@ 2003-08-05 23:27 ` pinskia at physics dot uc dot edu
  2003-08-05 23:49 ` alfonso_acosta_mail at yahoo dot es
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-05 23:27 UTC (permalink / raw)
  To: gcc-bugs

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


------- Additional Comments From pinskia at physics dot uc dot edu  2003-08-05 23:27 -------
We need the preprocessed source for this.
Read http://gcc.gnu.org/bugs.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debug/11816] Incorrect debugging information for anonymous structures
  2003-08-05 23:21 [Bug debug/11816] New: Incorrect debugging information for anonymous structures gcc-bugzilla at gcc dot gnu dot org
  2003-08-05 23:27 ` [Bug debug/11816] " pinskia at physics dot uc dot edu
@ 2003-08-05 23:49 ` alfonso_acosta_mail at yahoo dot es
  2003-08-06  0:05 ` pinskia at physics dot uc dot edu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: alfonso_acosta_mail at yahoo dot es @ 2003-08-05 23:49 UTC (permalink / raw)
  To: gcc-bugs

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



------- Additional Comments From alfonso_acosta_mail at yahoo dot es  2003-08-05 23:49 -------
Subject: Re:  Incorrect debugging information for anonymous
 structures

pinskia at physics dot uc dot edu wrote:

> ------- Additional Comments From pinskia at physics dot uc dot edu  2003-08-05 23:27 -------
> We need the preprocessed source for this.
> Read http://gcc.gnu.org/bugs.html
> 
> 
> 

Sorry, I just used gccbug script, I attached the preprocessed file
# 1 "calc.c"
# 1 "<interno>"
# 1 "<l\355nea de orden>"
# 1 "calc.c"




typedef enum {
        CONSTANT,

        SUM,
        SUB,
        PROD,
        DIV,
        POW,

        ASIGNMENT,

        VAR,

        FORMAT,

        FUNC
} exprkind;

typedef enum {
        DEC,
        OCT,
        REAL
} format_t;

typedef struct expr *exptr;

typedef struct expr {
        exprkind kind;

        union{

                struct {
                        exptr binleft;
                        exptr binright;
                };

                struct {
                        exptr asigleft;
                        exptr asigright;
                };

                format_t format;

                char *varname;

                double constant;

                struct {
                        char *functname;
                        exptr *args;
                };

        };
} expr_t;

int main (){
        return 0;
}


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debug/11816] Incorrect debugging information for anonymous structures
  2003-08-05 23:21 [Bug debug/11816] New: Incorrect debugging information for anonymous structures gcc-bugzilla at gcc dot gnu dot org
  2003-08-05 23:27 ` [Bug debug/11816] " pinskia at physics dot uc dot edu
  2003-08-05 23:49 ` alfonso_acosta_mail at yahoo dot es
@ 2003-08-06  0:05 ` pinskia at physics dot uc dot edu
  2004-01-28 23:02 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-06  0:05 UTC (permalink / raw)
  To: gcc-bugs

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|                            |1
 GCC target triplet|i386-pc-linux-gnu           |i?86-pc-linux-gnu
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-06 00:05:37
               date|                            |


------- Additional Comments From pinskia at physics dot uc dot edu  2003-08-06 00:05 -------
After add "expr_t t;" to main (as gcc on the mainline removes unused types), I could reproduce this 
on 3.3.1 (20030707) and the mainline and 3.0.4 with gdb (2003-07-30):

tin:~/src/gnu/gcctest>~/ia32_linux_gcc3_3/bin/gcc -g pr11816.c -ggdb
tin:~/src/gnu/gcctest>gdb a.out
GNU gdb 2003-07-30-cvs
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 "i686-pc-linux-gnu"...
(gdb) b main
Breakpoint 1 at 0x8048344: file pr11816.c, line 58.
(gdb) run
Starting program: /home/gates/pinskia/src/gnu/gcctest/a.out 

Breakpoint 1, main () at pr11816.c:58
58              return 0;
(gdb) ptype expr_t
type = struct expr {
    exprkind kind;
    union {
        format_t format;
        char *varname;
        double constant;
    };
}


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debug/11816] Incorrect debugging information for anonymous structures
  2003-08-05 23:21 [Bug debug/11816] New: Incorrect debugging information for anonymous structures gcc-bugzilla at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2003-08-06  0:05 ` pinskia at physics dot uc dot edu
@ 2004-01-28 23:02 ` pinskia at gcc dot gnu dot org
  2004-02-06 18:37 ` cvs-commit at gcc dot gnu dot org
  2004-02-06 18:41 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-28 23:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-28 23:02 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-01/msg03172.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11816


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debug/11816] Incorrect debugging information for anonymous structures
  2003-08-05 23:21 [Bug debug/11816] New: Incorrect debugging information for anonymous structures gcc-bugzilla at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-01-28 23:02 ` pinskia at gcc dot gnu dot org
@ 2004-02-06 18:37 ` cvs-commit at gcc dot gnu dot org
  2004-02-06 18:41 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-06 18:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-06 18:37 -------
Subject: Bug 11816

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	uweigand@gcc.gnu.org	2004-02-06 18:37:26

Modified files:
	gcc            : ChangeLog dwarf2out.c 

Log message:
	PR debug/11816
	* dwarf2out.c (gen_decl_die): Handle anonymous struct members.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.2683&r2=2.2684
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dwarf2out.c.diff?cvsroot=gcc&r1=1.487&r2=1.488



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11816


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug debug/11816] Incorrect debugging information for anonymous structures
  2003-08-05 23:21 [Bug debug/11816] New: Incorrect debugging information for anonymous structures gcc-bugzilla at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-02-06 18:37 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-06 18:41 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-06 18:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-06 18:41 -------
Fixed for 3.5.0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11816


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-02-06 18:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-05 23:21 [Bug debug/11816] New: Incorrect debugging information for anonymous structures gcc-bugzilla at gcc dot gnu dot org
2003-08-05 23:27 ` [Bug debug/11816] " pinskia at physics dot uc dot edu
2003-08-05 23:49 ` alfonso_acosta_mail at yahoo dot es
2003-08-06  0:05 ` pinskia at physics dot uc dot edu
2004-01-28 23:02 ` pinskia at gcc dot gnu dot org
2004-02-06 18:37 ` cvs-commit at gcc dot gnu dot org
2004-02-06 18:41 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).