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



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

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

.help_commandObject



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

def help_command
  'interrupt'
end

Instance Method Details

#executeObject



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

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

#regexpObject



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

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