class Debugger::KillCommand

Implements debugger “kill” command

Public Class Methods

help(cmd) click to toggle source
# File cli/ruby-debug/commands/kill.rb, line 41
      def help(cmd)
        %Q{
          kill [SIGNAL]

          Send [signal] to Process.pid
Equivalent of Process.kill(Process.pid)
         }
     end
help_command() click to toggle source
# File cli/ruby-debug/commands/kill.rb, line 37
def help_command
  %w[kill]
end

Public Instance Methods

execute() click to toggle source
# File cli/ruby-debug/commands/kill.rb, line 15
def execute
  puts @match[1]
  if @match[1] 
    signame = @match[1]
    unless Signal.list.member?(signame)
      errmsg("signal name #{signame} is not a signal I know about\n")
      return false
    end
    if 'KILL' == signame
        @state.interface.finalize
    end
  else
    if not confirm("Really kill? (y/n) ")
      return
    else 
      signame = 'KILL'
    end
  end
  Process.kill(signame, Process.pid)
end
regexp() click to toggle source
# File cli/ruby-debug/commands/kill.rb, line 7
def regexp
  / ^\s*
     (?:kill) \s*
     (?:\s+(\S+))?\s*
     $
  /x
end