2

参考http://alxsrg.com/?p=180 http://root42.blogspot.ru/2011/02/valgrind-checking-of-ios-programs.htmlhttp://landonf.bikemonkey.org/代码/iphone/iPhone_Simulator_Valgrind.20081224.html

我在某些情况下尝试过,都失败了。

我尝试的是:

  1. 山狮 + xcode 4.6/4.6 + 手动编译的 valgrind + SDK5.1 从旧版本的 xcode 中提取。
  2. vmware 中的 lion(10.7.5) 来宾操作系统(主机是山狮)+ xcode4.3.2/4.5.2 + SDK5.1/SDK5.0
  3. 狮子 (10.7) + xcode4.2.1 + SDK5.0

execl 因堆栈空指令(0x00000000)而失败。

虽然我尝试在命令行中使用 valgrind 并且效果很好。

ps,模拟器中生成valgrind的代码:

#define VALGRIND "/opt/local/bin/valgrind"

int main(int argc, char *argv[]) {
#ifdef VALGRIND_REXEC
    /* Using the valgrind build config, rexec ourself
     * in valgrind */
    if (argc < 2 || (argc >= 2 && strcmp(argv[1], "-valgrind") != 0)) {
        execl(VALGRIND, VALGRIND, "--leak-check=full", argv[0], "-valgrind",
              NULL);
    }
#endif

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, @"PeepsAppDelegate");
    [pool release];
    return retVal;
}
4

1 回答 1

0

我已经让这个工作了,但我不得不从 Valgrind 中破解掉这个问题,因为当时 valgrind 的模拟器不支持 LLVM 发出的一些 SSE4 指令。如果您仍然感兴趣,我相信我仍然有这个地方的一个版本。哦,另外,您需要禁用所有音频或视频代码,因为您的音频线程将超时(Valgrind 就是那么慢)并且模拟器将退出。

于 2014-02-19T19:27:55.257 回答