Class: Debugger::ThreadStopCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ruby-debug/commands/threads.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

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



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

def help(cmd)
  %{
    th[read] stop <nnn>\t\tstop thread nnn
  }
end

.help_commandObject



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

def help_command
  'thread'
end

Instance Method Details

#executeObject



70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/ruby-debug/commands/threads.rb', line 70

def execute
  c = get_context(@match[1].to_i)
  case
  when c == @state.context
    print_msg "It's the current thread."
  when c.ignored?
    print_msg "Can't stop the debugger thread."
  else
    c.suspend
    print_context(c)
  end
end

#regexpObject



66
67
68
# File 'lib/ruby-debug/commands/threads.rb', line 66

def regexp
  /^\s*th(?:read)?\s+stop\s+(\d+)\s*$/
end