SapphireSteel Software

 

  -  
     
     
     
  -  
     
     
     
  -  
     
     
     
  -  
     
     
     
  -  
     
     
     
     

 

  rss
RSS (SITE)
 
  rss
RSS (BLOG ONLY)
 
   
 
 
     

 

Section :: Ruby In Steel Archives
- Format For Printing...
Guide To Steel Features

Debugging Ruby

by Huw Collingbourne
A Quick Reference to Debugging with Steel
Tuesday 4 July 2006.
 
Follow this guide to use the debugging features of Steel

Breakpoints

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.

Locals window

The Locals window automatically monitors and displays the values of local variables.

Watch Window

You can enter the names of variables (or drag and drop variables from the editor window) in the Watch pane.

Call Stack

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.

Error List

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

Arguments can be passed to a program (but not yet to the Ruby interpreter) in the Properties panel.

AddThis Social Bookmark Button

Forum

  • Debugging Ruby
    18 July 2006, by Bassman
    Hi all looks very impressive for debugging Ruby but I cannot see how you debug a Rails app. I use the start Rails->Start Server command to start WEBrick, and using the browser I can run the app. But setting breakpoints in steel has no effect on the WEBrick ruby app, and if I try to run the Rails app from steel using Ctrl-F5 I get NameError (uninitialized constant Rails) errors. Can you debug Rails apps? if so please give us a quick walkthrough
    • Debugging Ruby
      18 July 2006, by Dermot
      Debugging Rails is a different ballgame to straight Ruby. Rails just doesn’t work like a simple Ruby command. We will be incorporating a Rails debugger into Steel in the future, but right now all you can use is the standard Rails breakpoint command.

 

© 2008 SapphireSteel Software. All rights reserved