valgrind- 内存泄漏-how to install and use
原创
©著作权归作者所有:来自51CTO博客作者mb62c788fd198da的原创作品,请联系作者获取转载授权,否则将追究法律责任
1.how to install
my host computer is ARM, U need to Attention yours...
valgrind下载:
http://valgrind.org/downloads/valgrind-3.12.0.tar.bz2
valgrind安装:
1. tar -jxvf valgrind-3.12.0.tar.bz2
2.sudo mv valgrind-3.12.0 valgrind
3. cd valgrind
4. sudo ./configure --host=arm-linux --prefix=/opt/valgrind/lib
5. sudo ./autogen.sh
6. sudo make
7.sudo make install
输入valgrind–h显示valgrind的参数及提示,说明安装成功...
$ valgrind -h
usage: valgrind [options] prog-and-args
tool-selection option, with default in [ ]:
--tool=<name> use the Valgrind tool named <name> [memcheck]
basic user options for all Valgrind tools, with defaults in [ ]:
-h --help show this message
--help-debug show this message, plus debugging options
..............
2. How to Use.
valgrind --leak-check=full --show-reachable=yes --trace-children=yes ./bin/lane_seg
or
valgrind --leak-check=full --show-reachable=yes --trace-children=yes ./bin/lane_seg > a.out 2>&1
3.Re:
manul:
http://valgrind.org/docs/manual/manual.html
End