[Ironruby-core] Backtrace supported?

Tomas Matousek Tomas.Matousek at microsoft.com
Sun Sep 28 22:47:18 EDT 2008


Could you sent the script where you see the behavior? What parameters do you pass on command line?

I tried this and it works:

a.rb:

def foo
  bar
end

def bar
  raise
end

begin
  foo
rescue
  p $!
  puts $!.backtrace
end


C:\Temp>ir -D a.rb
#<RuntimeError: RuntimeError>
a.rb:6:in `bar'
a.rb:2:in `foo'
a.rb:10

Tomas

-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville
Sent: Sunday, September 28, 2008 6:51 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Backtrace supported?

Yeah, they are a work in progress. Backtrace is probably hard to spec because it may differ implementation to implementation.

JD

-----Original Message-----
From: Ben Hall <ben2004uk at googlemail.com>
Sent: September 28, 2008 2:57 PM
To: ironruby-core at rubyforge.org <ironruby-core at rubyforge.org>
Subject: Re: [Ironruby-core] Backtrace supported?


Hi Jim,

Sorry, I got confused by your tests and RubySpecs

E:\IronRuby\trunk\build\release>rake mspec:core Exception
(in E:/IronRuby/trunk)
........................................

Finished in 8.744558 seconds

21 files, 40 examples, 40 expectations, 0 failures, 0 errors

However, I had a quick look at what was included.  backtrace_spec.rb
is empty.  Git commit notification seems to imply its waiting for
someone to write it :)

Are many of the specs empty? I assume they are a work in progress...

Thanks

Ben

On Sun, Sep 28, 2008 at 7:55 PM, Jim Deville <jdeville at microsoft.com> wrote:
> I don't know if its implemented yet, but you should also check the RubySpecs to se what is tested.
>
> -----Original Message-----
> From: Ben Hall <ben2004uk at googlemail.com>
> Sent: September 28, 2008 4:19 AM
> To: ironruby-core at rubyforge.org <ironruby-core at rubyforge.org>
> Subject: [Ironruby-core] Backtrace supported?
>
>
> Hello,
>
> I was just wondering if backtrace was supported yet with Exceptions.
>
> In my code, I had this:
> rescue Exception => e
>
> However, the backtrace is always nil.
>
> puts e
> puts e.backtrace.nil?
>
> Is this a known issue?  Is there anyway to find out what is \ isn't
> implemented yet?
>
> trunk\tests\ironruby\Runtime\Exception spec's don't seem to cover backtrace.
>
> Thanks
>
> Ben
> _______________________________________________
> 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

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



More information about the Ironruby-core mailing list