我已经尝试在我编写的应用程序上运行valgrind(memcheck和massif),但我得到的只是执行函数的地址.
--------------------------------- Context accounted for 0.6% of measured spacetime 0x805F29A: (within prog_name) 0x8141740: (within prog_name) Called from: 0.6% : 0x812E077: (within prog_name) --------------------------------- Context accounted for 0.5% of measured spacetime 0x805F29A: (within prog_name) 0x81418FB: (within prog_name) Called from: 0.5% : 0x812E077: (within prog_name)
我使用-g标志编译了我的应用程序以放入调试符号. 还有其他原因导致valgrind不显示源代码行吗?
编辑:valgrind版本3.2.1-Debian; g ++ 4.3.1
我发现我在编译时传入了两个-g
和-ggdb
标志g++
.省略-g
旗帜导致这个问题消失了.