XCode 调试器停止并在“停止”按钮上显示 SIGKILL

发布于 2024-12-11 20:30:59 字数 379 浏览 0 评论 0原文

我在 MacOS Lion 上使用 XCode 4.2。在模拟器中调试 iPhone/iPad 应用程序时,我使用 XCode 工具栏上的“停止”按钮(产品 | 停止)来退出应用程序。在此之后,XCode 通常会打开 main.m 文件,将执行指针放在 UIApplicationMain 调用上,并显示“程序收到 SIGKILL”。大约一秒钟后,它会中断调试模式,因此我无法调试此错误。我的应用程序涉及大量线程,因此,我猜测它可能与线程仍在工作时被拉出的资源或类似的事情有关。这甚至可能是正常的,我不太关心这个问题,因为应用程序无论如何都会被终止。但是每次调试后看到这个SIGKILL确实很烦人。我该如何调试它?或者,有没有办法禁用它?

编辑:除了通常的活动日志之外,控制台中没有任何内容(没有像常规异常那样的崩溃详细信息)。

I am using XCode 4.2 on MacOS Lion. When debugging an iPhone/iPad app in Simulator, I am using "Stop" button on XCode toolbar (Product | Stop) to exit the app. Very often after this, XCode opens main.m file, puts the execution pointer on UIApplicationMain call and says "Program received SIGKILL". In about a second after that it breaks off debug mode, so I can not debug this error. My app involves lots of threads, so, my guess is it can be related to resources being pulled out when threads are still working, or something like that. This may even be normal, and I do not care very much about this problem, because the app is being terminated anyway. But seeing this SIGKILL after every debug is really annoying. How can I debug it? Alternatively, is there a way to disable it?

EDIT: there's nothing in the console except the usual activity log (no crash details like with regular exceptions).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

星光不落少年眉 2024-12-18 20:30:59

SIGKILL 是停止调试器时发送给进程的信号。没有什么问题,但有时它确实会出现并将您切换到 main.m 文件,这是无用且烦人的。

要解决这个问题,不必费心从 Xcode 停止可执行文件。只需让它运行,当您想再次运行时,只需使用“播放”按钮重新启动,上一个任务无论如何都会终止。

SIGKILL is what you are sending to the process when you stop the debugger. There isn't anything wrong, but sometimes it does show up and switch you to the main.m file which is useless and annoying.

To get around it, don't bother stopping the executable from Xcode. Just leave it running, and when you want to run again, just re-launch with the "Play" button and the previous task will be terminated anyway.

泪眸﹌ 2024-12-18 20:30:59

在我看来jrturton的解决方案并没有真正解决这个问题。我专门停止该应用程序,以便我可以测试使用 NSUserDefaults 保存数据。

我的建议是运行后立即停止,以便调试器不再监视应用程序。然后您可以随意关闭该应用程序并根据需要重新打开它。通过这样做,我能够检查 NSUserDefaults 是否已正确保存,而无需每次杀死并重新打开应用程序时都通过调试器进行单步调试。

It seems to me that jrturton's solution doesn't really get around the problem. I'm specifically stopping the app so I can test saving data using NSUserDefaults.

My suggestion is to hit STOP right after running so that the debugger is no longer monitoring the app. Then you are free to close the app and reopen it as you wish. Doing this I was able to check that NSUserDefaults were being saved correctly without having to step through the debugger every time I killed and reopened the app.

时间海 2024-12-18 20:30:59

为了防止 Xcode 4 短暂停止并切换到 main.m,您可以通过在按 Stop 按钮之前单击 Breakpoints 按钮来关闭调试模式(?)。

To prevent Xcode 4 from shortly halting and switching to the main.m, you can turn off debug mode(?) by clicking the Breakpoints button before pressing the Stop button.

微暖i 2024-12-18 20:30:59

如果您想在编辑代码时停止应用程序,可以尝试我在此处给出的答案:

Xcode 4.2 每次停止模拟器后都会跳转到 main.m

If you prefer to stop your app while editing code, you can try my answer given here:

Xcode 4.2 jumps to main.m every time after stopping simulator

萌︼了一个春 2024-12-18 20:30:59

如果您使用触控板,一种解决方法是在编辑器区域中“向左滑动”。这会将 main.c 移开,并打开之前编辑的文件。

If you use a trackpad, one workaround is to "swipe left" in the editor area. This will move main.c away, and open the previously edited file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文