Qt 5.1.0 for Windows using minGW 4.8, which takes a lot of time to debug

I downloaded and installed Qt 5.1.0 for Windows 32-bit (MinGW 4.8) from the qt project download page. I ran the installer and can compile and run the applications using these libraries and the 32-bit minGW 4.8 dashboard.

However, I have a large application, and when I try to debug it (using gdb bundled with the minGW toolchain), it takes an insane amount of time to get started, and any interaction with the application takes a lot of time to complete. Not an annoying amount of time, but an unused amount of time. Has anyone else had this problem and are there any solutions?

In case this helps, I get a lot of debugging results as follows:

Temporarily disabling breakpoints for unloaded shared library "C:\Qt\Qt5.1.0\5.1.0\mingw48_32\plugins\somefolder\somelib.dll" 
+4
source share
4 answers

There is a gdb bug that was introduced at some point between 7.4 and 7.5, which makes it much slower. When debugging classes, QObject slower becomes terribly slow.

By disabling the debugging assistant, you will improve it, but then you will miss a lot of valuable data in local variables and expressions. For example, you cannot display the contents of QLists well, etc.

It seems that:

  • budling gdb from CVS or
  • using old gdb (7.4.1)

solves the problem.

+4
source

The creator of Qt has a "quick start attempt" in its gdb options. It helps LOT.

Or you can switch to using the MSVC compiler on Windows. It also switches your debugging to CDB instead of GDB and completely bypasses the problem. You can simply install the MSVC compiler and connect it to QtCreator instead of mingw if you don't like the MS IDE.

PS It also gives readable source dumps that are finds.

+4
source

See comments on the Zeks answer . There he explains that switching from a MinGW toolchain to a Microsoft toolchain (compiler, debugger) completely solves the problem. Fortunately, Qt Creator supports the Microsoft toolchain, so you don't need to switch the IDE.

After I did this, the debugger startup time is now 4 seconds, and in the event of an application crash, there is zero delay. He also accelerated the assembly .

For reference, I described how I configured my system here .

+1
source

I was able to significantly improve debugging speed after changing several parameters:

  • Make sure the compiler is gcc.exe, not g ++. exe in the folder Qt5.1.0\Tools\mingw48_32\bin
  • Uncheck Use Debugging Helper in the Tools-> Options-> Debugger-> Locales and Expressions menu
  • Stop when qWarning() is called and Stop when qFatal() is called
0
source

Source: https://habr.com/ru/post/1501800/


All Articles