valgrind 不适用于 linux ubuntu 16.04 中的 32 位可执行文件

valgrind doesnt work on my 32bit executable in linux ubuntu 16.04

我正在尝试 运行 我在 linux Ubuntu 主机 16.04(64 位)下构建的 32 位可执行文件(样本)上的 valgrind 工具,但它失败了运行,错误: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 库路径,但这没有帮助+

$export VALGRIND_LIB="/usr/lib/valgrind"

我打开了我的 lib 目录,我找到了整个列表并找到了 callgrind,所有的库都在那里。

callgrind-amd64-linux          
callgrind-x86-linux

不知道哪里出了问题,也不知道如何在我的可执行文件上使用 valgrind。

任何帮助,不胜感激。

Valgrind 不支持 'host' 的设置(您 运行 valgrind) 不同于 'guest'(您 运行 在 valgrind 下的应用程序。

因此,无法运行 Valgrind 下的 arm32 应用程序 x86/amd64 系统.

你应该 运行 在 arm32 系统上使用这个,并为 arm32 编译了一个 valgrind。 或者,您可以使用例如android 模拟器。 请参阅 Valgrind 发行版中的 README.android 和 README.android_emulator 了解更多信息