This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81932] Template arguments of type unsigned generate incorrect debugging information
- From: "psmith at gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 23 Aug 2017 11:51:04 +0000
- Subject: [Bug c++/81932] Template arguments of type unsigned generate incorrect debugging information
- Auto-submitted: auto-generated
- References: <bug-81932-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81932
--- Comment #3 from Paul Smith <psmith at gnu dot org> ---
Created attachment 42030
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42030&action=edit
tv.py
Test case attached. To run it:
$ gcc -ggdb3 -o tvtest tvtest.cpp
$ gdb tvtest -ex 'br 28' -ex 'source tv.py' -ex 'run' -ex 'p $tv(tv)'
...
Reading symbols from tvtest...done.
Breakpoint 1 at 0x400804: file tvtest.cpp, line 28.
Starting program: /home/psmith/src/gcc/tvtest
Breakpoint 1, main (argc=1, argv=0x7fffffffe758) at tvtest.cpp:28
28 return tv.tree->_depth;
vector: TreeVector<int, 2>
tree: TreeVector<int, 2>::Tree *
warning: RTTI symbol not found for class 'TreeVector<int, 2u>::Tree'
depth: 3
Python Exception <class 'gdb.error'> No type named TreeVector<int, 2u>::Tree.:
Error occurred in Python convenience function: No type named TreeVector<int,
2u>::Tree.
(gdb)
If you build with GCC 6.2 instead, it will work fine.
Note, I'm not sure whether the old type containing "2u" is right and the new
one is wrong or vice versa, but there's definitely a problem in that in the new
one we see "2" in the type but something in the debug symbols is still looking
for "2u" as evidenced by the RTTI symbol warning.