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



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

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

.help_commandObject



114
115
116
# File 'lib/ruby-debug/commands/control.rb', line 114

def help_command
  'interrupt'
end

Instance Method Details

#executeObject



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

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

#regexpObject



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

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