Projects

Ticket #422 (new defect)

Opened 2 years ago

Last modified 11 months ago

Kernel#caller compatibilty

Reported by: mattaimonetti@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby Later
Component: MacRuby Keywords:
Cc: ernest.prabhakar@…, jens.nockert@…

Description (last modified by mattaimonetti@…) (diff)

In a file:

Example:

class Foo
  def self.bar
    baz do 
      puts caller(1)
    end
  end
  
  def self.baz(&block)
     block.call
  end
end

Foo.bar

macruby:

core:in `caller:'
caller_proc.rb:9:in `baz'
caller_proc.rb:3:in `bar'
caller_proc.rb:13:in `<main>'

ruby1.9:

caller_proc.rb:9:in `call'
caller_proc.rb:9:in `baz'
caller_proc.rb:3:in `bar'
caller_proc.rb:13:in `<main>

Files attached.

Attachments

caller_proc.rb Download (132 bytes) - added by mattaimonetti@… 2 years ago.
simple_caller.rb Download (62 bytes) - added by mattaimonetti@… 2 years ago.

Change History

Changed 2 years ago by mattaimonetti@…

Changed 2 years ago by mattaimonetti@…

Changed 2 years ago by ernest.prabhakar@…

  • cc ernest.prabhakar@… added

Cc Me!

Changed 2 years ago by jens.nockert@…

  • cc jens.nockert@… added

Cc Me!

Changed 15 months ago by mattaimonetti@…

  • description modified (diff)

The first example now works fine, block calls still don't get listed in the caller list so I'm leaving this ticket open.

Changed 14 months ago by lsansonetti@…

  • milestone set to MacRuby 1.0

Changed 11 months ago by lsansonetti@…

  • milestone changed from MacRuby 1.0 to MacRuby Later

I don't think this ticket can be fixed any time soon. The problem here is that the #call method is not written in Ruby, therefore it has no dwarf metadata associated to it, so the backtracer doesn't know about it. To fix this ticket, MacRuby would need to have some logic regarding methods written in C, but that seems a lot of work just for that ticket. Moving to Later.

Note: See TracTickets for help on using tickets.