Hi all, I''ve been following IR since pre-alpha and have enjoyed being able to play with .NET within Ruby. Since the beginning, the one thing that I''ve been most looking forward to has been debugging. I''ve seen that some debugging might already be in the current SVN rev (a blog post by John & I think revision notes too). Is this true? If so, how can I debug ruby code? I''m using VS 2008. Thanks for any help, Noon
Jeff Siebold:> I''ve been following IR since pre-alpha and have enjoyed being able to > play with .NET within Ruby. Since the beginning, the one thing that > I''ve been most looking forward to has been debugging. I''ve seen that > some debugging might already be in the current SVN rev (a blog post by > John & I think revision notes too). Is this true? If so, how can I > debug ruby code? I''m using VS 2008.Debugging support works today in Silverlight as long as you have the Silverlight tools for VS installed. It should just work on desktop CLR as well. Now ''just work'' means that our source spans aren''t defined precisely which means that stepping over individual statements and in conditionals is, um, weird. But it does hit breakpoints and show locals and the call stack correctly, but I wouldn''t really use it for real until we fix how we generate sequence points. Thanks, -John
"It should just work" means you open IronRuby.sln, the Ruby source file you want to debug, place a breakpoint and run Ruby.Console project with the source file path on the command line. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (DLR) Sent: Thursday, March 27, 2008 6:47 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] debugging IR Jeff Siebold:> I''ve been following IR since pre-alpha and have enjoyed being able to > play with .NET within Ruby. Since the beginning, the one thing that > I''ve been most looking forward to has been debugging. I''ve seen that > some debugging might already be in the current SVN rev (a blog post by > John & I think revision notes too). Is this true? If so, how can I > debug ruby code? I''m using VS 2008.Debugging support works today in Silverlight as long as you have the Silverlight tools for VS installed. It should just work on desktop CLR as well. Now ''just work'' means that our source spans aren''t defined precisely which means that stepping over individual statements and in conditionals is, um, weird. But it does hit breakpoints and show locals and the call stack correctly, but I wouldn''t really use it for real until we fix how we generate sequence points. Thanks, -John _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
I have been embedding IronRuby to our WPF C# application, so I am not starting rbx but rather doing calls like: MyEngine.CreateScriptSourceFromFile("MyRuby.rb").Execute(MyScope); Any hope for me to get to use the nice new debugging goodies? :-) I did install the silverlight VS extension, included MyRuby.rb to my C# project and placed breakpoint there, but that did not seem to be enough to have execution stopping there :-( Robert Brotherus -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: 28. maaliskuuta 2008 4:25 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] debugging IR "It should just work" means you open IronRuby.sln, the Ruby source file you want to debug, place a breakpoint and run Ruby.Console project with the source file path on the command line. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (DLR) Sent: Thursday, March 27, 2008 6:47 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] debugging IR Jeff Siebold:> I''ve been following IR since pre-alpha and have enjoyed being able to > play with .NET within Ruby. Since the beginning, the one thing that > I''ve been most looking forward to has been debugging. I''ve seen that > some debugging might already be in the current SVN rev (a blog post by> John & I think revision notes too). Is this true? If so, how can I > debug ruby code? I''m using VS 2008.Debugging support works today in Silverlight as long as you have the Silverlight tools for VS installed. It should just work on desktop CLR as well. Now ''just work'' means that our source spans aren''t defined precisely which means that stepping over individual statements and in conditionals is, um, weird. But it does hit breakpoints and show locals and the call stack correctly, but I wouldn''t really use it for real until we fix how we generate sequence points. Thanks, -John _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
You have to explicitly tell the DLR to generate "debuggable" code. ScriptRuntime env = ScriptRuntime.Create(setup); env.GlobalOptions.DebugMode = true; ScriptEngine MyEngine = env.GetEngineByFileExtension("rb"); // ... MyEngine.CreateScriptSourceFromFile("MyRuby.rb").Execute(MyScope); Disclaimer: compiled by brain =P ~js On 3/31/08 12:44 AM, "Robert Brotherus" <robert.brotherus at napa.fi> wrote: I have been embedding IronRuby to our WPF C# application, so I am not starting rbx but rather doing calls like: MyEngine.CreateScriptSourceFromFile("MyRuby.rb").Execute(MyScope); Any hope for me to get to use the nice new debugging goodies? :-) I did install the silverlight VS extension, included MyRuby.rb to my C# project and placed breakpoint there, but that did not seem to be enough to have execution stopping there :-( Robert Brotherus -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: 28. maaliskuuta 2008 4:25 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] debugging IR "It should just work" means you open IronRuby.sln, the Ruby source file you want to debug, place a breakpoint and run Ruby.Console project with the source file path on the command line. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (DLR) Sent: Thursday, March 27, 2008 6:47 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] debugging IR Jeff Siebold:> I''ve been following IR since pre-alpha and have enjoyed being able to > play with .NET within Ruby. Since the beginning, the one thing that > I''ve been most looking forward to has been debugging. I''ve seen that > some debugging might already be in the current SVN rev (a blog post by> John & I think revision notes too). Is this true? If so, how can I > debug ruby code? I''m using VS 2008.Debugging support works today in Silverlight as long as you have the Silverlight tools for VS installed. It should just work on desktop CLR as well. Now ''just work'' means that our source spans aren''t defined precisely which means that stepping over individual statements and in conditionals is, um, weird. But it does hit breakpoints and show locals and the call stack correctly, but I wouldn''t really use it for real until we fix how we generate sequence points. Thanks, -John _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080331/26a8ea1d/attachment.html
This is working fine, thanks! Weird spans and conditionals are a minor issue compared to the pain of no debugging at all :-) John:> But it does hit breakpoints and show locals and the call stackcorrectly Regarding the local variables I did not see any directly in the "Locals" table of Visual Studio, but I was able to dig them up from $frame -> Scope -> Dict -> SymbolAttributes Robert Brotherus Software architect Napa Ltd Email: Robert.Brotherus at napa.fi <mailto:Robert.Brotherus at napa.fi> www.napa.fi <http://www.napa.fi/> _____ From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jimmy Schementi Sent: 31. maaliskuuta 2008 13:31 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] debugging IR You have to explicitly tell the DLR to generate "debuggable" code. ScriptRuntime env = ScriptRuntime.Create(setup); env.GlobalOptions.DebugMode = true; ScriptEngine MyEngine = env.GetEngineByFileExtension("rb"); // ... MyEngine.CreateScriptSourceFromFile("MyRuby.rb").Execute(MyScope); Disclaimer: compiled by brain =P ~js On 3/31/08 12:44 AM, "Robert Brotherus" <robert.brotherus at napa.fi> wrote: I have been embedding IronRuby to our WPF C# application, so I am not starting rbx but rather doing calls like: MyEngine.CreateScriptSourceFromFile("MyRuby.rb").Execute(MyScope); Any hope for me to get to use the nice new debugging goodies? :-) I did install the silverlight VS extension, included MyRuby.rb to my C# project and placed breakpoint there, but that did not seem to be enough to have execution stopping there :-( Robert Brotherus -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (DLR) Sent: Thursday, March 27, 2008 6:47 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] debugging IR Debugging support works today in Silverlight as long as you have the Silverlight tools for VS installed. It should just work on desktop CLR as well. Now ''just work'' means that our source spans aren''t defined precisely which means that stepping over individual statements and in conditionals is, um, weird. But it does hit breakpoints and show locals and the call stack correctly, but I wouldn''t really use it for real until we fix how we generate sequence points. Thanks, -John -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080402/2e2bb71e/attachment.html
> Regarding the local variables I did not see any directly in the > "Locals" > table of Visual Studio, but I was able to dig them up from $frame -> > Scope -> Dict -> SymbolAttributesAh yes- I think this is Tomas'' fault due to his latest change in local scopes that are part of the work required to get eval and friends working. I''ll let him defend himself here :) Thanks, -John
No defense available :) More changes coming soon. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (DLR) Sent: Wednesday, April 02, 2008 6:36 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] debugging IR> Regarding the local variables I did not see any directly in the > "Locals" > table of Visual Studio, but I was able to dig them up from $frame -> > Scope -> Dict -> SymbolAttributesAh yes- I think this is Tomas'' fault due to his latest change in local scopes that are part of the work required to get eval and friends working. I''ll let him defend himself here :) Thanks, -John _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
I return to this debugging issue briefly since in the recent IronRuby SVN versions the variable viewing support has been on decline. John Lam (DLR) Sent: Thursday, March 27, 2008 6:47 PM:> Debugging support works today in Silverlight as long as you have the > Silverlight tools for VS installed. It should just work on desktop CLRas well.> Now ''just work'' means [...] it does hit breakpoints and show localsand the call> stack correctlyRobert Brotherus wrote 2008-04-02:> This is working fine, thanks! > Weird spans and conditionals are a minor issue compared to the pain ofno debugging at all :-)> Regarding the local variables I did not see any directly in the"Locals" table of Visual Studio,> but I was able to dig them up from $frame -> Scope -> Dict ->SymbolAttributes Now that was the situation with the IronRuby SVN current version of 2008-04-02 (can''t remember the number). Things have been taking a slight step backwards with the recent SVN versions (at least already in v. 96). Now it seems that $frame->Scope is always null, so I cannot dig the locals from there (nor are they yet available as top-level symbols either) :-( I understand debugging is not a priority of the IR team, but I wonder if it would be a quick fix to restore the locals to be visible in *some* way, direct or indirect? Or alternatively tell me how to dig them up with the v. 99? Robert Brotherus Software architect Napa Ltd Tammasaarenkatu 3, Helsinki FI-00180 P.O.Box 470, Helsinki FI-00181 Tel. +358 9 22 813 1 Direct. +358 9 22 813 611 GSM +358 45 11 456 02 Fax. +358 9 22 813 800 Email: Robert.Brotherus at napa.fi www.napa.fi