GDB debugger Type not recognized on Debian
-
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 ! -
@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. -
@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)?
-
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.
-
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.
-
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 !
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.
-
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.
-
-
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 !
-
@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. -
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 !
-