2012-05-23 43 views
1

我在查看與可執行文件lab13關聯的源代碼。當我點擊KCachegrind的來源選項卡,我看到的是這樣的:在KCachegrind中獲取源註釋

There is no source available for the following function: 
    'main' 
This is because no debug information is present. 
Recompile source and redo profile run. 
The function is located in this ELF object: 
    'lab13' 

不過,我現在用的是-g調試標誌在我makefile

lab13:main.o 
    g++ -g main.o -o lab13 
    ./lab13 

main.o:main.cpp EdgeArray.h Edge.h DisjointSets.h Matrix.h experiment.h 
    g++ -c -g main.cpp 

我創建的callgrind.out文件使用以下呼叫valgrind

valgrind --tool=callgrind --dsymutil=yes ./lab13 

我看了在KCachgrind documentation,但沒有信息如何激活選項卡功能。

我在OSX上編譯程序,並通過X11運行KCachgrind。我正在從與代碼相同的目錄中讀取callgrind.out文件。所有其他KCachgrind功能似乎都能正常工作。

我如何獲得選項卡工作?

+0

你可以通過'gdb'逐行執行程序嗎? –

回答

0

您應該在配置文件(cf)中查找「fl =」行,並確保源文件在「fl =」行中給出的路徑下可用。