Download Qt source code and debugging information
Install Qt source code
When installing Qt components, check source
to install.
After the installation is complete, you need to configure it in Qt Creator.
Click 工具
—— 选项
—— 调试器
—— 概要
—— in the menu bar in turn to add 添加Qt源码
the Src
directory under the installed Qt path , such as C:\Qt\Qt5.12.6\5.12.6\Src
.
Install debugger
Needs its own download Windows10 SDK installation and Qt Creator menu bar, select 工具
- - 选项
- Kits
, Debuggers
added in Windows Kits subdirectory cdb.exe
path.
Download debugging information (.pdb)
After Qt5.7, the pdb file is no longer placed in the same directory as the installer
Qt-Archive has no pdb file in this path.
Debugging under window needs to obtain pdb in the following directory
There are many directories under this address, and Qt 5.12.6 can go to the qt5_5126/qt.qt5.5126.debug_info.win64_msvc2017_64/
directory to download.
Download all .7z compressed packages from this path, and then unzip them to the Qt installation directory (for example C:\Qt\Qt5.12.6\5.12.6\msvc2017_64
), and the .pdb
debugging information files will be stored in the bin
and qml
folders respectively.
Qt source code debugging
In the Qt code written by yourself, add breakpoints and use the debugger to debug.
Use shortcut keys F11
to enter the corresponding Qt library function.
Note: You can enter the Qt source code only in the debug mode, and you cannot
F2
view the source code in the edit mode .