Pretty Printer for std::vector not working
-
Hi all,
I'm using the Pretty Printers for gdb in QtCreator since a long time. All of them work fine, but the values of std::vector and some other stl containers cannot be displayed when debugging with gdb in QtCreator. I found the directory share/qtcreator/debugger in my QtCreator and there stdtypes.py handling std::vector too. So my question is, why doesn't it work?
Some Info:
QtCreator: 4.6.2 (licensed)
gdb: 8.1.0.20180409-git
gcc: 7.3.0
Ubuntu: 18.04Best Regards
tkansgar -
I'm not sure if this could be related or if you are even installing Qt via the Maintenance Tool, but some time in Qt 5.11.x releases, the 'Qt Debug Information Files' where a made separate selection in the Qt Maintenance Tool. At least this is the case on Windows .
-
Hi all,
I'm using the Pretty Printers for gdb in QtCreator since a long time. All of them work fine, but the values of std::vector and some other stl containers cannot be displayed when debugging with gdb in QtCreator. I found the directory share/qtcreator/debugger in my QtCreator and there stdtypes.py handling std::vector too. So my question is, why doesn't it work?
Some Info:
QtCreator: 4.6.2 (licensed)
gdb: 8.1.0.20180409-git
gcc: 7.3.0
Ubuntu: 18.04Best Regards
tkansgar -
Hi,
I just tested your code (with one small extension):
I see only "<not accessible>", where you see the four vector items. But the program works as expected.I also tried this tip from a colleague: https://sourceware.org/gdb/wiki/STLSupport. It's just implemented here, but doesn't help too.
Does anyone know, that QtCreator 4.6.2 cannot display std::vevtor values? I really can't believe that.
Best Regards
tkansgar -
Hi,
I just tested your code (with one small extension):
I see only "<not accessible>", where you see the four vector items. But the program works as expected.I also tried this tip from a colleague: https://sourceware.org/gdb/wiki/STLSupport. It's just implemented here, but doesn't help too.
Does anyone know, that QtCreator 4.6.2 cannot display std::vevtor values? I really can't believe that.
Best Regards
tkansgar@tkansgar why don't you upgrade Creator?
4.9 was released some day ago: https://blog.qt.io/blog/2019/04/15/qt-creator-4-9-0-released
and as shown above, it works nicely.
-
@tkansgar why don't you upgrade Creator?
4.9 was released some day ago: https://blog.qt.io/blog/2019/04/15/qt-creator-4-9-0-released
and as shown above, it works nicely.
@aha_1980 said in Pretty Printer for std::vector not working:
@tkansgar why don't you upgrade Creator?
4.9 was released some day ago: https://blog.qt.io/blog/2019/04/15/qt-creator-4-9-0-released
and as shown above, it works nicely.
Hi,
I installed 4.9.0. But now all gets much worse! When I now try to debug the program above, gdb hangs at the breakpoint at the beginning of main, increases its memory usage up to ~57GB and then terminates. What is going wrong here now?
Best Regards
tkansgar -
@aha_1980 said in Pretty Printer for std::vector not working:
@tkansgar why don't you upgrade Creator?
4.9 was released some day ago: https://blog.qt.io/blog/2019/04/15/qt-creator-4-9-0-released
and as shown above, it works nicely.
Hi,
I installed 4.9.0. But now all gets much worse! When I now try to debug the program above, gdb hangs at the breakpoint at the beginning of main, increases its memory usage up to ~57GB and then terminates. What is going wrong here now?
Best Regards
tkansgar -
@aha_1980 said in Pretty Printer for std::vector not working:
What is going wrong here now?
I really don't know! And it is the simple example from above?
Have you already removed the build foldr and .pro.user file and tried again?
Hi aha_1980,
yes, source and binary are those from 4/17/2019. Nothing is rebuilt. And I don't have any project files for this sample. I just used "Debug external application" from the Debug menu in both test cases.
And I just tested gdb with this sample from the shell command line (without QtCreator). It works very fine (and can print the four values of v too):
(gdb) print v $1 = std::vector of length 4, capacity 4 = {1, 2, 3, 4}
Any ideas?
Best Regards
tkansgar -
@aha_1980 said in Pretty Printer for std::vector not working:
What is going wrong here now?
I really don't know! And it is the simple example from above?
Have you already removed the build foldr and .pro.user file and tried again?
Hi aha_1980,
yes, source and binary are those from 4/17/2019. Nothing is rebuilt. And I don't have any project files for this sample. I just used "Debug external application" from the Debug menu in both test cases.
And I just tested gdb with this sample from the shell command line (without QtCreator). It works very fine (and can print the four values of v too):
(gdb) print v $1 = std::vector of length 4, capacity 4 = {1, 2, 3, 4}
Any ideas?
Best Regards
tkansgarAnd I don't have any project files for this sample. I just used "Debug external application" from the Debug menu in both test cases.
Can you try with a minimal project?
I guess debugging external apps is more rarely used...
-
Hi again,
I found some time to create a project for my test file. But the issue remains the same. gdb reaches the breakpoint at the opening { of main and hangs. In the variables view on the right there is an endless turning circle radial lines. top shows 100% CPU usage for gdb and its memory comsumption increases more and more. Then I killed gdb.
Started on the command line gdb works totally normally with my test file, just like expected. So it must be an issue with qtcreator but not gdb. My suspicion is, it has to do with the attempt of qtcreator to get the variable values from gdb.
Do you need some more info about my test project?
Best Regards
tkansgar -
Hi again,
I found some time to create a project for my test file. But the issue remains the same. gdb reaches the breakpoint at the opening { of main and hangs. In the variables view on the right there is an endless turning circle radial lines. top shows 100% CPU usage for gdb and its memory comsumption increases more and more. Then I killed gdb.
Started on the command line gdb works totally normally with my test file, just like expected. So it must be an issue with qtcreator but not gdb. My suspicion is, it has to do with the attempt of qtcreator to get the variable values from gdb.
Do you need some more info about my test project?
Best Regards
tkansgarDo you need some more info about my test project?
Every info you have helps to solve the issue.
But for your current problem, you can directly create a report at bugreports.qt.io - please add a link here. Attach the sample project and the debugger log (Window > Views > Debugger Log) there.
sorry, but thats all I can do for you now :(
-
Do you need some more info about my test project?
Every info you have helps to solve the issue.
But for your current problem, you can directly create a report at bugreports.qt.io - please add a link here. Attach the sample project and the debugger log (Window > Views > Debugger Log) there.
sorry, but thats all I can do for you now :(
Hi again,
I just tried it with qtcreator 4.8.2. The result is the same. When encountering the first breakpoint in the test code, gdb hangs (trying to obtain the variable values).@aha_1980 said in Pretty Printer for std::vector not working:
...
But for your current problem, you can directly create a report at bugreports.qt.io - please add a link here. Attach the sample project and the debugger log (Window > Views > Debugger Log) there.
I wil do that now and come back again here.
Best Regards
tkansgar -
Here is the link to my bug report:
https://bugreports.qt.io/browse/QTCREATORBUG-22483 -
Hi again,
I just solved both issues, displaying std::vector item values and hanging of gdb in qtcreator 4.9: If I switch on both "Use Debugging Helper" and "Load system GDB pretty printers", gdb hangs on the first breakpoint. If one of them is switched off, gdb works properly. But "Load system GDB pretty printers" seems to be useless for me now, and "Use Debugging Helper" provides exactly that functionality I missed here.
Best Regards
tkansgar