Class: Debugger::ThreadStopCommand
- Includes:
- ThreadFunctions
- Defined in:
- lib/ruby-debug/commands/threads.rb
Overview
:nodoc:
Constant Summary
Constants inherited from Command
Class Method Summary collapse
Instance Method Summary collapse
Methods included from ThreadFunctions
#debugger_thread?, #display_context
Methods inherited from Command
commands, inherited, #initialize, load_commands, #match, method_missing, options
Constructor Details
This class inherits a constructor from Debugger::Command
Class Method Details
.help(cmd) ⇒ Object
116 117 118 119 120 |
# File 'lib/ruby-debug/commands/threads.rb', line 116 def help(cmd) %{ th[read] stop <nnn>\t\tstop thread nnn } end |
.help_command ⇒ Object
112 113 114 |
# File 'lib/ruby-debug/commands/threads.rb', line 112 def help_command 'thread' end |
Instance Method Details
#execute ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/ruby-debug/commands/threads.rb', line 96 def execute c = get_context(@match[1].to_i) case when c == @state.context print "It's the current thread.\n" when debugger_thread?(c) print "Can't stop the debugger thread.\n" when c.thread.stop? print "Already stopped.\n" else display_context(c) c.suspend end end |
#regexp ⇒ Object
92 93 94 |
# File 'lib/ruby-debug/commands/threads.rb', line 92 def regexp /^\s*th(?:read)?\s+stop\s+(\d+)\s*$/ end |