Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt 5.1.0 on Windows using minGW 4.8 taking a really long time to debug

I have downloaded and installed the Qt 5.1.0 for Windows 32-bit (MinGW 4.8) from the qt-project downloads page. I have run the installer, and am able to compile and run applications using these libraries and the minGW 4.8 32-bit toolhchain.

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

In case this helps, I get lots of output when debugging like this:

Temporarily disabling breakpoints for unloaded shared library "C:\Qt\Qt5.1.0\5.1.0\mingw48_32\plugins\somefolder\somelib.dll"
like image 583
oggmonster Avatar asked Jan 12 '23 09:01

oggmonster


2 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 QObject classes, the slower becomes awfully slow.

By disabling debugging helper, you improve it, but then you miss a lot of precious information in the Local Variables and Expressions. For instance, you cannot display nicely the contents of QLists, etc...

It seems that either:

  • buidling gdb from the CVS or
  • using an older gdb (7.4.1)

solves the issue.

like image 139
galinette Avatar answered Jan 14 '23 23:01

galinette


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

Or you can switch to using MSVC compiler on Windows. That also switches your debugging to CDB instead of GDB and bypasses the problem entirely. You can just install MSVC compiler and plug it into QtCreator instead of mingw if you don't like MS IDE.

P.S. This also gives you readable core dumps which is a godsend.

like image 29
Zeks Avatar answered Jan 14 '23 21:01

Zeks