开发者

Xcode 4: debugging does not highlight current line in source code

开发者 https://www.devze.com 2023-03-28 21:59 出处:网络
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

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.

开发者_StackOverflow社区

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.


You can click on the sign in order to hight the line:

Xcode 4: debugging does not highlight current line in source code

click

Xcode 4: debugging does not highlight current line in source code


Finally found it. Culprit was this line in the source file:

#line __LINE__ "MainController.m"

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消