如何使用qnx二进制文件运行valgrind

时间:2017-01-03 23:24:41

标签: arm valgrind qnx

我为qnx 6.5选择了一个valgrind banary并且能够在示例程序上运行qnx二进制文件,如下所示:

# /usr/valgrind/x86/usr/bin/valgrind        
valgrind: no program specified
valgrind: Use --help for more information.

# /usr/valgrind/x86/usr/bin/valgrind --version
valgrind-3.10.1
# /usr/valgrind/x86/usr/bin/valgrind --tool=memcheck
valgrind: no program specified
valgrind: Use --help for more information.
# /usr/valgrind/x86/usr/bin/valgrind --tool=memcheck ls
==6332450== Memcheck, a memory error detector
==6332450== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==6332450== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==6332450== Command: ls
==6332450== 
==6332450== 
==6332450== 
==6332450== Valgrind is exiting:
==6332450==   Symbols for /proc/boot/libc.so.3 are required but not found.
==6332450==   (Suggestion: compile that binary with debug-information, or provide a separate symbol-file.)
==6332450== 
==6332450==

但是虽然用arm二进制文件运行相同的二进制文件(在arm处理器上编译的代码),但它抛出以下错误:

# /usr/valgrind1/x86/usr/bin/valgrind /usr/bt 

(这里bt是用arm编译的二进制文件)

valgrind:可执行文件不适用于此架构

注意:/ usr / valgrind_arm / valgrind / bin / valgrind ls / usr / valgrind_arm / valgrind / bin / valgrind [1]:语法错误:`^AÜ$ O4T ^ H'意外

任何建议或回应都将受到高度赞赏。

1 个答案:

答案 0 :(得分:1)

原因/proc/boot/libc.so.3没有调试符号。 尝试从当前工作目录valgrind运行/lib,其中包含带有调试符号的不同版本的libc.so.3。或者将其路径设置为

valgrind --tool=memcheck --extra-debuginfo-path=/lib <prog_name>