Ruby In Steel ArchivesBack to Ruby In Steel Archives
Follow this guide to use the debugging features of Steel
Steel lets you add breakpoints to your Ruby programs by clicking in the margin of selected code lines. You can selectively enable/disable selected (or all) breakpoints in this breakpoints window. You can also remove an existing breakpoint by clicking it in the margin.
The Locals window automatically monitors and displays the values of local variables.
You can enter the names of variables (or drag and drop variables from the editor window) in the Watch pane.
When your code is running several methods deep you can see this instantly in the Call Stack pane.
Tracing with Step Into / Step Over
When you hit a breakpoint, press F10 to continue tracing through the current block of code (Step Over) or F11 to trace into any methods called by the current code (Step Into).
Run To Cursor
Right-click a line of source code and select ‘Run To Cursor’ from the popup menu. Your program will pause on the selected line and you can then use the debugging features (trace, watch etc.)
Interactive Debugging console
The interactive console not only display the output from the program you are debugging; it also lets you evaluate expressions (when debugging and, for example, paused at a breakpoint) – for instance, enter the name of an object to inspect it or call a specific method to see the return value.
This will now gather together any syntax errors in the Error List pane. This shows each error message, the name of the file in which it occurs and the line on which Ruby believes the syntax error to have occurred. Click the error item to locate the problem line of code.
Arguments can be passed to a program (but not yet to the Ruby interpreter) in the Properties panel.