我正在尝试在我的32位可执行文件(示例)上运行valgrind工具,我在Linux Ubuntu主机16.04(64位)下构建,但它无法运行,错误:错误的ELF。
示例应用程序构建为在arm32中运行,在我的主机linux机器上进行交叉编译。
这是我跑的命令。
valgrind --tool=callgrind ./sample
valgrind: wrong ELF executable class (eg. 32-bit instead of 64-bit)
valgrind: ./sample: cannot execute binary file
我运行了memcheck工具,但也失败了。
valgrind --tool=memcheck ./updater
valgrind: wrong ELF executable class (eg. 32-bit instead of 64-bit)
valgrind: ./updater: cannot execute binary file
然后我做了什么,我导出了valgrind lib路径但是没有帮助+
$export VALGRIND_LIB="/usr/lib/valgrind"
我jut ls我的lib目录,我找到了整个列表并找到了callgrind,所有的库都在那里。
callgrind-amd64-linux
callgrind-x86-linux
不知道出了什么问题以及如何在我的可执行文件中使用valgrind。
任何帮助,赞赏。
答案 0 :(得分:0)
Valgrind不支持主持人' (运行valgrind的地方) 不同于'客人' (你在valgrind下运行的应用程序。
所以,没有办法在Valgrind下运行arm32应用程序 x86 / amd64 system。
你应该在arm32系统上运行它,并为arm32编译valgrind。 或者,您可以使用例如一个Android模拟器。 请参阅Valgrind发行版中的README.android和README.android_emulator 了解更多信息