PDA

View Full Version : Qt and gdb



enno
29th March 2015, 14:27
My problem already arises in a program like

#include <QList>
int main(int, char** ) {
QList<int> ls;
ls.append(10);
ls.append(11);
ls.append(12);
la.append(13);
for( int i = 0; i < 4; ++i ) qDebug("list[%d] %d", i, ls[i]);
}
Compiled with
CONFIG += debug the program runs as expected but at a gdb breakpoint on the for(... line I get

(gdb) p ls[1]
Could not find operator[].

I believe I got most debug libraries.
In the real program a QList gives trouble but if I can't see what element is being processed I am lost.
What do I forget / do wrong?

Regards,
Enno