简体   繁体   English

Xcode 在调试时一直暂停

[英]Xcode keeps pausing while debugging

I only have a very small defined set of breakpoints (none of them symbolic breakpoints).我只有一个很小的定义断点集(它们都不是符号断点)。 But when I run my iOS app on my iPod Touch (model MC086LL, version 4.2.1), Xcode continually breaks in random spots.但是当我在我的 iPod Touch(型号 MC086LL,版本 4.2.1)上运行我的 iOS 应用程序时,Xcode 不断地在随机位置中断。 And on top of that, it doesn't break on my breakpoints.最重要的是,它不会在我的断点处中断。

The debugger works fine when I run the app in the simulator.当我在模拟器中运行应用程序时,调试器工作正常。

Any tips on how I can get this working correctly?关于如何使其正常工作的任何提示?

go to the exceptions tab and see if the "All Exceptions" breakpoint is enabled (blue is solid as opposed to opaque) either delete or disable that breakpoint if its enable转到异常选项卡并查看是否启用了“所有异常”断点(蓝色是实心的而不是不透明的)如果启用,则删除或禁用该断点

I believe this is enabled and thats why it "pauses randomly"我相信这是启用的,这就是为什么它“随机暂停”

Here's how to re-enable in case you delete it and want it back.以下是如何重新启用以防您删除它并想要它回来。 Open the sixth tab in your project explorer, in the bottom left corner tap + -> Add exception breakpoint -> Done.在项目资源管理器中打开第六个选项卡,在左下角点击 + -> 添加异常断点 -> 完成。 This will add an exception handler that will stop your app on the very method call that crashes the app.这将添加一个异常处理程序,它将在使应用程序崩溃的方法调用上停止您的应用程序。

This can happen when your symbols are corrupted in your build files.当您的构建文件中的符号损坏时,就会发生这种情况。 Finding cache files like the "Derived Data" folder for the project or the main Xcode cache file, and deleting it can frequently fix a variety of problems, especially with break-points and editor-debugger interaction.查找缓存文件,如项目的“派生数据”文件夹或主 Xcode 缓存文件,然后删除它可以经常解决各种问题,尤其是断点和编辑器-调试器交互。

If your "Derived Data" folder location under Preferences -> Locations is set to "Relative" then the "Derived Data" folder is next to the project file.如果“首选项”->“位置”下的“派生数据”文件夹位置设置为“相对”,则“派生数据”文件夹位于项目文件旁边。 Find the "Derived Data" folder next to your project file, delete the "Derived Data" folder, re-run your debug session.找到项目文件旁边的“Derived Data”文件夹,删除“Derived Data”文件夹,重新运行调试会话。

If your Preferences -> Locations has the "Derived Data" location set to "Default" it will be in your home folder location:如果您的首选项 -> 位置将“派生数据”位置设置为“默认”,它将位于您的主文件夹位置:

~/Library/Developer/Xcode/DerivedData 〜/图书馆/开发人员/Xcode/DerivedData

where ~/ represents the root of your home folder.其中 ~/ 代表您的主文件夹的根目录。 Find the "Derived Data" folder, delete the "Derived Data" folder, re-run your debug session.找到“Derived Data”文件夹,删除“Derived Data”文件夹,重新运行您的调试会话。

If this still does not fix the problem, be aware that Xcode can exhibit all manner of strange behavior when it's "main" cache file is corrupt.如果这仍然不能解决问题,请注意当“主”缓存文件损坏时,Xcode 可能会表现出各种奇怪的行为。 That file is located here:该文件位于此处:

~/Library/Caches/com.apple.dt.Xcode ~/Library/Caches/com.apple.dt.Xcode

and is safe to delete as Xcode will recreate that as well.并且可以安全删除,因为 Xcode 也会重新创建它。 I would recommend quitting and re-running Xcode when that one is deleted.我建议在删除 Xcode 后退出并重新运行 Xcode。

Xcode is a bit buggy and many of the problems are exacerbated by file data handling bugs that cause it to corrupt it's own caches... once the cache files are corrupt 'cascade failures' are common. Xcode 有点问题,许多问题都因文件数据处理错误而加剧,这些错误导致它破坏自己的缓存……一旦缓存文件损坏,“级联故障”很常见。 Deleting the caches are a good broad-spectrum antibiotic approach when seeing Xcode weirdness and can save considerable time in diagnosing Xcode problems.当看到 Xcode 异常时,删除缓存是一种很好的广谱抗生素方法,并且可以在诊断 Xcode 问题时节省大量时间。

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

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