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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



120
121
122
123
124
# File 'lib/ruby-debug/commands/control.rb', line 120

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

.help_commandObject



116
117
118
# File 'lib/ruby-debug/commands/control.rb', line 116

def help_command
  'interrupt'
end

Instance Method Details

#executeObject



108
109
110
111
112
113
# File 'lib/ruby-debug/commands/control.rb', line 108

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

#regexpObject



104
105
106
# File 'lib/ruby-debug/commands/control.rb', line 104

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