Step Out Button moves into thread memory display?

Hi there. So, after buying the books ages ago, I’m finally getting down to working through it. I’m working on the temperature control project as part of the KVO/KVC chapter, and have followed along step-by-step, mostly with positive results. Where I’m getting confused at this particular moment is around the “Step Out” button in the debugger. The book says that clicking this will go to the next line in the function that called the function in which the breakpoint was set. However, when I click the “Step Out” button, it takes me to a window of what looks to me like memory addresses and assembler code, or something along those lines.

What am I doing wrong, please?

From your description, it looks like the program has crashed and the call-frame stack is corrupted, so the debugger is unable to find the line of code following the function call.

Thanks for the suggestion, but I don’t think it’s that. The program is very simple-it’s just the temperature controller example from chapter 8, which I’ve transcribed. But also, if I keep hitting the Step Out button (or Step Over, etc.), I eventually return to normal program flow. Just for some reason, it just seems to go into some weird low-level detailed disassembly view.

It’s like it’s going up the object stack or something (sorry if I’m not using the right terminology). Each one seems to be a different function for a different class (NSGetLongLongValueWithMethod, Foundation-[NSObject(NSKeyValueCoding) valueForKey:], AppKit-[NSBinder valueForBinding:resolveMarkersToPlaceholders:]:, etc. with each Step Out click). Eventually it goes back to my code, but is there any way to skip the disassembly phase? Under the Debug menu > Debug Workflow, "Always Show Disassembly is unchecked.

My apologies. Now, I can explain what’s happening

As you can see from the call-frame stack, by the time the program reaches the breakpoint it has travelled a long way, starting from the code that handled the event triggered by the UI action. As you say, if you keep stepping out, it goes back to your code.

Each time you step out, the program is climbing up the call-frame stack. That is, it is returning to the previous call site.

Now for the reason you are seeing the assembly code. The debugger does not have access to the source code of the modules in the cocoa libraries, and the libraries have been built for release not for debug.

To skip the disassembly phase, you can tell the debugger to continue the program execution instead of stepping out.

Hey, sorry, completely forgot to come back and say thank you. That makes some sense, though I wish there were a way to just go to the next line in my own code, and not go back out through all the system functions.