Xcode debugger never returns

This is a bit hard to explain but since upgrading to xcode 9.0/.01, often when I am stepping through code, xcode will never come back. That is, I am at a break point in the debugger and I start stepping through code. At some point, I'll do a step (either into a method or over) and then it just never returns control to the debugger. It appears that the code is still stopped but xcode just doesn't recognize it. I say that since if I have log statements that would've shown had the code continue to execute, they're never displayed.


Has anyone else seen this?

Thanks,

//Ray

Aside from a possible bug in the way Xcode and the debugger communicate, it's possible that the actual state of things is obscured. For example, if the is really stopped (still or again), it might no longer be displaying the place where it was before the step.


When it gets into this state, does Xcode think it's paused? That is, what is the state of the Pause/Continue button in the debug bar? Is there a stack backtrace shown? Can you enter debugger commands still? If you type Command-Shift-D, does the source code show a different piece of code?


If Xcode thinks it's running, what happens if you pause it? Where is the current execution location when you do that?

Great questions and thanks for the help. To answer:

- When it's in this state, xcode doesn't think it's paused. The debug bar is exactly like it is when normal running (pause button enabled and step buttons disabled) as well as Debug menu items (Pause is only enabled menu).

- No backtrace is shown. Again as if I hit continue and it hasn't yet hit another break point.

- I can't enter debug commands in this state.

- Command-****-D shows "No selection" in right side property view.

- Pausing breaks in the event loop.


One thing I should've mentioned is that I've only noticed this when debugging a background thread but haven't done much, if any, debugging on the main thread in a while to know if it's related. Also when it happens, the app becomes non-responsive so I need to kill and start again.

How do you have your Xcode window set up? Is Xcode running in a window in the same space as the app? What happens if you run Xcode full-screen (which moves it to its own temporary space)?


In the past, I've seen Xcode get itself all tangled up in some kind of modal way, perhaps because Xcode's event loop handling interferes with the app's. Running in a separate space (which I what I always do) seems to avoid this. Note that you can use (it's a system default, if not changed) Control-Up Arrow to see all your spaces, and Control-Left/Right Arrow to switch between spaces.


If that doesn't help, try with a brand new project with no added code. If that fails, you have a test scenario for a bug report. If not, then it suggests something specific to your project.


You can also try doing a full clean (Option + Clean from the Product menu) to force all of the debugging information to be rebuilt.

Xcode debugger never returns
 
 
Q