Class: Debugger::InterruptCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ruby-debug/commands/control.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



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

def help(cmd)
  %{
    i[nterrupt]\tinterrupt the program
  }
end

.help_commandObject



45
46
47
# File 'lib/ruby-debug/commands/control.rb', line 45

def help_command
  'interrupt'
end

Instance Method Details

#executeObject



37
38
39
40
41
42
# File 'lib/ruby-debug/commands/control.rb', line 37

def execute
  unless Debugger.interrupt_last
    context = Debugger.contexts.find{ |c| c.thread == Thread.main }
    context.interrupt
  end
end

#regexpObject



33
34
35
# File 'lib/ruby-debug/commands/control.rb', line 33

def regexp
  /^\s*i(?:nterrupt)?\s*$/
end