sdk5.0.2
在am5728的开发板上运行valgrind:
valgrind -v –log-file=log –tool=memcheck –leak-check=full –show-mismatched–free=yes ./v_test
没有什么结果,提示object doesn's have a symbol table,但是编译已经加了 -g -O选项
user5875077:
==683== Memcheck, a memory error detector
==683== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==683== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==683== Command: ./v_test
==683== Parent PID: 640
==683==
–683–
–683– Valgrind options:
–683—v
–683—-log-file=valgrind.log
–683—-tool=memcheck
–683—-leak-check=full
–683—-show-mismatched-frees=yes
–683– Contents of /proc/version:
–683–Linux version 4.14.79-gb1adb45-dirty (ljc@ubuntu) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #9 SMP PREEMPT Thu Jul 11 15:50:36 CST 2019
–683–
–683– Arch and hwcaps: ARM, LittleEndian, ARMv7-neon-vfp
–683– Page sizes: currently 4096, max supported 4096
–683– Valgrind library directory: /usr/lib
–683– Reading syms from /home/root/v_test
–683– Reading syms from /lib/ld-2.25.so
–683–Considering /lib/ld-2.25.so ..
–683–.. CRC mismatch (computed e3711ca5 wanted 2f1e9f06)
–683–object doesn't have a symbol table
–683–Reading EXIDX entries: 30 available
==683==Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
==683==Warning: whilst reading EXIDX: ExtabEntryDecode: failed with error code: -10
–683–Reading EXIDX entries: 20 attempted, 18 successfulvalgrind:Fatal error at startup: a function redirection
valgrind:which is mandatory for this platform-tool combination
valgrind:cannot be set up.Details of the redirection are:
valgrind:
valgrind:A must-be-redirected function
valgrind:whose name matches the pattern:strcmp
valgrind:in an object with soname matching:ld-linux-armhf.so.3
valgrind:was not found whilst processing
valgrind:symbols from the object with soname: ld-linux-armhf.so.3
valgrind:
valgrind:Possible fixes: (1, short term): install glibc's debuginfo
valgrind:package on this machine.(2, longer term): ask the packagers
valgrind:for your Linux distribution to please in future ship a non-
valgrind:stripped ld.so (or whatever the dynamic linker .so is called)
valgrind:that exports the above-named function using the standard
valgrind:calling conventions for this platform.The package you need
valgrind:to install for fix (1) is called
valgrind:
valgrind:On Debian, Ubuntu:libc6-dbg
valgrind:On SuSE, openSuSE, Fedora, RHEL:glibc-debuginfo
valgrind:
valgrind:Note that if you are debugging a 32 bit process on a
valgrind:64 bit system, you will need a corresponding 32 bit debuginfo
valgrind:package (e.g. libc6-dbg:i386).
valgrind:
valgrind:Cannot continue — exiting now.Sorry.
user5875077:
回复 user5875077:
完整log如上,这个怎么解决?
yongqing wang:
编译的要debug版本,加 -g就可以
yongqing wang:
回复 yongqing wang:
Debug 的编译选项必须包含 -O0 和 -g 或者 -ggdb 选项
user5875077:
回复 yongqing wang:
系统也要debug版本吗?我的测试程序加了-g
user5875077:
回复 yongqing wang:
我用的编译命令g++ -g -O0 -o v_test main.cpp
yongqing wang:
回复 user5875077:
这个程序有在别的平台上测试过吗
user5875077:
回复 yongqing wang:
没有,但是程序是一个明显的内存泄漏的例子。
user5875077:
回复 yongqing wang:
同样的程序我在Ubuntu上的gcc编译出来可以用valgrind分析,但是在嵌入式板子上用sdk里面valgrind分析sdk gcc里面编译出来的就不行,难受啊
user5875077:
回复 user5875077:
查了很多资料说需要debug版本的libc6-dbg,我怎么获取TI 的libc6-dbg这个库呢,在sdk里面没搜到这个文件