[Yarv-devel] backtrace format

SASADA Koichi ko1 at atdot.net
Fri Jul 29 04:49:47 EDT 2005


Hi,

I'm writing a backtrace function.

---------------------------------------------
def m enum
  enum.map{
    yield
  }
end

begin
  m(1..3){
    raise
  }
rescue => e
  puts e.backtrace
end
-------------------------------------------

on above program, each backtrace is follows:

YARV:------------------------
../test.rb:19:in `raise'
../test.rb:19:in `b@<main>'
../test.rb:13:in `b at m'
../test.rb:12:in `each'
../test.rb:12:in `map'
../test.rb:12:in `m'
../test.rb:18:in `<main>'


Ruby:------------------------
../test.rb:19
../test.rb:18:in `m'
../test.rb:12:in `map'   <---- (*)
../test.rb:12:in `each'
../test.rb:12:in `map'
../test.rb:12:in `m'
../test.rb:18


-------------------------------------------

In YARV backtrace notation, following points are different to ruby's.

1) <main> as top level
2) "b at ..." means block in "..."
3) eliminate (*) part
   this stack frame is for C block (NODE_IFUNC)
4) "raise" stack frame is shown


4) will be vanished (it's temporalily).

What do you think about other points?  YARV should make ruby's backtrace
notation?


-- 
// SASADA Koichi at atdot dot net
//



More information about the Yarv-devel mailing list