在 Xcode 中设置断点会导致光标转到随机行

发布于 2024-10-02 23:03:05 字数 82 浏览 6 评论 0原文

每当我在 Xcode 中使用装订线设置断点时,我的光标就会跳转到随机的代码行,通常是断点上方 10-20 行。它为什么要这样做?这很烦人... 谢谢。

Whenever i set a breakpoint in Xcode, using the gutter, my cursor jumps to a random line of code, typically, 10-20 lines above the breakpoint. Why is it doing this? It is very annoying...
Thanks.

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

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

发布评论

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

评论(3

香橙ぽ 2024-10-09 23:03:05

当您在调试版本中打开各种优化时,通常会发生这种情况。调试版本不应进行优化。我这里列出了可能的原因。它们减少到确保:

  • “复制期间剥离调试符号”未选中。

  • “生成调试符号”已选中。

  • “优化级别”设置为“无 [-O0]”。

  • “使用单独的条带”未选中。

  • “附加条带标志”没有设置任何内容(如果不运行条带,我认为这并不重要)。

  • “展开循环”未选中

  • 所有单个文件都没有附加与优化相关的(如 -funroll_loops)标志。

我的帖子中提供了更多详细信息。

This typically happens when you turn on various optimizations in your debug build. Debug builds should have no optimization. I have a list of possible causes here. They reduce to making sure:

  • "Strip Debug Symbols During Copy" is unchecked.

  • "Generate Debug Symbols" is checked.

  • "Optimization Level" is set to "None [-O0]".

  • "Use Separate Strip" is unchecked.

  • "Additional Strip Flags" has nothing set (I don’t think this matters if strip isn't run).

  • "Unroll Loops" is unchecked

  • None of the individual files have optimization-related (like -funroll_loops) flags attached.

More detail is provided in my post.

人心善变 2024-10-09 23:03:05

AFAIK 它是二进制编译器优化的跳跃原因(光标位置遵循相对代码指令)。尝试在不进行优化的情况下构建项目,然后再次尝试调试。

因为我还不是这方面的专家。我可能错了。

AFAIK it's jumping cause of compiler optimizations (cursor position follows relative code instruction) in binary. Try building your project without optimizations and try debugging again.

Since i'm not a guru at this yet. I may be wrong.

猛虎独行 2024-10-09 23:03:05

我尝试了上面提到的调试器配置,仍然得到跳跃效果。我发现有效的是打开所有折叠的代码(方法、代码块和注释块),并且设置断点时跳转光标的问题消失了。打开折叠代码的快捷方式是 ctrl + cmd + 向下箭头。不幸的是,评论阻止你一次只能做一个。我认为这很痛苦,几乎宁愿只处理断点的跳转,也不愿打开我折叠的代码。

I tried the debugger configuration mentioned above and still get the jumping effect. What I have found works is opening up all my collapsed code (methods, code blocks, and comment blocks) and the problem of the jumping cursor on setting breakpoints goes away. The shortcut to open collapsed code is ctrl + cmd + down arrow. Unfortunately, the comment blocks you have to do one at a time. I think this is a pain and almost would rather just deal with the jumping of the breakpoints than opening up my collapsed code.

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