Hello, It's me again with my Qt Creator/GDB issues... I've set the GDB sysroot and debug is now working but there is an issue evaluating Qt objects. For example I don't see QString values in the debug window. You can see below the interesting parts of my GDB debug log (commented) . The sysroot is set to /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/ {...} >&"source /home/gdrz9888/dev/gdbstartupfile\n" t10:40:25.461 >212^done tResponse time: source /home/gdrz9888/dev/gdbstartupfile: 0.302 s t10:40:25.461 t10:40:25.461 >&"set environment LD_PRELOAD /home/gdrz9888/qtsdk-2010.01/qt/qtc-debugging-helper/libgdbmacros.so\n" t10:40:25.461 >213^done tResponse time: set environment LD_PRELOAD /home/gdrz9888/qtsdk-2010.01/qt/qtc-debugging-helper/libgdbmacros.so: 0.302 s t10:40:25.461 t10:40:25.461 >&"set architecture i386\n" t10:40:25.461 >&"Undefined item: \"i386\".\n" t10:40:25.461 >214^error,msg="Undefined item: \"i386\"." tResponse time: set architecture i386: 0.299 s >>>>>>>>>> I don't know why this variable is set to this value. Perhaps according to i386 architecture ?! It's pointing to my x86 Qt library but I think It must point to my device Qt library. {...} >~"0x40000800 in ?? () from /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/lib/ld-linux.so.3\n" t10:40:25.583 >216^done tResponse time: target remote 192.168.2.202:2345: 0.122 s dState changed from InferiorStarting(6) to InferiorStopped(13). dINFERIOR STARTED sAttaché au processus inférieur. <217set substitute-path /var/tmp/qt-x11-src-4.6.1 /home/gdrz9888/qtsdk-2010.01/qt sDéfinit les points d'arrêts... <218-break-list t10:40:25.585 t10:40:25.626 >&"set substitute-path /var/tmp/qt-x11-src-4.6.1 /home/gdrz9888/qtsdk-2010.01/qt\n" t10:40:25.626 >217^done tResponse time: set substitute-path /var/tmp/qt-x11-src-4.6.1 /home/gdrz9888/qtsdk-2010.01/qt: 0.041 s t10:40:25.626 t10:40:25.626 {...} >220*stopped,reason="breakpoint-hit",bkptno="1",thread-id="1",frame={addr="0x0000a566",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbea05d14"}],file="main.cpp",fullname="/home/gdrz9888/dev/local/KeycodeTester/main.cpp",line="10"} dState changed from InferiorRunning(10) to InferiorStopping(11). dState changed from InferiorStopping(11) to InferiorStopped(13). <221call (void*)qDumpObjectData440(1,221+1,0,0,0,0,0,0) <222p (char*)&qDumpOutBuffer <223p 4 t10:40:27.990 t10:40:28.041 >&"call (void*)qDumpObjectData440(1,221+1,0,0,0,0,0,0)\n" t10:40:28.041 >&"No symbol \"qDumpObjectData440\" in current context.\n" t10:40:28.041 >221^error,msg="No symbol \"qDumpObjectData440\" in current context." tResponse time: call (void*)qDumpObjectData440(1,0.051+1,0,0,0,0,0,0): %2 s t10:40:28.041 t10:40:28.041 >&"p (char*)&qDumpOutBuffer\n" t10:40:28.041 >&"No symbol \"qDumpOutBuffer\" in current context.\n" t10:40:28.041 >222^error,msg="No symbol \"qDumpOutBuffer\" in current context." tResponse time: p (char*)&qDumpOutBuffer: 0.051 s sAssistance au débogage non trouvée. >>>>>>>>>> It seems Qt is looking for "Debug assistance" (I don't know if it's the right name in english) but he's not finding it. What is it's purpose ? {...} >&"info shared\n" t10:40:28.301 >~"From To Syms Read Shared Object Library\n" t10:40:28.302 >~"0x40000800 0x40017b24 Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/lib/ld-linux.so.3\n" t10:40:28.302 >~"0x401e3454 0x40890b14 Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/usr/lib/libQtGui.so.4\n" t10:40:28.302 >~"0x409f091c 0x409f0f20 Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/usr/lib/libts-1.0.so.0\n" t10:40:28.302 >~"0x409fd6c8 0x40a10828 Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/usr/lib/libpng12.so.0\n" t10:40:28.302 >~"0x40a23570 0x40a5944c Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/usr/lib/libfreetype.so.6\n" t10:40:28.302 >~"0x40ab416c 0x40b73cf4 Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/usr/lib/libQtNetwork.so.4\n" t10:40:28.302 >~"0x40c18d80 0x40dafea4 Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/usr/lib/libQtCore.so.4\n" t10:40:28.302 >~"0x40e9f6a8 0x40ea6c84 Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/usr/lib/libz.so.1\n" t10:40:28.302 >~"0x40eb45a0 0x40eb7c2c Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/lib/librt.so.1\n" t10:40:28.302 >~"0x40ec28d0 0x40ec365c Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/lib/libdl.so.2\n" t10:40:28.302 >~"0x40ed0ca0 0x40edd734 Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/lib/libpthread.so.0\n" t10:40:28.302 >~"0x40f2ad50 0x40f82698 Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/usr/lib/libstdc++.so.6\n" t10:40:28.302 >~"0x40fa8190 0x4100bbcc Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/lib/libm.so.6\n" t10:40:28.302 >~"0x4104d230 0x41053fb8 Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/lib/libgcc_s.so.1\n" t10:40:28.302 >~"0x41071770 0x4114b760 Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/lib/libc.so.6\n" t10:40:28.302 >~"0x41181c98 0x4119d318 Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/usr/lib/libssl.so.0.9.8\n" t10:40:28.302 >~"0x411e4e08 0x4125b560 Yes /home/gdrz9888/dev/BSP/eeebook_oe/tmp/rootfs/usr/lib/libcrypto.so.0.9.8\n" t10:40:28.302 >~" No /usr/lib/qtopia/plugins/gfxdrivers/libk1900qt.so\n" >>>>>>>>>> Thanks to Christian, librairies are now found using the sysroot variable {...} >239^done,locals=[{name="a",type="struct QApplication"},{name="w",type="class MainWindow"},{name="toto",type="QString"}] tResponse time: -stack-list-locals 2: 0.08 s t10:40:32.019 t10:40:32.019 >240^done,stack=[frame={level="0",addr="0x0000a574",func="main",file="main.cpp",fullname="/home/gdrz9888/dev/local/KeycodeTester/main.cpp",line="12"}] tResponse time: -stack-list-frames 0 20: 0.08 s t10:40:32.019 t10:40:32.019 >241^done,thread-ids={thread-id="1"},number-of-threads="1" tResponse time: -thread-list-ids: 0.08 s t10:40:32.019 <242-var-delete "local.a" <243-var-create "local.a" * "a" <244-var-delete "local.w" <245-var-create "local.w" * "w" <246-var-delete "local.toto" <247-var-create "local.toto" * "toto" t10:40:32.119 >242^done,ndeleted="1" tResponse time: -var-delete "local.a": 0.077 s t10:40:32.119 t10:40:32.119 >243^done,name="local.a",numchild="0",value="{...}",type="struct QApplication" tResponse time: -var-create "local.a" * "a": 0.076 s t10:40:32.119 t10:40:32.120 >244^done,ndeleted="1" tResponse time: -var-delete "local.w": 0.077 s t10:40:32.120 t10:40:32.120 >245^done,name="local.w",numchild="3",value="{...}",type="class MainWindow" tResponse time: -var-create "local.w" * "w": 0.077 s t10:40:32.120 t10:40:32.120 >&"Variable object not found\n" t10:40:32.120 >246^error,msg="Variable object not found" tResponse time: -var-delete "local.toto": 0.077 s t10:40:32.120 t10:40:32.120 >247^done,name="local.toto",numchild="2",value="{...}",type="QString" tResponse time: -var-create "local.toto" * "toto": 0.077 s t10:40:32.120 <248-var-evaluate-_expression_ "local.a" <249-var-evaluate-_expression_ "local.w" <250-var-evaluate-_expression_ "local.toto" t10:40:32.176 >248^done,value="{...}" tResponse time: -var-evaluate-_expression_ "local.a": 0.048 s t10:40:32.178 t10:40:32.178 >249^done,value="{...}" tResponse time: -var-evaluate-_expression_ "local.w": 0.041 s t10:40:32.178 t10:40:32.178 >250^done,value="{...}" tResponse time: -var-evaluate-_expression_ "local.toto": 0.031 s <<Rebuild Watchmodel 7> sCollecte des données terminée. t10:40:32.178 >>>>>>>>>> I created a test QString object named "toto" but when I stopped after its initialization, I can't see its value in the debug window. How can I solve this issue ? Thanks a lot for your help. Guillaume Ménant Christian Kandeler wrote: On Thursday 25 February 2010 16:01:38 ext gmenant....@orange-ftgroup.com wrote:I'm using Qt Creator 1.3.1. About the sysroot, I don't know what I have to put in it (which path). It's probably my main problem though ! GDB is looking for libQtGui.so.4 in /usr/lib and the file is there (see below). I don't understand why he doesn't find it...Gdb needs to find the libraries from the target device on the host as well, to display debug information. I assume the Qt libs it finds in /usr/lib are the x86 versions. You have to tell gdb where on your PC to find the set of target libraries. The easiest way to do that is to put a copy of the device OS' file system tree on the host system (only libraries and perhaps header files are needed) and point the sysroot variable to the respective directory. Example: - You copy the relevant files from your device to the directory /usr/share/cross on your PC, preserving the directory structure. - Now you have directories such as /usr/share/cross/lib, /usr/share/cross/usr/lib, /usr/share/cross/usr/include etc. - Then you set gdb's sysroot variable to /usr/share/cross - gdb should now pick up the right librariesWhich commands do you send to gdb when manually debugging?>Nothing for now but Qt Creator sends a lot of commands and I don't know why and how to configure them.Well, it must get the right sysroot from somewhere. Perhaps it has been set up with the correct sysroot at configure time? You can check that by starting gdb and typing "show sysroot".2 - What is the purpose of gdb startup file and gdbserver startup file ? What is the syntax ?It's an sh script intended for doing preparations on the server side, like copying your program or starting gdbserver. See the email you referenced above for an example.Ok, I will try it when other points will be ok. Even with a embedded linux on my target, I will be able to copy and lanch gdbserver automatically ?Yes, scp/ssh can do that. Christian ********************************* This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. Messages are susceptible to alteration. France Telecom Group shall not be liable for the message if altered, changed or falsified. If you are not the intended addressee of this message, please cancel it immediately and inform the sender. ******************************** |
_______________________________________________ Qt-creator mailing list Qt-creator@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-creator