The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Inliners are Hard to Debug

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Eric Hodel

Posts: 660
Nickname: drbrain
Registered: Mar, 2006

Eric Hodel is a long-time Rubyist and co-founder of Seattle.rb.
Inliners are Hard to Debug Posted: Jul 1, 2007 3:32 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Eric Hodel.
Original Post: Inliners are Hard to Debug
Feed Title: Segment7
Feed URL: http://blog.segment7.net/articles.rss
Feed Description: Posts about and around Ruby, MetaRuby, ruby2c, ZenTest and work at The Robot Co-op.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Eric Hodel
Latest Posts From Segment7

Advertisement

So I wrote SuperCaller

require 'rubygems'
require 'super_caller'
require 'super_caller/exception'

class X
  def y; z; end
  def z; raise; end
end

begin
  X.new.y
rescue => e
  e.backtrace .each do |frame|
    puts frame
    puts frame.source || frame.sexp.inspect
    puts "---"
  end
end

Gives:

/usr/local/lib/ruby/gems/1.8/gems/SuperCaller-1.0.0/lib/super_caller/exception.rb:12:in `initialize'
def initialize(message)
  old_initialize(message)
  @backtrace = super_caller
end
---
test.rb:7:in `new'
[[:vcall, :raise]]
---
test.rb:7:in `z'
[[:vcall, :raise]]
---
test.rb:6:in `y'
def y
  z
end
---
test.rb:11
[[:call, [:call, [:const, :X], :new], :y]]
---

Coming Soon

Read: Inliners are Hard to Debug

Topic: The erubycon Interviews: Muness Alrubaie Answers Previous Topic   Next Topic Topic: Ruby On Rails IDE - Different from 'Ruby IDE'?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use