nixme / pry-debugger

Pry navigation commands via debugger (formerly ruby-debug)
MIT License
647 stars 46 forks source link

Next command is leaving current stack frame #57

Open jmondo opened 10 years ago

jmondo commented 10 years ago

when I hit next (or n) it should "Step over to the next line within the same frame" but when I hit next a few times it leaves the current frame and jumps into activerecord source. This happens under MRI 1.9.3 and 2.0.0

here's the recording: http://showterm.io/b3f3cd8e525b69d803e98

other relevant stuff. it's a skeleton rails app with 1 model and these gems:


# Gemfile (stock rails 4 + pry stuff)
source 'https://rubygems.org'

gem 'rails', '4.1.5'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'

gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc

gem 'spring', group: :development

gem 'pry'
gem 'pry-stack_explorer'
gem 'pry-debugger'

# Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.1.5)
      actionpack (= 4.1.5)
      actionview (= 4.1.5)
      mail (~> 2.5.4)
    actionpack (4.1.5)
      actionview (= 4.1.5)
      activesupport (= 4.1.5)
      rack (~> 1.5.2)
      rack-test (~> 0.6.2)
    actionview (4.1.5)
      activesupport (= 4.1.5)
      builder (~> 3.1)
      erubis (~> 2.7.0)
    activemodel (4.1.5)
      activesupport (= 4.1.5)
      builder (~> 3.1)
    activerecord (4.1.5)
      activemodel (= 4.1.5)
      activesupport (= 4.1.5)
      arel (~> 5.0.0)
    activesupport (4.1.5)
      i18n (~> 0.6, >= 0.6.9)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.1)
      tzinfo (~> 1.1)
    arel (5.0.1.20140414130214)
    binding_of_caller (0.7.2)
      debug_inspector (>= 0.0.1)
    builder (3.2.2)
    coderay (1.1.0)
    coffee-rails (4.0.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.0)
    coffee-script (2.3.0)
      coffee-script-source
      execjs
    coffee-script-source (1.7.1)
    columnize (0.8.9)
    debug_inspector (0.0.2)
    debugger (1.6.8)
      columnize (>= 0.3.1)
      debugger-linecache (~> 1.2.0)
      debugger-ruby_core_source (~> 1.3.5)
    debugger-linecache (1.2.0)
    debugger-ruby_core_source (1.3.5)
    erubis (2.7.0)
    execjs (2.2.1)
    hike (1.2.3)
    i18n (0.6.11)
    jbuilder (2.1.3)
      activesupport (>= 3.0.0, < 5)
      multi_json (~> 1.2)
    jquery-rails (3.1.1)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    json (1.8.1)
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    method_source (0.8.2)
    mime-types (1.25.1)
    minitest (5.4.0)
    multi_json (1.10.1)
    polyglot (0.3.5)
    pry (0.10.1)
      coderay (~> 1.1.0)
      method_source (~> 0.8.1)
      slop (~> 3.4)
    pry-debugger (0.2.3)
      debugger (~> 1.3)
      pry (>= 0.9.10, < 0.11.0)
    pry-stack_explorer (0.4.9.1)
      binding_of_caller (>= 0.7)
      pry (>= 0.9.11)
    rack (1.5.2)
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (4.1.5)
      actionmailer (= 4.1.5)
      actionpack (= 4.1.5)
      actionview (= 4.1.5)
      activemodel (= 4.1.5)
      activerecord (= 4.1.5)
      activesupport (= 4.1.5)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.1.5)
      sprockets-rails (~> 2.0)
    railties (4.1.5)
      actionpack (= 4.1.5)
      activesupport (= 4.1.5)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (10.3.2)
    rdoc (4.1.1)
      json (~> 1.4)
    sass (3.2.19)
    sass-rails (4.0.3)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.2.0)
      sprockets (~> 2.8, <= 2.11.0)
      sprockets-rails (~> 2.0)
    sdoc (0.4.1)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)
    slop (3.6.0)
    spring (1.1.3)
    sprockets (2.11.0)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sprockets-rails (2.1.3)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      sprockets (~> 2.8)
    sqlite3 (1.3.9)
    thor (0.19.1)
    thread_safe (0.3.4)
    tilt (1.4.1)
    treetop (1.4.15)
      polyglot
      polyglot (>= 0.3.1)
    turbolinks (2.2.3)
      coffee-rails
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (2.5.3)
      execjs (>= 0.3.0)
      json (>= 1.8.0)

PLATFORMS
  ruby

DEPENDENCIES
  coffee-rails (~> 4.0.0)
  jbuilder (~> 2.0)
  jquery-rails
  pry
  pry-debugger
  pry-stack_explorer
  rails (= 4.1.5)
  sass-rails (~> 4.0.3)
  sdoc (~> 0.4.0)
  spring
  sqlite3
  turbolinks
  uglifier (>= 1.3.0)

# The only model
class Book < ActiveRecord::Base
  def authors_of_books_with_similar_length
    binding.pry
    books = Book.where('page_length BETWEEN ? AND ?', page_length - 10, page_length + 10)
    books.map(&:author)
  end

  def self.seed_books
    Book.create(title: 'title', author: 'author', page_length: 135)
    Book.create(title: 'title2', author: 'some guy', page_length: 135)
    Book.create(title: 'crazy long book', author: 'some guy', page_length: 340)
  end
end
jmondo commented 10 years ago

oh and meanwhile with pry-byebug with MRI 2.0.0p247 it seems to be working how I would expect (not jumping into activerecord)

http://showterm.io/01fca9652c64efb404b81

jmondo commented 10 years ago

Here's the project if you want to replicate: https://github.com/jmondo/debugpry Be sure to run Book. seed_books

Ajedi32 commented 9 years ago

Having this same problem with the finish command. It jumps down into the next stack frame instead of up after the current frame returns.

Also, possibly related: pry-stack_explorer's show-stack command is just giving me No caller stack available!. I'm also experiencing the same issue with pry-byebug.