4

自从更新到 iOS 5 和 Xcode 4.2 后,Xcode 似乎不再"Program ended with exit code: #"在运行完成时打印。有没有其他人注意到这一点,有没有办法再次启用它?我有一个自动化测试工具,它依赖于这个输出来确定测试是否通过,所以让它回来会很有帮助。

更新:我对此进行了更详细的研究,这似乎是一个更深层次的问题。似乎每当我运行一个应用程序时,它都会在退出时因分段错误而崩溃。有时这发生在退出代码打印之前,有时正好在打印之后,这就是退出代码消息出现不一致的原因。尽管 Xcode 调试输出中没有任何内容,但 seg 错误消息出现在设备的控制台中。

4

1 回答 1

3

我也刚注意到这一点。似乎在 Xcode 4.1 ( tty /dev/ttys000)gdb中是这样开始的:

This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys000

但在 Xcode 4.2 - 否tty /dev/ttys000

This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all

要解决此问题,您可以从命令行 (Terminal.app/iTerm/etc) 执行以下操作:

echo 'tty /dev/ttys000' >> ~/.gdbinit
# Or, put it into the global gdb config:
# echo 'tty /dev/ttys000' >> /etc/gdb.conf

然后重新启动 Xcode,你的退出代码就回来了!


似乎 Xcode 4.2 的 gdb 包装器自 4.1 以来发生了变化

[ 13:29 Jonathan@MacBookPro / ]$ ls -l /Developer/Library/Xcode/PrivatePlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB /Developer-4.2/Library/Xcode/PrivatePlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB 
-rwxrwxr-x  1 root  admin  351936 Sep 20 13:23 /Developer/Library/Xcode/PrivatePlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB
-rwxrwxr-x  1 root  admin  353776 Oct  8 14:21 /Developer-4.2/Library/Xcode/PrivatePlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB

[ 13:33 Jonathan@MacBookPro / ]$ ls -l /Developer/Library/Xcode/PrivatePlugIns/DebuggerGDB.ideplugin/Contents/MacOS/DebuggerGDB /Developer-4.2/Library/Xcode/PrivatePlugIns/DebuggerGDB.ideplugin/Contents/MacOS/DebuggerGDB
-rwxrwxr-x  1 root  admin  1976144 Sep 20 13:23 /Developer/Library/Xcode/PrivatePlugIns/DebuggerGDB.ideplugin/Contents/MacOS/DebuggerGDB
-rwxrwxr-x  1 root  admin  1948240 Oct  8 14:21 /Developer-4.2/Library/Xcode/PrivatePlugIns/DebuggerGDB.ideplugin/Contents/MacOS/DebuggerGDB
于 2011-10-14T19:18:06.880 回答