Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong current line #584

Closed
rweng opened this issue Mar 13, 2013 · 3 comments
Closed

wrong current line #584

rweng opened this issue Mar 13, 2013 · 3 comments
Labels
Milestone

Comments

@rweng
Copy link

@rweng rweng commented Mar 13, 2013

I am sure this is a minor bug: It seems as if jruby get's the currently executed line wrong. Take this example file:

puts "hello"
require 'pry'
binding.pry

Now with the pry gem installed in both jruby and mri:

$ ruby --version
jruby 1.7.3 (1.9.3p385) 2013-02-21 dac429b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_10-ea-b14 [darwin-x86_64]

$ ruby hello.rb
hello

From: /Users/robin/hello.rb @ line 1 :

 => 1: puts "hello"
    2: require 'pry'
    3: binding.pry

[1] pry(main)> exit

~
$ rbenv use 1.9.3

~
$ ruby --version
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.2.1]

~
$ ruby hello.rb
hello

From: /Users/robin/hello.rb @ line 3 :

    1: puts "hello"
    2: require 'pry'
 => 3: binding.pry

[1] pry(main)>

You see how in jruby pry thinks it's still in the first line, though it must be in the third line or the repl wouldn't have kicked in?

@BanzaiMan
Copy link
Member

@BanzaiMan BanzaiMan commented Sep 3, 2013

I'm unfamiliar with how pry works. Have you asked them what might be causing this? It would help us if we can reduce the problem a little further with their help.

@MSNexploder
Copy link
Contributor

@MSNexploder MSNexploder commented Jul 15, 2014

This works by running jruby in debug mode (e.g. export JRUBY_OPTS=--debug) and is fixed in master altogether.

(see also: pry/pry#1008)

@mkristian mkristian added this to the JRuby 9000 milestone Jul 15, 2014
@enebo enebo modified the milestone: JRuby 9.0.0.0 Jul 14, 2015
@enebo enebo added this to the JRuby 1.7.25 milestone Apr 1, 2016
@enebo
Copy link
Member

@enebo enebo commented Apr 1, 2016

I just tried the example snippet on 1.7 and 9k branch and both show the proper line. Closing. Not sure when it was fixed and not worth the time to isolate when for posterity.

@enebo enebo closed this Apr 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.