lib/ruby-debug/commands/stepping.rb in ruby-debug-ide-0.1.2 vs lib/ruby-debug/commands/stepping.rb in ruby-debug-ide-0.1.3

- old
+ new

@@ -1,52 +1,55 @@ module Debugger - class NextCommand < Command # :nodoc + class NextCommand < Command # :nodoc: self.need_context = true def regexp - /^\s*n(?:ext)?(?:\s+(\d+))?(?:\s+(\d+))?$/ + /^\s*n(?:ext)?([+-])?(?:\s+(\d+))?$/ end def execute - steps = @match[1] ? @match[1].to_i : 1 - target_frame = @match[2] ? (@match[2].to_i() -1) : @state.frame_pos - @state.context.step_over steps, target_frame + force = @match[1] == '+' + steps = @match[2] ? @match[2].to_i : 1 + @state.context.step_over steps, @state.frame_pos, force @state.proceed end class << self def help_command 'next' end def help(cmd) %{ - n[ext][nl] [tf]\tgo over n lines, default is one, go to target frame tf (1-based) + n[ext][+][ nnn]\tstep over once or nnn times, + \t\t'+' forces to move to another line } end end end class StepCommand < Command # :nodoc: self.need_context = true def regexp - /^\s*s(?:tep)?(?:\s+(\d+))?$/ + /^\s*s(?:tep)?([+-])?(?:\s+(\d+))?$/ end def execute - @state.context.stop_next = @match[1] ? @match[1].to_i : 1 + force = @match[1] == '+' + steps = @match[2] ? @match[2].to_i : 1 + @state.context.step(steps, force) @state.proceed end class << self def help_command 'step' end def help(cmd) %{ - s[tep][ nnn]\tstep (into methods) one line or till line nnn + s[tep][ nnn]\tstep (into methods) once or nnn times } end end end