valgrind

1.编译

$ export PATH=$PATH:xxx/crosstools-mips32-gcc-4.4.6-eglibc/usr/bin

$ export CC=xxx/mips-linux-gcc

or you can use script to set env auto

autogen.sh

default big-endian, if little-endian add param -EL

./configure --host=mips-linux-gnu --target=mips-linux-gnu --prefix=/where/you/want/it/installed

make

make install

2.Copy valgrind in “/where/you/want/it/installed/bin”, defauld.supp , memcheck-mips32-linux, vgpreload_memcheck-mips32-linux.so, vgpreload_core-mips32-linux.so, vgpreload_drd-mips32-linux.so in “/where/you/want/it/installed/lib/valgrindto target board

3.Valgrind offcial recommend to keep the files copied from build server put in same place in target platform, or you may encouter error:

cannt find memcheck tool …”, use -d .

but we can fix it by:

$ export VALGRIND_LIB = “xxx”

xxx means the .so and memcheck-mips32-linux files’s  path in target platform

4.rebuild your app, lib with -g, add cmd exit(0) for app which cannt stop itself.

glibc ld-2.12.2.so bug "conditional jump or ..." <-----suppressions this in default.supp(默认加载default.supp,可以更改)

vagrind's memory management: out of memory: <-----内存不够,换了个板子继续试

 

这篇文章里 树的例子很好的解释了各种lost,http://www.ibm.com/developerworks/cn/linux/l-cn-valgrind/

posted on 2015-10-19 15:28  _Echo  阅读(160)  评论(0)    收藏  举报

导航