2013-05-31 123 views
4

使用Qt Creator 2.7.1和Qt 4.8.4,我創建了一個Qt庫和一個簡單的Qt應用程序,它可以動態鏈接到這個庫。我試圖遠程部署和調試我的應用程序,並在我給他們打電話時進入我的庫函數。我可以成功設置斷點並進行遠程調試,但我無法使用調試器(gdb)進入我的庫函數。當我第一次遠程啓動在調試模式下使用QtCreator我的申請,我會見了以下警告:Qt Creator 2.7.1和Qt 4.8.4無法遠程調試庫

Could not load shared library symbols for 7 libraries, e.g. libcustom-stuff.so.1. 
Use the "info sharedlibrary" command to see the complete listing. 
Do you need "set solib-search-path" or "set sysroot"? 

我的調試器是使用QtCreator所示這些圖像(請注意,我已經切換兩個「目標路徑設置'和 '路徑' 在圖像#3,但它並沒有幫助: enter image description here enter image description here enter image description here

我的 '工具包' 的設置如下:

enter image description here

Qt Creator中中的「調試日誌」我進入「命令」:

info sharedlibrary 

對此我得到的迴應:

>~"From  To   Syms Read Shared Object Library\n" 
>~"0x400007e0 0x40011bf0 Yes   /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/ld-linux.so.3\n" 
>~"      No   libcustom-stuff.so.1\n" 
>~"0x4006d018 0x400d7124 Yes   /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libQtDBus.so.4\n" 
>~"0x401065c4 0x4013dd18 Yes   /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libQtXml.so.4\n" 
>~"0x40172430 0x4024c1b4 Yes   /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libQtNetwork.so.4\n" 

我也保證,無論是庫和應用程序使用以下內容構建:

CONFIG+=declarative_debug 

在庫和應用程序的「編譯輸出」窗格中,我看到'-g'標誌。

它們都駐留在文件系統的相同目錄中,所以發生了什麼!如何在應用程序中調試和設置斷點,但不進入庫調用?任何想法,不勝感激。

UPDATE:

按照由kikeenrique的建議,我想從我的Ubuntu主機(不是ARM目標)加載調試符號:

GNU gdb (Ubuntu/Linaro 7.4-0~69~lucid1) 7.4 
Copyright (C) 2012 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 "i486-linux-gnu". 
For bug reporting instructions, please see: 
<http://www.gnu.org/software/gdb/bugs/>... 
Welcome to Fluke GDB Init Script for QtCreator 
Reading symbols from /home/user/proj/output/exported-nfs/home/user/libcustom-stuff.so.1.0.0...done. 
(gdb) 

看來GDB可以在加載符號最少..

回答

6

您是否正在爲您的遠程應用程序使用不同的體系結構?

如果它們不同,則需要使用相同的gdb服務器和客戶端arch。

嘗試在您的項目中設置LD_LIBRARY_PATH - >編譯&用您的庫的路徑運行 - >構建環境。

+0

是遠程拱門是ARM。我可以在我的主應用程序中進行調試,但無法通過調試我的主應用程序進入我的庫(也是爲ARM構建的)。 – PhilBot

+0

@philbot嘗試在gdb(command symbol-file path/to/your/library)中手動加載符號文件。 libcustom-stuff.so的路徑是什麼? – kikeenrique

+0

我可以從我的主機上手動加載它們 - 請參閱我上面編輯的文章。應用程序和庫都位於目標上的/ home/user中。 – PhilBot