valgrind不在OS X 10.8上工作

hou*_*oft 7 valgrind osx-mountain-lion

每当我尝试valgrind在我的OS X 10.8笔记本上运行时,我得到:

bad executable (no stack)
valgrind: ./a.out: cannot execute binary file
Run Code Online (Sandbox Code Playgroud)

问题是什么?我怎样才能解决这个问题?在Linux上一切正常,所以并​​不是我在某种程度上滥用valgrind.我正在使用的确切线路是valgrind --tool=memcheck --leak-check=full ./a.out.

Dog*_*ert 8

我得到了同样的错误,但我刚刚将valgrind升级为3.8.1(brew upgrade valgrind使用HomeBrew),虽然运行Valgrind会打印以下警告,但它仍然有效:

WARNING: Support on MacOS 10.8 is experimental and mostly broken.
WARNING: Expect incorrect results, assertions and crashes.
WARNING: In particular, Memcheck on 32-bit programs will fail to
WARNING: detect any errors associated with heap-allocated data.
Run Code Online (Sandbox Code Playgroud)