Xcode 4:调试不会突出显示源代码中的当前行
我刚刚从 App Store 重新安装了 Xcode 4,但仍然存在同样的问题:
当调试器遇到断点时,程序会停止并显示堆栈跟踪。但是,源代码中的该行并未突出显示。
我尝试单击堆栈跟踪中的各个条目并单步执行代码 - 没有突出显示。
编辑:
我想我找到了原因(但还没有解决方案):我已将源文件组织到子目录中。每个子目录都映射到 Xcode 中的一个组。我敢打赌 Xcode 只检查项目目录中的源文件而不是子目录。
我的布局:
./Project Dir
Classes/
Group1/
Class.m
Group2/
AnotherClass.m
...
编辑2:
我刚刚注意到调试器确实突出显示了main.m
中的行,但没有突出显示任何其他源文件中的行。
I just reinstalled Xcode 4 from the App Store, but still the same issue:
When the debugger hits a break point the program stops and shows the stack trace. However, the line in the source code is not highlighted.
I tried clicking on various entries in the stack trace and stepped through the code - no highlighting.
EDIT:
I think I found the reason (but not solution yet): I have organized the source files into sub-directories. Each sub-directory is mapped to a group in Xcode. I bet Xcode checks only the project directory for source files not sub-directories.
My layout:
./Project Dir
Classes/
Group1/
Class.m
Group2/
AnotherClass.m
...
EDIT 2:
I just noticed that the debugger does highlight the line in main.m
, but not in any other source file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以点击标志来拉高队伍:
单击
You can click on the sign in order to hight the line:
click
终于找到了。罪魁祸首是源文件中的这一行:
事实证明,这让 Xcode 感到困惑,我认为 Xcode 不会再找到该文件来突出显示断点的当前行。
预处理器定义的目的是缩短日志语句,当使用 __FILE__ 宏时,日志语句将包含文件的完整路径。
Finally found it. Culprit was this line in the source file:
Turns out that this confuses Xcode and I assume because of that Xcode won't find the file anymore to highlight the current line of a breakpoint.
The purpose of the preprocessor definition was to shorten log statements, which would contain the full path to the file in log statements when using the
__FILE__
macro.