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. Qt creator not giving me information about variables while debugging
Servers for Qt installer are currently down

Qt creator not giving me information about variables while debugging

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
12 Posts 5 Posters 1.7k Views 2 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.
  • C Offline
    C Offline
    Creaperdown
    wrote on last edited by
    #1

    Hey, I am running into some problems with debugging with Qt creator recently (using QtCreator 8.0.1). When hitting a breakpoint in a function, and stepping through it, the local stack variables disappear from the view (top right window in the video) and I cant inspect them anymore afterwards, also some statements are skipped while stepping through my code:
    https://streamable.com/7ae63k

    Does anyone have an idea on how I could be able to fix this?
    Thanks in advance

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

      It looks like you are on Linux using GDB as a debugger. Which GDB version are you using?

      The "Debugger Log" could have some information that could help:

      alt text

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Creaperdown
        wrote on last edited by
        #3

        Thanks for the reply, I am using gdb 12.1 on linux (KDE Manjaro).

        What information specifically should I be looking for? The output is quiet much

        1 Reply Last reply
        0
        • andrA Offline
          andrA Offline
          andr
          wrote on last edited by
          #4

          You don't seem to have debug info for Qt available, so not being able to step into the QFile constructor is expected.

          On a general note, be careful on what you have in your "Evaluated Expressions". This is executed(!) in the context of the current frame on each step, so destructive function calls or for performance reasons invalid code should be avoided.

          1 Reply Last reply
          1
          • C Offline
            C Offline
            Creaperdown
            wrote on last edited by
            #5

            Why wouldn't I have debug symbols, if I am running it in debug mode, and my compile options are:

            target_compile_options(adapters PRIVATE "$<$<CONFIG:DEBUG>:-Wall;-Wextra;-g3;-Og>")
            target_compile_options(adapters PRIVATE "$<$<CONFIG:RELEASE>:-O3>")
            

            Also, this still doesn't explain why I cant see my stack variables and why I cant query their values

            JonBJ 1 Reply Last reply
            0
            • C Creaperdown

              Why wouldn't I have debug symbols, if I am running it in debug mode, and my compile options are:

              target_compile_options(adapters PRIVATE "$<$<CONFIG:DEBUG>:-Wall;-Wextra;-g3;-Og>")
              target_compile_options(adapters PRIVATE "$<$<CONFIG:RELEASE>:-O3>")
              

              Also, this still doesn't explain why I cant see my stack variables and why I cant query their values

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

              @Creaperdown
              The options are only for compiling your own code. Unless you have compiled Qt itself for debug or got its symbols from somewhere, and the source code is present, you are not going to see source inside a Qt function. That should be a separate issue from your own code.

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

                How did you get Qt installed?

                For Qt SDK you need to install the Qt Debugging Information Files component, see below:

                alt text

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  Creaperdown
                  wrote on last edited by
                  #8

                  I see, this probably is the problem here. Since I want to use Qt 5.15.5, but the Qt Installer doesnt offer my a way to download it, I am using my desktops automatically provided Qt, which probably doesnt have the debug information

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Hi,

                    Qt 5.15.3 and onward when released are only in source format so you have to build them yourself.

                    As for your distribution provided Qt, there are usually separated packages with debug informations.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    C 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      Hi,

                      Qt 5.15.3 and onward when released are only in source format so you have to build them yourself.

                      As for your distribution provided Qt, there are usually separated packages with debug informations.

                      C Offline
                      C Offline
                      Creaperdown
                      wrote on last edited by
                      #10

                      @SGaist How exactly would I add these packages to work with QtCreator?

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

                        It looks like you are using Manjaro Linux. As it turns out Manjaro doesn't build packages with Debug symbols,
                        that is if I interpret https://forum.manjaro.org/t/debug-symbols-on-manjaro/61157 correctly.

                        You will have to install Qt via https://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run and select the Qt Debug Information Files at installation time.

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

                          It looks like you are using Manjaro Linux. As it turns out Manjaro doesn't build packages with Debug symbols,
                          that is if I interpret https://forum.manjaro.org/t/debug-symbols-on-manjaro/61157 correctly.

                          You will have to install Qt via https://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run and select the Qt Debug Information Files at installation time.

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

                          @cristian-adam said in Qt creator not giving me information about variables while debugging:

                          It looks like you are using Manjaro Linux. As it turns out Manjaro doesn't build packages with Debug symbols,
                          that is if I interpret https://forum.manjaro.org/t/debug-symbols-on-manjaro/61157 correctly.

                          Actually if we have a look at https://wiki.archlinux.org/title/Debugging/Getting_traces there is advice how to install debug packages:

                          # pacman -U https://geo.mirror.pkgbuild.com/extra-debug/os/x86_64/qt6-base-debug-6.4.0-1-x86_64.pkg.tar.zst
                          
                          1 Reply Last reply
                          2

                          • Login

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