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

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