Sha256: b50cb480d1649bd9c3e07b07c5ef4027f901f259732a12234d2311fa83618f52

Contents?: true

Size: 1.89 KB

Versions: 63

Compression:

Stored size: 1.89 KB

Contents

module Debugger
  # Mix-in module to assist in command parsing.
  module SteppingFunctions # :nodoc:
    def parse_stepping_args(command_name, match)
      if match[1].nil? 
          force = Command.settings[:force_stepping]
      elsif match[1] == '+' 
        force = true
      elsif match[1] == '-' 
        force = false
      end
      steps = get_int(match[2], command_name, 1)
      return [steps, force]
    end
  end
  # Implements debugger "next" command.
  class NextCommand < Command
    self.allow_in_post_mortem  = false
    self.need_context          = true
    
    def regexp
      /^\s* n(?:ext)? 
        ([+-])?(?:\s+(\S+))? 
        \s*$/x
    end

    def execute
      steps, force = parse_stepping_args("Next", @match)
      return unless steps
      @state.context.step_over steps, @state.frame_pos, force
      @state.proceed
    end

    class << self
      def help_command
        'next'
      end

      def help(cmd)
        %{
          n[ext][+-]?[ nnn]\tstep over once or nnn times, 
          \t\t'+' forces to move to another line.
          \t\t'-' is the opposite of '+' and disables the force_stepping setting.
        }
      end
    end
  end

  # Implements debugger "step" command.
  class StepCommand < Command
    self.allow_in_post_mortem = false
    self.need_context         = true
    
    def regexp
      /^\s* s(?:tep)?
        ([+-])?(?:\s+(\S+))?
        \s*$/x
    end

    def execute
      steps, force = parse_stepping_args("Step", @match)
      return unless steps
      @state.context.step(steps, force)
      @state.proceed
    end

    class << self
      def help_command
        'step'
      end

      def help(cmd)
        %{
          s[tep][+-]?[ nnn]\tstep (into methods) once or nnn times
          \t\t'+' forces to move to another line.
          \t\t'-' is the opposite of '+' and disables the force_stepping setting.
        }
      end
    end
  end
end

Version data entries

63 entries across 60 versions & 11 rubygems

Version Path
ruby-debug-0.11.0 cli/ruby-debug/commands/stepping.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/ruby-debug-0.10.6/cli/ruby-debug/commands/stepping.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/debugger-1.6.8/lib/ruby-debug/commands/stepping.rb
ruby-debug-0.10.6 cli/ruby-debug/commands/stepping.rb
debugger-1.6.8 lib/ruby-debug/commands/stepping.rb
debugger-1.6.7 lib/ruby-debug/commands/stepping.rb
debugger-1.6.6 lib/ruby-debug/commands/stepping.rb
debugger-1.6.5 lib/ruby-debug/commands/stepping.rb
debugger-1.6.4 lib/ruby-debug/commands/stepping.rb
debugger-1.6.3 lib/ruby-debug/commands/stepping.rb
ruby-debug-0.10.5.rc9 cli/ruby-debug/commands/stepping.rb
debugger-1.6.2 lib/ruby-debug/commands/stepping.rb
ruby-debug-0.10.5.rc8 cli/ruby-debug/commands/stepping.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/debugger-1.6.1/lib/ruby-debug/commands/stepping.rb
candlepin-api-0.4.0 bundle/ruby/gems/debugger-1.6.1/lib/ruby-debug/commands/stepping.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/stepping.rb
ruby-debug-0.10.5.rc7 cli/ruby-debug/commands/stepping.rb
ruby-debug-0.10.5.rc5 cli/ruby-debug/commands/stepping.rb
ruby-debug-0.10.5.rc4 cli/ruby-debug/commands/stepping.rb
debugger-1.6.1 lib/ruby-debug/commands/stepping.rb