Debugging Helpers not working in Qt Creator 2.2 on Slackware Linux
-
The status of debug helpers is: "Not Needed"
Debug helpers are enabled in Debug settings.
In debug mode I can not see values of QObjects e.g. QString.
I have appended the most recent debug log messages at the end.
Full debug log can be downloaded here: http://www.box.net/shared/8eo7f8elckI am new at this so please ask if I should provide anything else.
Thanks for any help.My Setup:
root@SA:/# uname -a
Linux SA 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 x86_64 Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz GenuineIntel GNU/LinuxRecent Debug Log:
<441-stack-select-frame 0
<442-stack-list-arguments 2 0 0
<443-stack-list-locals 2440^done,threads=[{id="1",target-id="Thread 0x7ffff7fc4780 (LWP 2542)",frame={level="0",addr="0x0000000000404e09",func="ImageViewer::open",args=[{name="this",value="0x7fffffffdf60"}],file="../SeedScanner/imageviewer.cpp",fullname="/home/SeedScan/SeedScanner/imageviewer.cpp",line="28"},state="stopped",core="0"}],current-thread-id="1"
441^done
442^done,stack-args=[frame={level="0",args=[{name="this",type="ImageViewer * const",value="0x7fffffffdf60"}]}]
443^done,locals=[{name="fileName",type="QString"}]
<444-var-delete "local.fileName"
<445-var-create "local.fileName" * "fileName"
444^error,msg="Variable object not found"
445^done,name="local.fileName",numchild="2",value="{...}",type="QString",thread-id="1",has_more="0"
<446-var-evaluate-expression "local.fileName"
446^done,value="{...}"
<Rebuild Watchmodel 31>
sFinished retrieving data
<447-var-delete "tooltip.5146696c654469616c6f67"
<448-var-create "tooltip.5146696c654469616c6f67" * "QFileDialog"
447^error,msg="Variable object not found"
448^error,msg="mi_cmd_var_create: unable to create variable object"
<Rebuild Watchmodel 32>
sFinished retrieving data -
OK! I have found some more information. I noticed that Qt Creator uses the default version of gdb that came with Slackware distribution. It is gdb version 7.2 but it does not support python because I get error "Python scripting is not supported in this copy of GDB." when I execute "python print 23".
I located the gdb that came with QtCreator in "/opt/QtSDK/pythongdb/" if I run this version of gdb from command line I get python working correctly with it.
I have tried everything but if I rename gdb in "/usr/bin/gdb" then I get error in QtCreator "The gdb process failed to start. Either the invoke program gdb is missing or you may have isufficient permissions to invoke the program. No such file or directory"
Now my question is how I set Qt Creator to use the correct version of gdb in "/opt/QtSDK/pythongdb/gdb" ??? I can not simply replace the gdb file because then it fails to locate correct python libraries. I have also tried updating environment variable PATH and I have also tried setting the gdb startup script in Tools->Options->Debugger->GDB but I get the same error and QtCreator can not locate the gdb.
Thanks for any help regarding this issue.
-
The debugger is picked up via the path: The first "gdb" found is used by default.
You can also change the debugger via Tools->Options->Tool chains. You can not edit the autodetected tool chains directly, but you can clone the tool chain and update the cloned copy. Make sure to use to check the tool chain used in the project afterwards.
-
I tried updating the path env. variable, It worked on command line but Qt Creator can not detect it even if I update the PATH variable in Project settings in Qt Creator.
So I tried your second suggestion by cloning a tool chain GCC 64 bit, I selected the correct gdb for this tool chain clone. I also updated project settings and selected "Clone of GCC (x86 64bit)" Now as soon as I run the debugger I get another error ["Path to my project/myexe": not in executable format: File format not recognized. ] Also in this case I can run the the program without any problems if I don't launch it from debugger. What could be wrong now ???
Thanks for help!
-
The autodetection is run exactly once right when starting Qt Creator. Changing the path afterwards (or in the project settings) does not effect the autodetection in any way.
-
OK! but What about this second issue. It seems this version of gdb is not working with my executable ?
I am getting this error: [“Path to my project/myexe”: not in executable format: File format not recognized. ]I have tried running the debugger manually and specifying my executable but I still get this ("not in executable format: File format not recognized.") error from gdb.
-
Sorry, I am no expert on the debugger stuff. No idea what is going wrong there:-/
-
[quote author="Duck" date="1306520620"]You can override the gdb location by using the environment variable QTC_DEBUGGER_PATH=/path/to/your/gdb [/quote]
Thanks for the tip but problem now is that the gdb that came with QtCreator 2.2 is not working with my executables and it is giving me error: "not in executable format: File format not recognized."
I have searched on google and I have learned that this error may occur if 32 bit version of gdb is used with 64 bit excutables but I have checked that the gdb that came with QtCreator is infact 64 bit, So I am totally clueless about how to resolve this problem ????
-
[quote author="FrazAli" date="1306491722"]
My Setup:root@SA:/# uname -a
Linux SA 2.6.37.6 #3 SMP Sat Apr 9 22:49:32 CDT 2011 ×86_64 Intel® Core™ i5-2500 CPU @ 3.30GHz GenuineIntel GNU/Linux
[/quote]I have 64 bit Slacware Linux OS. I downloaded 64 bit version of Qt Creator with Qt SDK (approx 700 MB) from here http://get.qt.nokia.com/qtsdk/Qt_SDK_Lin64_offline_v1_1_1_en.run
The gdb exe came with the package and it was in /QtSDK/pythongdb/gdb and I think it is 64 bit version according to the info. displayed if I run it from command line.
The target platform is also 64 bit. The confusing thing is that the gdb that came with my Salckware distribution supports my executables but it lacks python scripting which I believe is required to enable Debug helpers in Qt Creator.
-
The debug Log can be downloaded here: http://www.box.net/shared/8eo7f8elck
Output of "file myexe":
@root@SA:/home/SeedScan/SeedScanner# file SeedScanner
SeedScanner: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), not stripped@Output of "gdb exe"
@root@SA:/home/SeedScan/SeedScanner# file /opt/QtSDK/pythongdb/gdb
/opt/QtSDK/pythongdb/gdb: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), stripped@Output of "ldd myexe":
@root@SA:/home/SeedScan/SeedScanner# ldd SeedScanner
linux-vdso.so.1 => (0x00007fff1d93d000) libQtGui.so.4 => /opt/QtSDK/Desktop/Qt/473/gcc/lib/libQtGui.so.4 (0x00007ff29f191000) libQtCore.so.4 => /opt/QtSDK/Desktop/Qt/473/gcc/lib/libQtCore.so.4 (0x00007ff29ecbb000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff29ea74000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007ff29e770000) libm.so.6 => /lib64/libm.so.6 (0x00007ff29e4ea000) libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007ff29e2d5000) libc.so.6 => /lib64/libc.so.6 (0x00007ff29df2f000) libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007ff29dd2a000) librt.so.1 => /lib64/librt.so.1 (0x00007ff29db21000) libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007ff29d80a000) libpng12.so.0 => /usr/lib64/libpng12.so.0 (0x00007ff29d5e3000) libz.so.1 => /usr/lib64/libz.so.1 (0x00007ff29d3cd000) libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007ff29d145000) libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007ff29cef5000) libSM.so.6 => /usr/lib64/libSM.so.6 (0x00007ff29ccee000) libICE.so.6 => /usr/lib64/libICE.so.6 (0x00007ff29cad3000) libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007ff29c8c8000) libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007ff29c694000) libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007ff29c482000) libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007ff29c141000) libdl.so.2 => /lib64/libdl.so.2 (0x00007ff29bf3d000) /lib64/ld-linux-x86-64.so.2 (0x00007ff29ff1f000) libuuid.so.1 => /lib64/libuuid.so.1 (0x00007ff29bd39000) libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007ff29bb1d000) libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007ff29b91a000) libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007ff29b714000) libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007ff29b4eb000)@
Also if I execute this gdb with my exe from command line I get the same error:
@root@SA:/home/SeedScan/SeedScanner# /opt/QtSDK/pythongdb/gdb SeedScanner
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=arm-none-linux-gnueabi".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
"/home/SeedScan/SeedScanner/SeedScanner": not in executable format: File format not recognized@I appreciate your help :)
-
From the log: 'This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=arm-none-linux-gnueabi"'
This gdb build is meant to debug executables that are build for embedded Linux on ARM processor. Your binary is a "normal" desktop build for Intel(-ish) processors.
You need to use a gdb build that's with a target matching your binary.
-
Well I believe there is no easy solution for this. In order to get gdb with python support I have to build it from source and it requires python-devel package. Slackware currently supports python 2.6.6 and I suspect building gdb will further complicate things for me if I do not use correct version of python to build it. So I have decided to install a previous version of Qt Creator that does not require python enabled gdb. I'll wait until a solution for this problem appears. Thanks for all the help. You guys are amazing :)
-
Just wanted to update that I installed Qt Creator 2.1.0. by building it from source according to: http://slackbuilds.org/repository/13.37/development/qt-creator/
I had to rebuild debugging helpers in project settings. Now gdb is working fine and I can see Qobjects such as Qstring values in Debug mode. I hope it helps someone in similar situation.