gpt4 book ai didi

iphone - valgrind和iphone

转载 作者:行者123 更新时间:2023-12-01 17:02:16 26 4
gpt4 key购买 nike

我想使用valgrind来检测iPhoneSimulator上的泄漏。我得到了valgrind的源代码,进行了编译和安装。在我的代码中添加了以下内容


int main(int argc, char *argv[]) {

#ifdef VALGRIND_REXEC
if (argc = 2 && strcmp(argv[1], "-valgrind") != 0)) {
execl(VALGRIND, VALGRIND, "--leak-check=full", "--dsymutil=yes", argv[0], "-valgrind", NULL);
}
#endif

定义了VALGRIND_REXEC,当我尝试调试或运行应用程序时,在控制台中出现以下错误

[Session started at 2011-03-14 16:21:27 +0000.]
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
open$UNIX2003 called from function main in image valgrind.
If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first.

Mac 10.6.5
Xcode 3.2.5
iOS 4.2

我需要以任何特殊方式编译valgrind,我做错了什么吗?

最佳答案

出于好奇,出于某种原因,Xcode中的“泄漏”工具不会执行您需要的操作吗?

  • Relevant SO question
  • 关于iphone - valgrind和iphone,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5303045/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com