Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Why is GDB so slow on Windows?
Forum Updated to NodeBB v4.3 + New Features

Why is GDB so slow on Windows?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
14 Posts 3 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • JonBJ JonB

    @deisik
    Obviously it ought not take this long, but what do you have to show in locals? I assume it does not happen if e.g. you just look at an empty main() function.

    deisikD Offline
    deisikD Offline
    deisik
    wrote on last edited by deisik
    #3

    Obviously it ought not take this long, but what do you have to show in locals? I assume it does not happen if e.g. you just look at an empty main() function.

    Whatever. Even simple classes are taking like 20-30 seconds

    The point is GDB is close to instant on Linux with the same codebase

    I set _NO_DEBUG_HEAP = 1 and it didn't help

    JonBJ 1 Reply Last reply
    0
    • deisikD deisik

      Obviously it ought not take this long, but what do you have to show in locals? I assume it does not happen if e.g. you just look at an empty main() function.

      Whatever. Even simple classes are taking like 20-30 seconds

      The point is GDB is close to instant on Linux with the same codebase

      I set _NO_DEBUG_HEAP = 1 and it didn't help

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #4

      @deisik
      I don't know. I don't use Windows gdb. Of course it's instantaneously fast under Linux.

      Try obvious stuff:

      • You're using command-line gdb in both, not a UI, right?
      • You're not using/sitting in OneDrive, like I have seen some people do, are you?
      • No "slow" devices for wherever it might be looking for source code, including system stuff, like, say, network/Internet?
      • During the "5 minutes", run up Task Manager, is anything happening there? Is gdb using CPU time or not?
      • Go into Resource Monitor. Look at the Disk activity. If it's doing anything check the file paths it's accessing.
      deisikD 1 Reply Last reply
      0
      • deisikD deisik has marked this topic as solved on
      • deisikD deisik has marked this topic as unsolved on
      • JonBJ JonB

        @deisik
        I don't know. I don't use Windows gdb. Of course it's instantaneously fast under Linux.

        Try obvious stuff:

        • You're using command-line gdb in both, not a UI, right?
        • You're not using/sitting in OneDrive, like I have seen some people do, are you?
        • No "slow" devices for wherever it might be looking for source code, including system stuff, like, say, network/Internet?
        • During the "5 minutes", run up Task Manager, is anything happening there? Is gdb using CPU time or not?
        • Go into Resource Monitor. Look at the Disk activity. If it's doing anything check the file paths it's accessing.
        deisikD Offline
        deisikD Offline
        deisik
        wrote on last edited by deisik
        #5

        Try obvious stuff:

        • You're using command-line gdb in both, not a UI, right?
        • You're not using/sitting in OneDrive, like I have seen some people do, are you?
        • No "slow" devices for wherever it might be looking for source code, including system stuff, like, say, network/Internet?
        • During the "5 minutes", run up Task Manager, is anything happening there? Is gdb using CPU time or not?
        • Go into Resource Monitor. Look at the Disk activity. If it's doing anything check the file paths it's accessing.

        I have 2 machines and it is absolutely the same on both of them. The application itself runs pretty fast so it is not a resource issue

        It is all local, CPU is like 70% idle, no disk or network activity at all. GDB takes around 1Gb of memory, with 78% used all in all, so it's not memory related

        1 Reply Last reply
        0
        • cristian-adamC Offline
          cristian-adamC Offline
          cristian-adam
          wrote on last edited by
          #6

          Not that it matters that much, but for protocol, which version of gdb are you using?

          Do you have many breakpoints?

          deisikD 1 Reply Last reply
          0
          • cristian-adamC cristian-adam

            Not that it matters that much, but for protocol, which version of gdb are you using?

            Do you have many breakpoints?

            deisikD Offline
            deisikD Offline
            deisik
            wrote on last edited by deisik
            #7

            @cristian-adam

            Mostly the one equipped with QtCreator. I tried whatever was installed before, no luck either. Today I installed QtCreator 11.0.0-rc1 (10.0.84), it didn't change anything

            One breakpoint is enough to make GDB that slow

            This issue seems to be with Windows, not so much GDB as such (I'm using Windows 10)

            cristian-adamC 1 Reply Last reply
            0
            • deisikD deisik

              @cristian-adam

              Mostly the one equipped with QtCreator. I tried whatever was installed before, no luck either. Today I installed QtCreator 11.0.0-rc1 (10.0.84), it didn't change anything

              One breakpoint is enough to make GDB that slow

              This issue seems to be with Windows, not so much GDB as such (I'm using Windows 10)

              cristian-adamC Offline
              cristian-adamC Offline
              cristian-adam
              wrote on last edited by
              #8

              Okay, I assume gdb 11.2.0 from c:\Qt\Tools\mingw1120_64\bin\gdb.exe.

              gdb on Windows is known to be slow, and I don't think the developers are very keen on fixing stuff for Windows.

              If I remember correctly gdb on Linux is using multi-threaded code, which is not enabled on Windows.

              You could try either gdb on Linux with WSL2, or lldb.exe from https://github.com/mstorsjo/llvm-mingw.

              cristian-adamC deisikD 2 Replies Last reply
              1
              • cristian-adamC cristian-adam

                Okay, I assume gdb 11.2.0 from c:\Qt\Tools\mingw1120_64\bin\gdb.exe.

                gdb on Windows is known to be slow, and I don't think the developers are very keen on fixing stuff for Windows.

                If I remember correctly gdb on Linux is using multi-threaded code, which is not enabled on Windows.

                You could try either gdb on Linux with WSL2, or lldb.exe from https://github.com/mstorsjo/llvm-mingw.

                cristian-adamC Offline
                cristian-adamC Offline
                cristian-adam
                wrote on last edited by
                #9

                https://www.reddit.com/r/cpp/comments/u8awwt/faster_gdb_startup/ is the thread with the information about multi threading.

                1 Reply Last reply
                1
                • cristian-adamC cristian-adam

                  Okay, I assume gdb 11.2.0 from c:\Qt\Tools\mingw1120_64\bin\gdb.exe.

                  gdb on Windows is known to be slow, and I don't think the developers are very keen on fixing stuff for Windows.

                  If I remember correctly gdb on Linux is using multi-threaded code, which is not enabled on Windows.

                  You could try either gdb on Linux with WSL2, or lldb.exe from https://github.com/mstorsjo/llvm-mingw.

                  deisikD Offline
                  deisikD Offline
                  deisik
                  wrote on last edited by deisik
                  #10

                  @cristian-adam
                  or lldb.exe

                  I tried that. lldb crashes on start-up

                  CALL: SETUP ENGINE
                  STARTING LLDB: 
                  ERROR: Lldb stderr: qtcreator_ctrlc_stub: Command line failed: ""
                  
                  deisikD 1 Reply Last reply
                  0
                  • deisikD deisik

                    @cristian-adam
                    or lldb.exe

                    I tried that. lldb crashes on start-up

                    CALL: SETUP ENGINE
                    STARTING LLDB: 
                    ERROR: Lldb stderr: qtcreator_ctrlc_stub: Command line failed: ""
                    
                    deisikD Offline
                    deisikD Offline
                    deisik
                    wrote on last edited by deisik
                    #11

                    In fact, lldb wasn't in the path, so I corrected it and now lldb (Python?) complains:

                    ERROR: Lldb stderr: ValueError: compile(): unrecognised flags
                    
                    cristian-adamC 1 Reply Last reply
                    0
                    • deisikD deisik

                      In fact, lldb wasn't in the path, so I corrected it and now lldb (Python?) complains:

                      ERROR: Lldb stderr: ValueError: compile(): unrecognised flags
                      
                      cristian-adamC Offline
                      cristian-adamC Offline
                      cristian-adam
                      wrote on last edited by
                      #12

                      At https://bugreports.qt.io/browse/QTBUG-107516 I've posted two videos of Qt Creator 11 built with MinGW 11.2.0 and LLVM-MinGW 16.0.6.

                      • MinGW 11.2.0 - 1 min 14 seconds until this was expanded
                      • LLVM-MinGW 16.0.6 - 34 seconds until this was expanded

                      I had to compile Qt 6.4.3 mysef, I've uploaded my build here. It has debugging information and I think my path was c:/Projects/Qt/repo and I've compiled only the modules needed for Qt Creator.

                      cristian-adamC 1 Reply Last reply
                      3
                      • cristian-adamC cristian-adam

                        At https://bugreports.qt.io/browse/QTBUG-107516 I've posted two videos of Qt Creator 11 built with MinGW 11.2.0 and LLVM-MinGW 16.0.6.

                        • MinGW 11.2.0 - 1 min 14 seconds until this was expanded
                        • LLVM-MinGW 16.0.6 - 34 seconds until this was expanded

                        I had to compile Qt 6.4.3 mysef, I've uploaded my build here. It has debugging information and I think my path was c:/Projects/Qt/repo and I've compiled only the modules needed for Qt Creator.

                        cristian-adamC Offline
                        cristian-adamC Offline
                        cristian-adam
                        wrote on last edited by
                        #13

                        If all goes well at https://lists.qt-project.org/pipermail/development/2023-July/044172.html we could migrate to llvm-mingw and lldb!

                        gdb can't be slow anymore, when there is no more gdb 🙂

                        1 Reply Last reply
                        2
                        • deisikD Offline
                          deisikD Offline
                          deisik
                          wrote on last edited by deisik
                          #14

                          I switched to MSVC and now debugging is great again (with cdb)

                          1 Reply Last reply
                          3
                          • deisikD deisik has marked this topic as solved on

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved