This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: gdb cannot understand some type with STL
On 12/23/07, Daniel Jacobowitz <drow@false.org> wrote:
> What does "whatis l" print? I believe this problem is because GDB
> does not know about default template parameters.
>
> template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
> class list : protected _List_base<_Tp, _Alloc>
>
> It's going to be a std::list<int, std::allocator<int> > or something
> like that.
You are right.
(gdb) whatis l
type = std::list<int, std::allocator<int> >
(gdb) whatis 'std::list<int, std::allocator<int> >'
type = std::list<int, std::allocator<int> >
>
> This is fixable, but it would require changes to both GCC and GDB that
> no one has worked on yet.
>
> > (gdb) whatis std::list<int>*
> > A syntax error in expression, near `'.
>
> This looks like a bug in GDB, in the c-exp.y parser.
Yes, this looks like a bug.
(gdb) whatis 'std::list<int, std::allocator<int> >*'
No symbol "std::list<int, std::allocator<int> >*" in current context.
Thanks,
Jian