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

Does finish works as expected? #101

Closed
x-yuri opened this issue Jan 1, 2015 · 5 comments
Closed

Does finish works as expected? #101

x-yuri opened this issue Jan 1, 2015 · 5 comments

Comments

@x-yuri
Copy link

x-yuri commented Jan 1, 2015

Here's the test script:

#!/usr/bin/env ruby
require 'byebug'

def a
  puts 'a:before'
  b
  puts 'a:middle'
  b
  puts 'a:after'
end

def b
  puts 'b'
end

byebug
puts 'before'
a
puts 'after'

finish seem to simply stop after next return:

[1, 10] in ./1.rb
    1: #!/usr/bin/env ruby
    2: require 'byebug'
    3: 
    4: def a
=>  5:   puts 'a:before'
    6:   b
    7:   puts 'a:middle'
    8:   b
    9:   puts 'a:after'
   10: end
(byebug) finish
a:before
b

[2, 11] in ./1.rb
    2: require 'byebug'
    3: 
    4: def a
    5:   puts 'a:before'
    6:   b
=>  7:   puts 'a:middle'
    8:   b
    9:   puts 'a:after'
   10: end
   11: 
(byebug) finish
a:middle
b

[4, 13] in ./1.rb
    4: def a
    5:   puts 'a:before'
    6:   b
    7:   puts 'a:middle'
    8:   b
=>  9:   puts 'a:after'
   10: end
   11: 
   12: def b
   13:   puts 'b'
(byebug)

I'd expect it to end up here:

[10, 19] in ./2.rb
   10: end
   11: 
   12: def b
   13:   puts 'b'
   14: end
   15: 
   16: byebug
   17: puts 'before'
   18: a
=> 19: puts 'after'

For me current frame is method a, what is it for you? Am I doing it wrong?

@deivid-rodriguez
Copy link
Owner

No, you're not. I expect exactly the same behavior as you do. If this is reproduced against last master, I'll try to fix it tomorrow. Thanks for finding this out.

@deivid-rodriguez
Copy link
Owner

Yep, I can reproduce this. Will fix it ASAP.

@deivid-rodriguez
Copy link
Owner

@x-yuri Could you try last master and confirm this is fixed?

@x-yuri
Copy link
Author

x-yuri commented Jan 2, 2015

Thanks, it's fixed.

@deivid-rodriguez
Copy link
Owner

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants