Sha256: 74a4b4b433ac5f4c1463368f51a4228f9806a04ee5e3116bce0e49f733b17b14

Contents?: true

Size: 1.43 KB

Versions: 8

Compression:

Stored size: 1.43 KB

Contents

require 'byebug/command'

module Byebug
  #
  # Implements the next functionality.
  #
  # Allows the user the continue execution until the next instruction in the
  # current frame.
  #
  class NextCommand < Command
    self.allow_in_post_mortem = false

    def regexp
      /^\s* n(?:ext)? (?:\s+(\S+))? \s*$/x
    end

    def execute
      steps, err = parse_steps(@match[1], 'Next')
      return errmsg(err) unless steps

      @state.context.step_over(steps, @state.frame)
      @state.proceed
    end

    class << self
      def names
        %w(next)
      end

      def description
        prettify <<-EOD
          n[ext][ nnn]

          Steps over once or nnn times.
        EOD
      end
    end
  end

  #
  # Implements the step functionality.
  #
  # Allows the user the continue execution until the next instruction, possibily
  # in a different frame. Use step to step into method calls or blocks.
  #
  class StepCommand < Command
    self.allow_in_post_mortem = false

    def regexp
      /^\s* s(?:tep)? (?:\s+(\S+))? \s*$/x
    end

    def execute
      steps, err = parse_steps(@match[1], 'Steps')
      return errmsg(err) unless steps

      @state.context.step_into(steps, @state.frame)
      @state.proceed
    end

    class << self
      def names
        %w(step)
      end

      def description
        prettify <<-EOD
          s[tep][ nnn]

          Steps (into methods) once or nnn times.
        EOD
      end
    end
  end
end

Version data entries

8 entries across 7 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/byebug-4.0.5/lib/byebug/commands/stepping.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/byebug-4.0.5/lib/byebug/commands/stepping.rb
byebug-4.0.5 lib/byebug/commands/stepping.rb
byebug-4.0.4 lib/byebug/commands/stepping.rb
byebug-4.0.3 lib/byebug/commands/stepping.rb
byebug-4.0.2 lib/byebug/commands/stepping.rb
byebug-4.0.1 lib/byebug/commands/stepping.rb
byebug-4.0.0 lib/byebug/commands/stepping.rb