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

gdb/488: vtable, RTTI, and namespaces don't work together



>Number:         488
>Category:       gdb
>Synopsis:       vtable, RTTI, and namespaces don't work together
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 15 15:18:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     John Lenz
>Release:        latest CVS
>Organization:
>Environment:

>Description:
When debuging that simple program attached below, the debug session when a breakpoint is added on line 27
...
(gdb) p bar
$1 = (Bar *) 0x8049a00
(gdb) p *bar
can't find class named `Name::Bar`, as given by C++ RTTI

If you comment out the virtual function in the foo class, it prints out the class fine.  Also, removing the namespace and leaving the virtual function in the class also compiles and prints the class as expected.  A dynamic_cast from a Foo to a Bar works so I believe that the compiler finds the Name::Bar type in the RTTI and runs as expected.  

I am compiling with gcc version 3.0.4.  When this test program is compiled with gcc 2.95.4, it debugs and prints fine.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.cc"

I2luY2x1ZGUgPGlvc3RyZWFtPgoKbmFtZXNwYWNlIE5hbWUgewogIGNsYXNzIEZvbyB7CiAgICBw
dWJsaWM6CiAgICAgIGludCBhOwogICAgICB2aXJ0dWFsIHZvaWQgc2V0YShpbnQgeCkgewogICAg
ICAgIGEgPSB4OwogICAgICB9CiAgfTsKCiAgY2xhc3MgQmFyIDogcHVibGljIEZvbyB7CiAgICBw
dWJsaWM6CiAgICAgIGludCBiOwogIH07Cn07CgppbnQgbWFpbigpIHsKICBOYW1lOjpCYXIgKmJh
ciA9IG5ldyBOYW1lOjpCYXIoKTsKICAKICBiYXItPmIgPSAzOwogIGJhci0+YSA9IDY7CiAgCiAg
Ly9OYW1lOjpGb28gKmZvbyA9IGJhcjsKICAvL2JhciA9IGR5bmFtaWNfY2FzdDxOYW1lOjpCYXIg
Kj4oZm9vKTsKICAKICBzdGQ6OmNvdXQgPDwgYmFyLT5hIDw8ICIgIiA8PCBiYXItPmIgPDwgc3Rk
OjplbmRsOwoKICBkZWxldGUgYmFyOwoKICByZXR1cm4gMDsKfQo=


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