how to step into qt source code when debug
-
I have tried a few days, but can't do this.
-
Hi
You might have to build a debug version of the Qt you are using.
with configure option -debug-and-release.
If using visual studio, in some versions of Qt the PDB files are included.
So it depends on what you have installed
http://qihome.org/qiliang/2013/01/30/how-to-debug-into-qt-library-in-qt-creator-with-cdb/ -
@VRonin said in how to step into qt source code when debug:
Maybe I'm taking a detour here, why are you looking to debug inside Qt?
Are you looking to contribute to Qt itself?Stepping into Qt code can be enlightening in many cases where you don't quite understand why things behave as they do. I can highly recommend it.
-
@Asperamanca
So do you have any suggestion to step into the qt source code? Thank you. -
When I had trouble stepping into Qt source, usually the application used the "release" dlls of Qt (e.g. Qt5Core.dll instead of Qt5Cored.dll). See if your debugger shows you which dlls are loaded on startup.
If this is the problem, the easiest way to fix it is to put only the debug dlls in the application's start path.
-
@Asperamanca
Sorry that this is not my problem.
Also I want to say, if you are in debug mode, it will not use Qt5Core.dll. The Qt Creator has already set the correct .dll files with *d.dll in debug and *.dll in release. -
@betterorbest said in how to step into qt source code when debug:
@Asperamanca
Sorry that this is not my problem.
Also I want to say, if you are in debug mode, it will not use Qt5Core.dll. The Qt Creator has already set the correct .dll files with *d.dll in debug and *.dll in release.What is your problem then? Can you describe
- What you intend to do
- How you do it
- What you expect to happen
- What actually happens
-
@Asperamanca
I intend to step into the Qt source code;
I have installed Qt5.5.0 with Src selected. As what people online say, with the Src directory setted, I can step into Qt src code. But this didn't happened. For example, I can't step into the func show() of qwidgets.
In Qtcreator, I have done what the following link says, http://qihome.org/qiliang/2013/01/30/how-to-debug-into-qt-library-in-qt-creator-with-cdb/. -
@betterorbest
I mostly debug with Visual Studio, but I just tried it with Qt Creator and Qt 5.9 MinGW. In my case, I could step into Qt sources but the lines numbers were all wrong (the program was clearly executing other code than what I saw as the 'current line').
Sorry if I can't help you - but with Creator, I simply lack the experience. -
@Asperamanca
Really thank you for your answer.
I also debugged with visual stuido 2013 and qt add-in. I have set the src directory in Solution setting. Also I downloaded pdb-msvc-2013-32.7z and set the debug symbol in visual studio. However it didn't work. -
I have solved the problem after I downloaded Qt5.8.0 and installed it. Maybe the problem is just in Qt5.5.0 because of the incorrect pdb files downloaded from Qt official website.