LNS Home
Script Debugger
Download & Buy
x Explore
x Edit
x Run & Debug
x Deploy
What's New In 4.5
bullet Documentation
bullet Blog Posts
My SD Story
Software Updates
 
4.0.9 Update
3.0.9 Update
bullet 2.0.5 Update
x Free Downloads
 
XML Tools
XSLT Tools
x Property List Tools
x List & Record Tools
Register Your Copy of Script Debugger
Join the Script Debugger Mailing List
x AppleScript/ Scripting Links
Products
x Script Debugger 4.5
Site Contents
bullet Mark’s Blog
Product Registration
Bug Reporting
x Freeware
Contacting Us

SD4 Headling


image

Step

image

There are three Step commands — Step Over, Step Into, and Step Out. You can choose them from the Script menu or click the buttons in the toolbar. We’ll use the code in the illustration below to show what they mean. In the illustration, we are paused at a breakpoint at line 9 (without yet having executed line 9).

image
  • Step Into is the simplest. It means, “Execute the current line of code, and then, wherever the path of execution takes you, pause right there, on the next line that would be executed.”

    So, in the illustration above, Step Into would cause the script to pause at line 5. Why? Because line 9, where we are paused, calls the pad handler. So when we execute it, we’ll dive into the pad handler, and the next executable line where we can pause, in that path of execution, is line 5.

  • Step Over is similar to Step Into, except that it follows an additional rule, “Don’t pause in a deeper level of the call stack than where you are right now.”

    So, in the illustration above, Step Over would cause the script to pause at line 10. Why? Because that’s the next executable line that isn’t at a deeper level. Line 9, where we are paused, calls the pad handler, which is a deeper level, so we don’t pause until the next executable line after the path of execution has returned from the pad handler.

  • Step Out means, “Execute until you come to the next executable line at a higher level of the call stack than where you are right now, and then pause.”

    So, in the illustration above, Step Out would cause the script to pause at line 13. Why? We are paused at line 9, in s’s implicit run handler. We execute to the end of the run handler, which is line 10, and return from s’s implicit run handler. Now we are at a high level, so we want to pause. In fact, we are in line 12, because that is where s’s run handler was called. But we don’t pause in line 12, because if we were going to pause there, it would be before executing line 12 and before telling s to run. So now we’re at line 13.

All of those details are predicated on the supposition that no breakpoints are encountered. Suppose, for example, that there were a breakpoint at line 5 (and assume that Script > Break on Breakpoints is checked). The path of execution passes through line 5, so all three commands would do exactly the same thing — pause at line 5. Breakpoints take priority over everything!

Both Step Over and Step Into can be used not only to resume but also to start execution of a script. In this case they both pause before the first executable line of the script.

Both Step Over and Step Into have the same options for executing handlers as the Execute button.



Explore | Edit | Run & Debug | Deploy | What's New In 4.5 | My SD Story


Copyright © 1998-2009 Late Night Software Ltd. - All Rights Reserved.