Qt creator debug mode is really slow
Asked Answered
W

5

7

Similar questions are here and here

My case is I'm using Qt 5.5 with Qt creator 3.5 on a Windows 10 machine. It takes about 10 to 15 seconds to start debugging my project. My project uses quick control. I'm not sure if that is related.

In my Qt creator I can't find CDB debugger. Searching "cdb.exe" in my root disk results in nothing.

My current kit is

  • Debugger: GNU gdb 7.8 for MinGW 4.9.2 32bit
  • Compiler: MinGW 4.9.2 32bit
  • Qt version: Qt 5.5.1 MinGW 32bit

Edit: CPU: Core i7 3.3GHz Ram: 32GB SSD

Is there any workaround or do I need to install CDB and configure it in Qt creator?

Woken answered 22/1, 2016 at 22:42 Comment(9)
A quick look at the Qt debug DLLs reveals their size is in excess of 1 gigabyte. Hooking up all that code into the debugging environment takes time. For me it takes 5-6 seconds to start, afterwards it runs ok.Reformation
Did not realize it was that big.Woken
10-15 seconds without having it running it a debugger isn't usual though.Petersham
@FrankOsterfeld - what? An average mechanical HDD reads at about 100 mb/sec, so it would take 10 seconds to read the debug libraries alone. It is not clear what kind of system the OP has, how fast CPU, how much RAM, there might be paging involved. I got from 10 seconds to 5 by moving my toolchain from a 10k raptor to an SSD. Maybe you are used to a debugger that keeps data in ram in between debug sessions, but gdb apparently loads everything every time.Reformation
@ddriver: I meant “without running it in a debugger”, i.e. just running a debug build outside the debugger. That’s how I understood Jerry’s question, now reading it again it could also be that the question is about running it in gdb.Petersham
Yes it is a little vague, it is not exactly clear whether the OP is merely running a debug build or debugging.Reformation
@Woken - you should clarify that. Also, system specs - cpu, ram and disk won't hurt.Reformation
Thanks guys, I have updated my questionWoken
"gdb apparently loads everything every time" Will switch to CDB improve this?Woken
I
1

CDB is part of Windows SDK. You can get either Windows SDK 8.1 or Windows SDK 10 for your system. Then follow Qt documentation: Setting Up Debugger.

Ideomotor answered 23/1, 2016 at 5:47 Comment(3)
Thanks, I will give it a tryWoken
I tried to use the Microsoft Visual C++ compiler 14.0(x86) and the cdb from Windows SDK 10. It gives me a link error as below. "LNK1104: cannot open file 'C:\Qt\5.5\mingw492_32\lib\qtmaind.lib'" It does say my Qt version is Qt 5.5.1 MinGW 32bit. Do I need to reinstall the whole Qt or compile it from source? Mine is the enterprise trial version.Woken
You can run Qt Maintenance Tool and then download any Qt/Compiler prebuilt package you need. Then you should select menu Projects and choose that Qt/Compiler kit for your project.Ideomotor
C
4

When updating to Qt 5.6.1 in a Windows 10 (Redstone) with Visual Studio Professional 2015 (Update 3), I also faced an epic slowness with cdb.exe. The process (cdb.exe) would just hang Qt Creator for 30+ seconds after the build ended and before the debugging started.

If others face such slowness, and had no luck caching the symbols, I would like to share that by downloading the Windows 8.1 SDK, installing only the Debugging Tools and re-opening Qt Creator, I was able to update the kit to the auto-detect 8.1 debugger (cdb.exe) and everything started working properly again.

Chariot answered 7/9, 2016 at 18:48 Comment(1)
I swapped from 10 to 8.1. At first it seemed to be faster, but now it is again slow as it was before. Maybe the SDK version has nothing to do with it.Nairn
M
3

I have been experiencing very slow debugging with Windows 10 Professional, Qt 5.5.1 and Qt Creator 3.5.1, using CDB. It was pretty much unusable. I discovered that the windows debug symbols take a very long time to load. When I go directly to the windows symbol server, it takes minutes. So, I downloaded the windows symbols from here: Windows Symbol Packages

I installed the symbols then setup the CDB symbol path in Qt Creator. It's very snappy now.

Mating answered 2/9, 2016 at 12:30 Comment(0)
I
1

CDB is part of Windows SDK. You can get either Windows SDK 8.1 or Windows SDK 10 for your system. Then follow Qt documentation: Setting Up Debugger.

Ideomotor answered 23/1, 2016 at 5:47 Comment(3)
Thanks, I will give it a tryWoken
I tried to use the Microsoft Visual C++ compiler 14.0(x86) and the cdb from Windows SDK 10. It gives me a link error as below. "LNK1104: cannot open file 'C:\Qt\5.5\mingw492_32\lib\qtmaind.lib'" It does say my Qt version is Qt 5.5.1 MinGW 32bit. Do I need to reinstall the whole Qt or compile it from source? Mine is the enterprise trial version.Woken
You can run Qt Maintenance Tool and then download any Qt/Compiler prebuilt package you need. Then you should select menu Projects and choose that Qt/Compiler kit for your project.Ideomotor
H
1

for CDB Debugger Go to:

Tools >> Options >> Debugger >> CDB Paths

check Symbol Paths and remove server path (http://msdl.microsoft.com/download/symbols)

Horseshit answered 12/6, 2018 at 7:55 Comment(0)
V
0

I had a horribly slow compilation process with the "straight out of the box" Qt 5.7 with Windows 10.

I fixed that (compilation times divided by 10) by swapping the MinGW toolchain with the Windows one

In Qt Creator, in the Tools/Options/Build & Run, you will need to make sure that the three tabs Qt Versions, Compilers and Debuggers are all set up

Qt Versions need the MSVC2015, that you can get with MaintenanceTools.exe at the root of your Qt installation (C:\Qt by default)

Compiler needs MSVC C++ 14.0, which I think you get with Visual Studio 2015 (it was already there for me)

Debugger needs CDB, which you get with Windows Kit 10

I installed everything, was sure to add a new kit to my project (Desktop MSVC2015) and poof! Compilation times were gone

Veranda answered 15/9, 2016 at 7:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.