Xcode 断点在运行时移动

发布于 2024-08-23 09:44:48 字数 283 浏览 7 评论 0原文

我在这里和谷歌上搜索了大约一个小时,但找不到关于运行期间如何移动正确断点的答案。我已经重新安装了 Xcode(3.2.2),确保延迟加载已关闭,目标设置没有优化,以及可能导致问题的所有其他目标设置。我还销毁了所有用户项目文件(除了主 .pro 文件),似乎没有任何方法可以纠正此问题。是的,我正在运行断点。是的,我已经完成了干净的构建。

当我设置断点时,在调试器中,断点会停止源代码中的两行或三行(或更多行),单步执行继续显示错误的行。此外,在调试器窗口中,深蓝色断点符号消失了,它确实出现在编辑器窗口中。

这让我抓狂。

I have been searching for an hour or so here and on Google and cant find the answer as to how correct breakpoints being shifted during run. I have reinstalled Xcode(3.2.2), insured load lazily is off, no optimization in target settings, and every other target setting that might cause the problem. I have also destroyed all of the user project files (except for the main .pro file) and nothing seems to correct this. Yes, I am running with breakpoints on. Yes, I have done clean builds.

When I set a breakpoint, in the debugger the break stops two or 3 (or more lines) down in the source code, single stepping continues to show the wrong line. Also, in the debugger window the dark blue breakpoint symbol is gone, it does appear in an editor window.

This is driving me batty.

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

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

发布评论

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

评论(3

仙气飘飘 2024-08-30 09:44:48

我遇到了类似的问题(断点奇怪地移动),但我的问题是我设置了错误的目标,所以我正在修改和设置断点的代码甚至没有被重建!但可执行文件仍然会使用旧代码运行,从而导致断点出现奇怪的移动。

I had a similar problem (weirdly shifted breakpoints) but my issue turned out to be that I had the wrong target set, so the code I was modifying and setting breakpoints on wasn't even being rebuilt! But the executable would still run, using the old code, leading to what appeared to be oddly shifted breakpoints.

醉态萌生 2024-08-30 09:44:48

有时,当您的源文件具有不一致的行结尾时,Xcode 会对行编号感到困惑,例如,因为您一直在使用不同的编辑器,并且源文件中可能混合有不同的行结尾。您可以使用 BBEdit 或其免费同级工具 TextWrangler 等工具来解决此问题。

Sometimes Xcode gets confused about line numbering when your source files have inconsistent line endings, e.g. because you've been using different editors and may have a mixture of different line endings in your source file. You can use a tool like BBEdit or its free sibling TextWrangler to fix this problem.

岛歌少女 2024-08-30 09:44:48

在项目目标下的“构建设置”中,将“调试”的“优化级别”更改为“无”。

我发现这解决了我的问题。

With-in "Build Settings" under the project target change the "Optimization Level" for "Debug" to "None".

I found that this fixed the issue for me.

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