[Ironruby-core] Debugging rubyspecs

Shri Borde Shri.Borde at microsoft.com
Wed Feb 18 12:58:51 EST 2009

Here is what I added to http://wiki.github.com/ironruby/ironruby. This works pretty well for me. If the paths are incorrect, feel free to update the wiki.

Debugging with Visual Studio
In the Debug tab of the Project properties for Ruby.Console.csproj, set the fields as follows:

 *   Start Action: For Ruby.Console.csproj, "Start project" should be enabled.
For any other project, "Start external program:" should be enabled and set to "c:\vsl\Merlin\Main\Bin\Debug\ir.exe"

 *   Start Options: "Command line arguments" should be set to the following for running the "supports /i for ignoring case" example of string\gsub_spec.rb:
-v -X:Interpret c:/vsl/Merlin/External/Languages/IronRuby/mspec/mspec/bin/mspec-run -e "supports /i for ignoring case" -fs -V -B c:/vsl/Merlin/External/Languages/IronRuby/mspec/default.mspec c:/vsl/Merlin/External/Languages/IronRuby/mspec/rubyspec/1.8/core/string/gsub_spec.rb
Hitting F5 should now run the single RubySpec example under VS


From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi
Sent: Wednesday, February 18, 2009 8:52 AM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Debugging rubyspecs

You can pass the spec file to mspec itself like:

mspec run core/io/popen_close

Then I make a call to "debugger" http://gist.github.com/61605, which breaks on a call to System::Diagnostics::Debugger when a debugger is attached to the app. Unfortunately this breaks in a Ruby method, so you have to jump up a couple CLR frames to get to the line directly after the "debugger" call, and I'm not sure of a way how to do that automatically. Anyway, this works great.


From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pete Bacon Darwin
Sent: Wednesday, February 18, 2009 8:11 AM
To: 'Pete Bacon Darwin'; ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Debugging rubyspecs

The easiest way it appears is to stick a pause in the rubyspec of interest and attach to the process while it is waiting.  It does totally kill the computer performance while you are debugging (like minutes to step through each line!)

From: Pete Bacon Darwin [mailto:bacondarwin at googlemail.com]
Sent: Wednesday,18 February 18, 2009 15:19
To: 'ironruby-core at rubyforge.org'
Subject: Debugging rubyspecs

Anybody know how to run rubyspecs under the Visual Studio debugger?  If I just set the rubyspec file as the command line argument in the debug properties in VS then it just asks me to install mspec as a gem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090218/276a570f/attachment.html>

More information about the Ironruby-core mailing list