Xcode 10: Debugger takes me to top of file

While debugging when i hit a breakpoint, I would expect the editor to change to show where im stoped, but instead my view isnt changed to be at the breakpoint, but rather at the top of the file, I have to scroll down the file to the breakpoint.


Is this some setting or an issue with xcode 10?

Replies

Is this specific to one specific file? Or one specific project? If you create a new test project using one of the built-in templates, does the problem replicate?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I face the same issue. Every break point thats hit shows me the top of the file that contains the breakpoint. This is reproducable on one specific project.

One possible reason for this kind of behavior is that you're debugging a Release build configuration, or you've set your Debug build to do optimization. In that case, the optimizer can move code around, which means the debugger has trouble associated the actual code location with the original source line number.

They broke something related to scrolling. I see this behavior when navigating using the Go Back action (the < at the top of the editor pane). Many times it totally forgets where the scroll position should be and defaults to the top of the file. Didn't have this problem with previous Xcode versions. I'm on 10.1.