Class: Debugger::FinishCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ruby-debug/commands/stepping.rb

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, inherited, #initialize, load_commands, #match, method_missing, options

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



69
70
71
72
73
# File 'lib/ruby-debug/commands/stepping.rb', line 69

def help(cmd)
  %{
    fin[ish]\treturn to outer frame
  }
end

.help_commandObject



65
66
67
# File 'lib/ruby-debug/commands/stepping.rb', line 65

def help_command
  'finish'
end

Instance Method Details

#executeObject



54
55
56
57
58
59
60
61
62
# File 'lib/ruby-debug/commands/stepping.rb', line 54

def execute
  if @state.frame_pos == @state.context.frames.size
    print "\"finish\" not meaningful in the outermost frame.\n"
  else
    @state.context.stop_frame = @state.context.frames.size - @state.frame_pos
    @state.frame_pos = 0
    @state.proceed
  end
end

#regexpObject



50
51
52
# File 'lib/ruby-debug/commands/stepping.rb', line 50

def regexp
  /^\s*fin(?:ish)?$/
end