gdb appears unable to understand the [] operator of a QList<T> object. I used the following program
Qt Code:
  1. #include <QList>
  2. int main(int, char** ) {
  3. QList<int> ints;
  4. ints << 123 << 240;
  5. printf("size %d ints[1] = %d\n", ints.size(), ints[1]);
  6. return 0;
  7. }
To copy to clipboard, switch view to plain text mode 
I am using SuSE 13.2 with
gcc version 4.8.3 20140627 [gcc-4_8-branch revision 212064] (SUSE Linux)

The following output shows that the program appears to run properly but gdb has a problem.
Qt Code:
  1. enno@linux:~/prog/trial> make -B
  2. /usr/bin/qmake -o Makefile trial.pro
  3. g++ -c -std=c++11 -g -Wall -W -D_REENTRANT -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include -I. -I. -o trial.o trial.cpp
  4. g++ -o trial trial.o -L/usr/lib64 -lQtCore -L/usr/lib64 -lpthread
  5. { test -n "" && DESTDIR="" || DESTDIR=.; } && gdb --nx --batch --quiet -ex 'set confirm off' -ex "save gdb-index $DESTDIR" -ex quit 'trial' && test -f trial.gdb-index && objcopy --add-section '.gdb_index=trial.gdb-index' --set-section-flags '.gdb_index=readonly' 'trial' 'trial' && rm -f trial.gdb-index || true
  6. enno@linux:~/prog/trial> gdb
  7. GNU gdb (GDB; openSUSE 13.2) 7.8
  8. Copyright (C) 2014 Free Software Foundation, Inc.
  9. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  10. This is free software: you are free to change and redistribute it.
  11. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  12. and "show warranty" for details.
  13. This GDB was configured as "x86_64-suse-linux".
  14. Type "show configuration" for configuration details.
  15. For bug reporting instructions, please see:
  16. <http://bugs.opensuse.org/>.
  17. Find the GDB manual and other documentation resources online at:
  18. <http://www.gnu.org/software/gdb/documentation/>.
  19. For help, type "help".
  20. Type "apropos word" to search for commands related to "word".
  21. (gdb) show build-id-verbose
  22. Verbosity level of the build-id locator is 2.
  23. (gdb) file trial
  24. Reading symbols from trial...done.
  25. (gdb) b trial.cpp:6
  26. Breakpoint 1 at 0x400c6b: file trial.cpp, line 6.
  27. (gdb) r
  28. Starting program: /home/enno/prog/trial/trial
  29. Got object file from memory but can't read symbols: File truncated.
  30. [Thread debugging using libthread_db enabled]
  31. Using host libthread_db library "/lib64/libthread_db.so.1".
  32. size 2 ints[1] = 240
  33.  
  34. Breakpoint 1, main () at trial.cpp:6
  35. 6 return 0;
  36. (gdb) p ints.size()
  37. $1 = 2
  38. (gdb) p ints[1]
  39. Could not find operator[].
  40. (gdb) q
To copy to clipboard, switch view to plain text mode 
When I do a similar test using the stdc++ vector class gdb has no problem,
so it appears to be a Qt problem. Is this a bug or do I forget something.

Appreciate any help.
Enno