Qt and gdb

gdb doesn’t handle QStringLists as in

#include <QStringList>
int main(int, char** ) {
  QStringList    names  = {"abc", "def", "ghi"};
  int        nrs[3] = { 10, 11, 12};
  qDebug("%s %d", qPrintable(names[1]), nrs[1]);
  return 0;

When breaking on the qDebug line

p names[1]


Could not find operator].

I have installed the qt4-debuginfo rpm.
Debugging is akward if I can’t verify the content of array elements.
(The nrs array was only to verify that gdb handles ordinary arrays properly)

What shoudl I do or not do?

You should include enough information for anyone to possibly replicate what you’re looking at and provide context for what you are trying to do.


I am using an uptodate SuSE 13.2 system with Qt 4.8.6-4.4.1.
I am writeing a largish program but the small program above already demonstrates my problem.
Running the program it has no trouble printing names[1] as ‘def’ but gdb moans about not finding the ] operator.

Any help appreciated.