Class: Debugger::FinishCommand

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

Overview

:nodoc:

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



75
76
77
78
79
# File 'lib/ruby-debug/commands/stepping.rb', line 75

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

.help_commandObject



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

def help_command
  'finish'
end

Instance Method Details

#executeObject



60
61
62
63
64
65
66
67
68
# File 'lib/ruby-debug/commands/stepping.rb', line 60

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

#regexpObject



56
57
58
# File 'lib/ruby-debug/commands/stepping.rb', line 56

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