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-boun...@rubyforge.org 
[mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Benjamin van der Veen
Sent: Tuesday, December 16, 2008 12:42 AM
To: ironruby-core@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@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to