nixme / pry-debugger

Pry navigation commands via debugger (formerly ruby-debug)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'next' navigates into pry-debugger/processor.rb code

twelve17 opened this issue · comments

I am using ruby 1.9.3-p194 with:
pry (0.9.12)
pry-debugger (0.2.2)

When I add a "binding.pry" breakpoint and execute my code, execution stops and displays the surrounding code, as expected. However, if I type 'next', I am taken here:

From: /Users/alex/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/pry-debugger-0.2.2/lib/pry-debugger/processor.rb @ line 19 PryDebugger::Processor#run:


   14:     # Wrap a Pry REPL to catch navigational commands and act on them.
    15:     def run(initial = true, &block)
    16:       return_value = nil
    17:       command = catch(:breakout_nav) do  # Throws from PryDebugger::Commands
    18:         return_value = yield
 => 19:         {}    # Nothing thrown == no navigational command
    20:       end
    21: 
    22:       times = (command[:times] || 1).to_i   # Command argument
    23:       times = 1 if times <= 0

Navigation had been working recently, so I am unsure if a bundle update is causing this or if there is a particular change in my own code that is triggering it. My .pryrc is:

Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 'f', 'finish'

I'll keep poking around to see if I can make it work with simpler code.

Cheers,

Alex

What version of the debugger gem?

debugger-1.5.0

I am able to reproduce this behavior with this short ruby script:

#!/usr/bin/env ruby

require 'pry-debugger'

date = Time.now

binding.pry

puts "date: #{date.inspect}"

Let me know if there is anything else I can do to help. Thanks!

I'm seeing the correct behavior on 1.9.3-p392 and 2.0.0-p0 with both debugger 1.4.0 and 1.5.0 on each. I don't have 1.9.3-p194 locally installed, but if you change to a newer patchlevel, does it work?

Hi @nixme,

I'll give it a shot with the later 1.9.3 patch version you used and report back.

Cheers,

Alex

Mornin' @nixme,

I got curious and poked around a little and saw that my ruby-build was out of date, so I updated it and tried 1.9.3p392, which displayed the proper behavior. I then went back and tried a clean install of 1.9.3p194 and saw the correct behavior there too, so I am guessing that perhaps the older ruby-build had installed ruby differently somehow.

Of course, I saved the output of the git update so I could compare revisions of the old/new ruby-build code, but now I can't remember where I put the file. :)

Anyway, apologies for the troubles. Looks like the issue was on my end.

Thanks for checking. It's odd you'd see different behavior at all, but then again the code that ensure you don't step inside pry or pry-debugger could have holes. If you ever get it to repro again, let me know.

No problem--yeah, I'm perplexed about it too and want to check out what I was doing differently before the ruby-build upgrade. If I can find my notes to check out the old git rev of ruby-build and reproduce it, I'll let you know. Cheers, Alex