Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.3.1
    • Fix Version/s: None
    • Component/s: Interpreter
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Under MRI, passing -rtracer turns on the tracer, but it does nothing in JRuby:

      $ jruby -rtracer -e 'puts :hi'
      hi
      
      $ ruby -rtracer -e 'puts :hi'
      #0:-e:1::-: puts :hi
      #0:-e:1:Kernel:>: puts :hi
      #0:-e:1:Symbol:>: puts :hi
      #0:-e:1:Symbol:<: puts :hi
      #0:-e:1:IO:>: puts :hi
      hi#0:-e:1:IO:<: puts :hi
      #0:-e:1:IO:>: puts :hi
      
      #0:-e:1:IO:<: puts :hi
      #0:-e:1:Kernel:<: puts :hi
      

      This seems to be because caller(0) is incorrect for files required with -r:

      $ echo puts caller(0).inspect >test.rb
      $ ruby -rtest -e
      ["./test.rb:1"]
      $ jruby -rtest -e
      ["test.rb:1", "test.rb:1"]
      

        Activity

        Hide
        Hiro Asari added a comment -

        Tweaked code readability.

        Show
        Hiro Asari added a comment - Tweaked code readability.
        Hide
        Hiro Asari added a comment -

        With the current trunk, JRuby demands '--debug' flag for tracing, and when it's given, yields:

        $ jruby --debug -rtracer -e 'puts :hi'
        #0:-e:1::-: -
        #0:-e:1:Kernel:>: -
        #0:-e:1:Symbol:>: -
        #0:-e:1:Symbol:<: -
        #0:-e:1:IO:>: -
        hi#0:-e:1:IO:<: -
        #0:-e:1:IO:>: -
        
        #0:-e:1:IO:<: -
        #0:-e:1:Kernel:<: -
        
        Show
        Hiro Asari added a comment - With the current trunk, JRuby demands '--debug' flag for tracing, and when it's given, yields: $ jruby --debug -rtracer -e 'puts :hi' #0:-e:1::-: - #0:-e:1:Kernel:>: - #0:-e:1:Symbol:>: - #0:-e:1:Symbol:<: - #0:-e:1:IO:>: - hi#0:-e:1:IO:<: - #0:-e:1:IO:>: - #0:-e:1:IO:<: - #0:-e:1:Kernel:<: -
        Hide
        Charles Oliver Nutter added a comment -

        Fixed at some point.

        Show
        Charles Oliver Nutter added a comment - Fixed at some point.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Rib Rdb
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: