简体   繁体   English

在为iPhone模拟器构建时,在XCode控制台中不再有gdb

[英]No more gdb in XCode console when build for iPhone simulator

Usually I use gdb backtrace to debug my application, but recently I can no longer do it when testing on iPhone simulator. 通常我使用gdb backtrace来调试我的应用程序,但最近我在iPhone模拟器上测试时再也无法做到。 The blue gdb word stops being displayed on console, and nothing happens when I type "bt" or "backtrace". 蓝色gdb字停止在控制台上显示,当我输入“bt”或“backtrace”时没有任何反应。 I can still build and debug properly on the device though. 我仍然可以在设备上正确构建和调试。

My XCode version is 3.2.3. 我的XCode版本是3.2.3。 Is there any way to manually activate the gdb (more importantly the backtrace)? 有没有办法手动激活gdb(更重要的是回溯)?

As Jack points out, the Pause button will manually activate gdb & the back trace, which is what you asked. 正如Jack指出的那样,Pause按钮将手动激活gdb和后跟踪,这就是你的要求。 You may have a bad install -- it happens, sometimes, try deleting your /Developer folder & re-installing. 您的安装可能不正确 - 有时会尝试删除您的/ Developer文件夹并重新安装。 XCode 3.2.3 and the debugger work just fine, I use it several times a day. XCode 3.2.3和调试器工作得很好,我每天使用它几次。

In particular, CMD-Y is "build & run with debugger", whereas CMD-R is just "build & run" (no debugger, by default), so make sure you're using CMD-Y. 特别是,CMD-Y是“使用调试器构建和运行”,而CMD-R只是“构建和运行”(默认情况下没有调试器),因此请确保使用CMD-Y。

Aside: An issue I keep running into is, after the app quits, the red-stop-sign icon doesn't recognize that the app has finished, so I have to "stop" it again. 旁白:我遇到的一个问题是,在应用程序退出后,红色停止标志图标无法识别应用程序已完成,因此我必须再次“停止”它。 I believe this is due to iOS-4's keeping apps running in the background. 我相信这是因为iOS-4让应用程序在后台运行。

If the program is hanging, which is what this sounds like. 如果程序挂起,这就是听起来像。 You can press the 'Pause' button on the Debugger Console or in the Debugger window to interrupt the app and see where it is currently executing. 您可以按调试器控制台或调试器窗口中的“暂停”按钮来中断应用程序并查看它当前正在执行的位置。

Also, check and make sure your home folder .gdbinit file is in good order. 另外,检查并确保您的主文件夹.gdbinit文件处于良好状态。 Move it aside if it exists and see if the problem goes away. 如果存在则将它移到一边,看看问题是否消失。

Don't know if this is the exact same situation, but it may help. 不知道这是否完全相同,但可能有所帮助。 My iPhone was at firmware 4.0.2, but my Xcode SDK was for firmware 4.0.1. 我的iPhone是固件4.0.2,但我的Xcode SDK是固件4.0.1。 Normally Xcode would complain that I would need to upgrade to a newer Xcode that supported 4.0.2, this time it didn't. 通常Xcode会抱怨我需要升级到支持4.0.2的新Xcode,这次它没有。

Was banging my head why breakpoints could be set but the debugger did not stop at my breakpoint (the breakpoints were orange - signalling that symbols were not loaded). 敲打我的脑袋为什么可以设置断点但是调试器没有停在我的断点处(断点是橙色的 - 表示没有加载符号)。 I decided to reboot my iPhone and now Xcode showed the warning (when it didn't before). 我决定重新启动我的iPhone,现在Xcode显示了警告(之前没有)。 Upgrading to Xcode for 4.0.2 fixed my problem of course. 升级到Xcode for 4.0.2当然解决了我的问题。 So perhaps your Xcode is not updated for newer firmware? 那么也许你的Xcode没有更新为更新的固件?

Had similar issue, but can't remember the exact circumstances. 有类似的问题,但不记得确切的情况。 Turned out the Base SDK (in the project info build tab) was set to the device and not the simulator. 原来基础SDK(在项目信息构建选项卡中)设置为设备而不是模拟器。 Bit of a shot in the dark, but probably worthwhile verifying. 在黑暗中一点点射击,但可能值得验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM