Forum: IronRuby Caller(0)[1] returns :0 if not debugging

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ben H. (Guest)
on 2008-10-07 01:38
(Received via mailing list)
Attachment: expandpath.rb (0 Bytes)
Attachment: expandpath_call.rb (0 Bytes)

As promised, I'm trying to track down and reproduce various bugs I have

The first one I have is that my code is calling caller(0)[1] which
expects the path to the calling method.  However, if i'm using running
the ir, then it can't find the file or the method name, and the line
number is 0 in the stack trace, as such the information being returned
is incorrect which is causing expand_path to blow up. Hope that makes

E:\IronRuby\r156\build\debug>ir expandpath_call.rb

E:\IronRuby\r156\build\debug>ir -D expandpath_call.rb

E:\IronRuby\r156\build\debug>ruby expandpath_call.rb

File: expandpath_call.rb
require 'expandpath.rb'

$a =

File: expandpath.rb
class A
  def method
      puts caller(0)[1]

In the actual code, the stack frame looks something like this:
{#top-level-method#$18##18 at offset 10911 in file:line:column
<filename unknown>:0:0}

Hope this helps


This topic is locked and can not be replied to.