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, #find, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



100
101
102
103
104
# File 'lib/ruby-debug/commands/control.rb', line 100

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

.help_commandObject



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

def help_command
  'interrupt'
end

Instance Method Details

#executeObject



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

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

#regexpObject



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

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