2013-09-23 100 views
5

我試圖用gdb.The編譯,我使用標誌來調試C程序中加入符號文件系統提供的DSO沒有發現裝入節是如下GDB:在0x2aaaaaaab000

-fno-strict-aliasing -Wall -DHAVE_CONFIG_H -DNO_OLD_ERF_TYPES -Werror -Wredundant-decls -O2 -DNDEBUG -DBYTESWAP -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g 

版本我使用的編譯器是

gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52) 
Copyright (C) 2006 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

我調試的

libtool的GDB mytool

我設置斷點並運行程序。執行不會停在斷點處,並且我收到以下警告。

warning: no loadable sections found in added symbol-file system-supplied DSO at 0x2aaaaaaab000 
[Thread debugging using libthread_db enabled] 
+0

檢查此問題 - http://stackoverflow.com/questions/18548139/gdb-warning-loadable-section-not-found-in-added-符號文件系統提供的-DSO。這可能會幫助你。 –

+0

nope.I嘗試使用static.wasn'n無用:( – liv2hak

+1

調試未優化的版本不在靜默? – dbrank0

回答

0

嘗試丟棄-O2和-DNDEBUG。

的-02設置優化級別起來了一點,所以編譯後的代碼可能並不表示它是怎麼寫的源文件和NDEBUG標誌可能會覆蓋-g

0

嘗試刪除所有的目標文件和重新編譯。我遇到了同樣的問題,無法使用gdb調試我的程序。我用cmake編譯,並能夠通過運行來修復問題make clean; make