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功能似乎都能正常工作。
我如何獲得源選項卡工作?
你可以通過'gdb'逐行執行程序嗎? –