public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/44645]  New: [4.5 Regression] wrong debug info for nested typedef
@ 2010-06-23 10:53 redi at gcc dot gnu dot org
  2010-06-24 21:32 ` [Bug c++/44645] " rguenth at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-06-23 10:53 UTC (permalink / raw)
  To: gcc-bugs

this breaks debugging of std::map and other tree-based containers in the
library, see http://gcc.gnu.org/ml/libstdc++/2010-06/msg00159.html for more
info

$ cat debug2.cc
struct S
{
    typedef S* ptr;
    ptr p;
};

int main()
{
    S s = { };
    return !s.p;
}
$ $GCC45/bin/g++ -g -Wl,-R$GCC45/lib64 debug2.cc -o out2-45
$ gdb --quiet ./out2-45
Reading symbols from /tmp/out2-45...done.
(gdb) ptype S
type = struct S {
    S::ptr p;
}
(gdb) ptype S::p
type = void *

That type is wrong, it should be S* not void*

GCC 4.4 gets it right, by not tracking the typedef at all:

(gdb) ptype S
type = struct S {
    S *p;
}
(gdb) ptype S::p
type = struct S {
    S *p;
} *


GCC 4.6 tracks the typedef and gets its type right:

(gdb) ptype S
type = struct S {
    S::ptr p;
}
(gdb) ptype S::p
type = struct S {
    S::ptr p;
} *


-- 
           Summary: [4.5 Regression] wrong debug info for nested typedef
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: wrong-debug
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: redi at gcc dot gnu dot org


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


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

* [Bug c++/44645] [4.5 Regression] wrong debug info for nested typedef
  2010-06-23 10:53 [Bug c++/44645] New: [4.5 Regression] wrong debug info for nested typedef redi at gcc dot gnu dot org
@ 2010-06-24 21:32 ` rguenth at gcc dot gnu dot org
  2010-06-24 22:04 ` rguenth at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-06-24 21:32 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.1


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


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

* [Bug c++/44645] [4.5 Regression] wrong debug info for nested typedef
  2010-06-23 10:53 [Bug c++/44645] New: [4.5 Regression] wrong debug info for nested typedef redi at gcc dot gnu dot org
  2010-06-24 21:32 ` [Bug c++/44645] " rguenth at gcc dot gnu dot org
@ 2010-06-24 22:04 ` rguenth at gcc dot gnu dot org
  2010-07-13 11:54 ` [Bug debug/44645] " redi at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-06-24 22:04 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug debug/44645] [4.5 Regression] wrong debug info for nested typedef
  2010-06-23 10:53 [Bug c++/44645] New: [4.5 Regression] wrong debug info for nested typedef redi at gcc dot gnu dot org
  2010-06-24 21:32 ` [Bug c++/44645] " rguenth at gcc dot gnu dot org
  2010-06-24 22:04 ` rguenth at gcc dot gnu dot org
@ 2010-07-13 11:54 ` redi at gcc dot gnu dot org
  2010-07-21 15:50 ` redi at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-07-13 11:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from redi at gcc dot gnu dot org  2010-07-13 11:54 -------
Oops, this should be Component=debug


-- 

redi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |debug


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


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

* [Bug debug/44645] [4.5 Regression] wrong debug info for nested typedef
  2010-06-23 10:53 [Bug c++/44645] New: [4.5 Regression] wrong debug info for nested typedef redi at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-07-13 11:54 ` [Bug debug/44645] " redi at gcc dot gnu dot org
@ 2010-07-21 15:50 ` redi at gcc dot gnu dot org
  2010-07-31  9:35 ` rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-07-21 15:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from redi at gcc dot gnu dot org  2010-07-21 15:50 -------
Am I allowed to confirm my own bugs?  doing so anyway

There's no difference when using -gdwarf-2 -gstrict-dwarf

readelf -wi for the output of g++ 4.5 shows S::ptr as:

<1><4f>: Abbrev Number: 5 (DW_TAG_pointer_type)
     DW_AT_byte_size   : 8

which is missing the type, so S::ptr is void*

The output of g++ 4.4 and 4.6 shows:

<1><4f>: Abbrev Number: 5 (DW_TAG_pointer_type)
     DW_AT_byte_size   : 8
     DW_AT_type        : <2d>

where <2d> is the info for S so S::ptr is S*


-- 

redi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-21 15:50:23
               date|                            |


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


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

* [Bug debug/44645] [4.5 Regression] wrong debug info for nested typedef
  2010-06-23 10:53 [Bug c++/44645] New: [4.5 Regression] wrong debug info for nested typedef redi at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-07-21 15:50 ` redi at gcc dot gnu dot org
@ 2010-07-31  9:35 ` rguenth at gcc dot gnu dot org
  2010-08-19 12:20 ` redi at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-07-31  9:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2010-07-31 09:29 -------
GCC 4.5.1 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.5.1                       |4.5.2


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


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

* [Bug debug/44645] [4.5 Regression] wrong debug info for nested typedef
  2010-06-23 10:53 [Bug c++/44645] New: [4.5 Regression] wrong debug info for nested typedef redi at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-07-31  9:35 ` rguenth at gcc dot gnu dot org
@ 2010-08-19 12:20 ` redi at gcc dot gnu dot org
  2010-08-19 12:22 ` redi at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-08-19 12:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from redi at gcc dot gnu dot org  2010-08-19 12:19 -------
*** Bug 45181 has been marked as a duplicate of this bug. ***


-- 

redi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nikolay at totalviewtech dot
                   |                            |com


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


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

* [Bug debug/44645] [4.5 Regression] wrong debug info for nested typedef
  2010-06-23 10:53 [Bug c++/44645] New: [4.5 Regression] wrong debug info for nested typedef redi at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2010-08-19 12:20 ` redi at gcc dot gnu dot org
@ 2010-08-19 12:22 ` redi at gcc dot gnu dot org
  2010-08-19 12:26 ` [Bug debug/44645] [4.5 Regression] missing debug info for pointer types redi at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-08-19 12:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from redi at gcc dot gnu dot org  2010-08-19 12:22 -------
*** Bug 45334 has been marked as a duplicate of this bug. ***


-- 

redi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andre dot poenitz at nokia
                   |                            |dot com


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


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

* [Bug debug/44645] [4.5 Regression] missing debug info for pointer types
  2010-06-23 10:53 [Bug c++/44645] New: [4.5 Regression] wrong debug info for nested typedef redi at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2010-08-19 12:22 ` redi at gcc dot gnu dot org
@ 2010-08-19 12:26 ` redi at gcc dot gnu dot org
  2010-08-19 12:32 ` redi at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-08-19 12:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from redi at gcc dot gnu dot org  2010-08-19 12:26 -------
(adjusting title to be more general)

testcase from dup Bug 45181

struct S { int f(S*); };

int S::f(S* p)
{
    return 0;
}

int main()
{
    S s;
    return s.f(&s);
}

within S::f p has type void*


Tom, CCing you as you've correctly identified this as a GCC 4.5 bug at
http://gcc.gnu.org/ml/libstdc++/2010-06/msg00159.html and
http://sourceware.org/bugzilla/show_bug.cgi?id=11639


-- 

redi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu dot
                   |                            |org
      Known to fail|4.5.0                       |4.5.0 4.5.1
            Summary|[4.5 Regression] wrong debug|[4.5 Regression] missing
                   |info for nested typedef     |debug info for pointer types


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


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

* [Bug debug/44645] [4.5 Regression] missing debug info for pointer types
  2010-06-23 10:53 [Bug c++/44645] New: [4.5 Regression] wrong debug info for nested typedef redi at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2010-08-19 12:26 ` [Bug debug/44645] [4.5 Regression] missing debug info for pointer types redi at gcc dot gnu dot org
@ 2010-08-19 12:32 ` redi at gcc dot gnu dot org
  2010-09-18 13:21 ` redi at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-08-19 12:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from redi at gcc dot gnu dot org  2010-08-19 12:32 -------
testcase from Bug 45334 reduced to a single file:

struct Base
{
    virtual ~Base();
};

Base::~Base() {}

struct Derived : Base
{
    virtual ~Derived();
    void foo();
};

Derived::~Derived() {}

void Derived::foo()
{
    Base *b = this;
    Base &br = *b;
}

int main()
{
    Derived d;
    d.foo();
    Base *b = &d;
}

Within Derived::foo b has type void*

Breakpoint 1, Derived::foo (this=0x7fffffffe5f0) at bug.cc:18
18          Base *b = this;
(gdb) ptype b
type = void *


-- 


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


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

* [Bug debug/44645] [4.5 Regression] missing debug info for pointer types
  2010-06-23 10:53 [Bug c++/44645] New: [4.5 Regression] wrong debug info for nested typedef redi at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2010-08-19 12:32 ` redi at gcc dot gnu dot org
@ 2010-09-18 13:21 ` redi at gcc dot gnu dot org
  2010-09-18 13:26 ` hjl dot tools at gmail dot com
  2010-09-18 14:13 ` hjl dot tools at gmail dot com
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-09-18 13:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from redi at gcc dot gnu dot org  2010-09-18 13:20 -------
*** Bug 45717 has been marked as a duplicate of this bug. ***


-- 

redi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |charlet at gcc dot gnu dot
                   |                            |org


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


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

* [Bug debug/44645] [4.5 Regression] missing debug info for pointer types
  2010-06-23 10:53 [Bug c++/44645] New: [4.5 Regression] wrong debug info for nested typedef redi at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2010-09-18 13:21 ` redi at gcc dot gnu dot org
@ 2010-09-18 13:26 ` hjl dot tools at gmail dot com
  2010-09-18 14:13 ` hjl dot tools at gmail dot com
  11 siblings, 0 replies; 13+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-09-18 13:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from hjl dot tools at gmail dot com  2010-09-18 13:26 -------
This is caused by revision 154354:

http://gcc.gnu.org/ml/gcc-cvs/2009-11/msg00575.html


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com


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


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

* [Bug debug/44645] [4.5 Regression] missing debug info for pointer types
  2010-06-23 10:53 [Bug c++/44645] New: [4.5 Regression] wrong debug info for nested typedef redi at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2010-09-18 13:26 ` hjl dot tools at gmail dot com
@ 2010-09-18 14:13 ` hjl dot tools at gmail dot com
  11 siblings, 0 replies; 13+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-09-18 14:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from hjl dot tools at gmail dot com  2010-09-18 14:13 -------


*** This bug has been marked as a duplicate of 43628 ***


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2010-09-18 14:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-23 10:53 [Bug c++/44645] New: [4.5 Regression] wrong debug info for nested typedef redi at gcc dot gnu dot org
2010-06-24 21:32 ` [Bug c++/44645] " rguenth at gcc dot gnu dot org
2010-06-24 22:04 ` rguenth at gcc dot gnu dot org
2010-07-13 11:54 ` [Bug debug/44645] " redi at gcc dot gnu dot org
2010-07-21 15:50 ` redi at gcc dot gnu dot org
2010-07-31  9:35 ` rguenth at gcc dot gnu dot org
2010-08-19 12:20 ` redi at gcc dot gnu dot org
2010-08-19 12:22 ` redi at gcc dot gnu dot org
2010-08-19 12:26 ` [Bug debug/44645] [4.5 Regression] missing debug info for pointer types redi at gcc dot gnu dot org
2010-08-19 12:32 ` redi at gcc dot gnu dot org
2010-09-18 13:21 ` redi at gcc dot gnu dot org
2010-09-18 13:26 ` hjl dot tools at gmail dot com
2010-09-18 14:13 ` hjl dot tools at gmail dot com

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).