[Ironruby-core] Determining line number of runtime errors

Curt Hagenlocher curth at microsoft.com
Tue Dec 16 11:44:12 EST 2008


I think the logic for this is all in RubyExceptionData.cs.  You should be able to use RubyExceptionData.GetInstance to get a RubyExceptionData object for the thrown exception and then access the Backtrace property on this object to get the frame information.

-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Benjamin van der Veen
Sent: Tuesday, December 16, 2008 12:42 AM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Determining line number of runtime errors

Curt Hagenlocher wrote:
>>From the hosting interface, you need to manually set RuntimeSetup.DebugMode = true when creating the ScriptRuntime.

I saw that option and enabled it (this is what the -D flag does in
ir.exe), but I'm not sure where I get the line number when an error
occurs. I haven't had a chance to sit down to study the source of ir.exe
to see how it does it, but just by browsing through intellisense and
using the immediate window in VS, I couldn't find any relevant
properties (or properties of properties) on the thrown exception or any
of the other objects involved (the runtime, the engine, the scope, or
the source). I must be missing something. Any ideas?

Thanks,
benjamin
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core



More information about the Ironruby-core mailing list