Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. GDB debugger Type not recognized on Debian
QtWS25 Last Chance

GDB debugger Type not recognized on Debian

Scheduled Pinned Locked Moved Solved Installation and Deployment
13 Posts 4 Posters 1.5k Views
  • 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
    CClement
    wrote on last edited by
    #1

    Hello everyone !
    I am asking for help today because after many days of scrolling Google I can not succeed to make gdb working with QtCreator.
    I have QtCreator 9.0.0, Qt 6.4.1 installed on Debian 11. Build is working well, and my app launch properly.

    I have installed gdb from official debian repos. The binary is located in /usr/bin/gdb, version is GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
    I have to add it manually in the debugger section of QtCreator because it is not auto detected. But the type is not recognized, so the debugging session does not start.

    I tried to manually build from source. Since that, it is well auto detected, but something was wrong with python support and QtCreator does not want to start debug. the binary is located in /usr/local/gdb.
    That was hard, but I finally succeeded to build gdb with python support (--version gives : GNU gdb (GDB) 12.1 ). Since then, gdb is not auto detected anymore and the type is not recognized when I add it manually.

    I don't know what to do know to make it works.
    Does anybody know how to fix my installation ?
    Thanks !

    1 Reply Last reply
    0
    • C CClement

      Nobody ? 😢

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

      @CClement Simply start Qt Creator normally without qtcreator.sh and you'll have gdb working fine for the desktop.

      . /opt/yogurt/AM335x-PD15.1.1/environment-setup-cortexa8t2hf-vfp-neon-phytec-linux-gnueabi
      

      Adds things to the environment which gets picked up by the desktop gdb and things break. Stop doing that.

      If you want to do embedded work, just use CMake with a better toolchain.
      See Standalone Boot2Qt / Yocto SDK CMake toolchain for more information.

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

        @CClement said in GDB debugger Type not recognized on Debian:

        GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git

        When you start the /usr/bin/gdb manually on a console, can you execute python commands at the (gdb) prompt? Something like "python print(1+2)" (without the quotes)?

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

          Yes I can execute it ! And it says "3"
          It works with the version manually built (12.1) in /usr/local/bin/gdb too.

          1 Reply Last reply
          0
          • JoeCFDJ Offline
            JoeCFDJ Offline
            JoeCFD
            wrote on last edited by
            #4

            sudo apt-get purge gdb to delete the old one. Add the path(dir) of gdb you installed to PATH and it will work.

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

              Purge done, the binary in /usr/bin/gdb doesn't exist anymore.
              When I type "gdb" I have the version 12.1 showing in the prompt.
              My path is : /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

              And Qt still doesn't want to detect gdb, or recognize it in manual mode.

              JoeCFDJ 1 Reply Last reply
              0
              • C CClement

                Purge done, the binary in /usr/bin/gdb doesn't exist anymore.
                When I type "gdb" I have the version 12.1 showing in the prompt.
                My path is : /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

                And Qt still doesn't want to detect gdb, or recognize it in manual mode.

                JoeCFDJ Offline
                JoeCFDJ Offline
                JoeCFD
                wrote on last edited by JoeCFD
                #6

                @CClement in Qt creators:

                1. Tools->Options->Kits->Debuggers to check if debug is set. If not, you click add button to add gdb with path.

                It is simpler for you to install gdb to /usr/bin after the old gdb is purged.

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  CClement
                  wrote on last edited by
                  #7

                  Hello Joe,
                  I don't know if it is relevant, but I don't have any "Options" inside Tools menu.
                  Otherwise I can access to Kits→Debuggers in "Edit→Preferences".

                  The debugger is not recognized if I add it manually ! Sans titre.png

                  I don't know the correct way to install my build of gdb in usr/bin.
                  I tried to mv the binary in the other directory, Qt doesn't detect it either that way.

                  When the binary of GDB from my build is in /usr/local/bin, typing "gdb" in a shell show the prompt correctly.

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

                    There should be no need to have it in /usr/bin, /usr/local/bin/gdb should be just fine. They type and version should be parsed fro /usr/local/bingdb --version output in your case, and the "GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git" version string is good. I don't know what breaks for you.

                    You could try setting QTC_USE_QPROCESS=1 and/or QT_LOGGING_RULES="qtc.utils.qtcprocess=true" in the environment you start Qt Creator in and see whether in makes a difference and/or gives a hint what goes wrong.

                    1 Reply Last reply
                    1
                    • JoeCFDJ Offline
                      JoeCFDJ Offline
                      JoeCFD
                      wrote on last edited by
                      #9

                      https://forum.qt.io/topic/126234/gnu-gdb-debugger-type-not-recognized-problem/4

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        CClement
                        wrote on last edited by CClement
                        #10

                        Hello everybody !
                        Sorry for the late reply, my computer was in repair service for too many weeks ><

                        @andr have got a right idea, here the output related to GDB :

                        qtc.utils.qtcprocess: Process 1 starting (blocking without event loop): /usr/local/bin/gdb -version
                        qtc.utils.qtcprocess: Process 1 finished: result=1, ex=1, 0 bytes stdout: "", 1236 bytes stderr: 
                            "Python path configuration:
                            PYTHONHOME = '/opt/yogurt/AM335x-PD15.1.1/sysroots/x86_64-yogurtsdk-linux/usr'
                            PYTHONPATH = (not set)
                            program name = '/usr/bin/python'
                            isolated = 0
                            environment = 1
                            user site = 1
                            import site = 1
                            sys._base_executable = '/usr/bin/python'
                            sys.base_prefix = '/opt/yogurt/AM335x-PD15.1.1/sysroots/x86_64-yogurtsdk-linux/usr'
                            sys.base_exec_prefix = '/opt/yogurt/AM335x-PD15.1.1/sysroots/x86_64-yogurtsdk-linux/usr'
                            sys.platlibdir = 'lib'
                            sys.executable = '/usr/bin/python'
                            sys.prefix = '/opt/yogurt/AM335x-PD15.1.1/sysroots/x86_64-yogurtsdk-linux/usr'
                            sys.exec_prefix = '/opt/yogurt/AM335x-PD15.1.1/sysroots/x86_64-yogurtsdk-linux/usr'
                            sys.path = [
                            	'/opt/yogurt/AM335x-PD15.1.1/sysroots/x86_64-yogurtsdk-linux/usr/lib/python39.zip',
                            	'/opt/yogurt/AM335x-PD15.1.1/sysroots/x86_64-yogurtsdk-linux/usr/lib/python3.9',
                            	'/opt/yogurt/AM335x-PD15.1.1/sysroots/x86_64-yogurtsdk-linux/usr/lib/python3.9/lib-dynload',
                            ]
                            Fatal Python error: init_fs"
                        

                        It' seems to be the right moment for me to tell you that i'm using a special environment to crossbuild for a custom embedded target. Qt Version is 5.3 for this.
                        At the beginning of the script (qtcreator.sh) launching QtCreator, there is a magical call to something... :
                        . /opt/yogurt/AM335x-PD15.1.1/environment-setup-cortexa8t2hf-vfp-neon-phytec-linux-gnueabi

                        Just to be clear, I don't use GDB for embedded projects, I need it for desktop softwares with Qt 6.4 only.
                        I tried to launch QtCreator directly without the script and GDB is auto-detected !
                        I don't know how to use all those informations to fix my issue.

                        Do you know how to make everything working together ?
                        I hope you will see where the issue is ;)

                        Have a nice day !

                        1 Reply Last reply
                        0
                        • C Offline
                          C Offline
                          CClement
                          wrote on last edited by
                          #11

                          Nobody ? 😢

                          cristian-adamC 1 Reply Last reply
                          0
                          • C CClement

                            Nobody ? 😢

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

                            @CClement Simply start Qt Creator normally without qtcreator.sh and you'll have gdb working fine for the desktop.

                            . /opt/yogurt/AM335x-PD15.1.1/environment-setup-cortexa8t2hf-vfp-neon-phytec-linux-gnueabi
                            

                            Adds things to the environment which gets picked up by the desktop gdb and things break. Stop doing that.

                            If you want to do embedded work, just use CMake with a better toolchain.
                            See Standalone Boot2Qt / Yocto SDK CMake toolchain for more information.

                            1 Reply Last reply
                            2
                            • C Offline
                              C Offline
                              CClement
                              wrote on last edited by
                              #13

                              Hello !

                              I will just open another instance of Qtcreator directly when I need gdb.
                              I am new to that many years old embedded project. Unfortunately I can't spend weeks to learn, understand, try, test and maybe fail to change the way everything works today.

                              thank you all for your support !

                              1 Reply Last reply
                              0
                              • C CClement 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