valgrind- 内存泄漏-how to install and use

时间:2023-03-08 23:23:48
valgrind- 内存泄漏-how to install and use

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安装:

. tar -jxvf valgrind-3.12..tar.bz2
.sudo mv valgrind-3.12. valgrind
. cd valgrind
. sudo ./configure --host=arm-linux --prefix=/opt/valgrind/lib
. sudo ./autogen.sh
. sudo make
.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 >&

3.Re:

re:

End