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



94
95
96
97
98
# File 'lib/ruby-debug/commands/control.rb', line 94

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

.help_commandObject



90
91
92
# File 'lib/ruby-debug/commands/control.rb', line 90

def help_command
  'interrupt'
end

Instance Method Details

#executeObject



82
83
84
85
86
87
# File 'lib/ruby-debug/commands/control.rb', line 82

def execute
  unless Debugger.interrupt_last
    context = Debugger.thread_context(Thread.main)
    context.interrupt
  end
end

#regexpObject



78
79
80
# File 'lib/ruby-debug/commands/control.rb', line 78

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