I was debugging my code and thought about a possibility of automatic stepping over or Step into line by line in the xCode debug mode. It would be more efficient to see the way the code will be executed line by line without clicking for every next step. Maybe theres a way you can set a timer for every next step. I was searching for something like that but there are too many posts for the debug mode which just explain the basic stuff.
Asked
Active
Viewed 4,874 times
1 Answers
5
Maybe I'm not understanding the question, but the three key buttons are:
- "Step over", F6, continuing execution but stopping at the next line of code (but not single stepping through the method that the current line of code references);
- "Step into", F7, continuing execution but stopping at the first line of code in the method your current line of code references;
- "Step out", F8, continuing execution but stopping at code that called current method.
See Control Program Execution of the Xcode Users Guide.
The other obvious technique is judicious use of setting breakpoints or setting "watch point" (i.e. have the debugger automatically pause whenever a particular variable changes).
Probably worth seeing Debugging in Xcode WWDC 2012 video

Rob
- 415,655
- 72
- 787
- 1,044
-
F6 is the shortcut key for step over – bengoesboom Jun 03 '13 at 22:40
-
@bengoesboom Good point re keyboard short cuts. I've added that to my answer. If he's looking for more efficient interaction with the debugger, shortcuts are part of that equation (that and judicious breakpoints and watch points). – Rob Jun 03 '13 at 23:18
-
1@Rob Thx for the link to the WWDC videos, very interesting. The Shortcuts are also better than clicking with the mouse all the time, but I thought about an automatic step by step where you can watch the way through the code and maybe stop at a specific point. – Alex Cio Jun 04 '13 at 14:11
-
1@xandruCea Yeah, I get what you're looking for. I don't know of any way to do that. Personally, I suspect that you'd quickly find that "slow single-step" frustrating. Debugging is generally, (a) stop at breakpoint; (b) step through the few lines; (c) carefully examine a few variables; (d) conclude the problem rests elsewhere, so continue execution, only stopping at the next breakpoint; (d) repeat. So, I get your "slow single-step" idea, but in practice, jumping from breakpoint to breakpoint, using keyboard to step through a few suspect lines at each, is probably more efficient. – Rob Jun 04 '13 at 14:24
-
1@Rob Normally thats no problem because fast debugging won't help to find a problem. It was just an idea while stepping through code. And if there are any bugs you can't step through like this...., maybe I find something or somebody else has an idea, otherwise the issue is solved – Alex Cio Jun 04 '13 at 14:41