Class: Debugger::ThreadSwitchCommand
Constant Summary
Constants inherited
from Command
Command::DEF_OPTIONS
Class Method Summary
collapse
Instance Method Summary
collapse
#debugger_thread?, #display_context
Methods inherited from Command
commands, inherited, #initialize, load_commands, #match, method_missing, options
Class Method Details
.help(cmd) ⇒ Object
76
77
78
79
80
|
# File 'lib/ruby-debug/commands/threads.rb', line 76
def help(cmd)
%{
th[read] [sw[itch]] <nnn>\tswitch thread context to nnn
}
end
|
.help_command ⇒ Object
72
73
74
|
# File 'lib/ruby-debug/commands/threads.rb', line 72
def help_command
'thread'
end
|
Instance Method Details
#execute ⇒ Object
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# File 'lib/ruby-debug/commands/threads.rb', line 56
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 switch to the debugger thread.\n"
else
display_context(c)
c.stop_next = 1
c.thread.run
@state.proceed
end
end
|
#regexp ⇒ Object
52
53
54
|
# File 'lib/ruby-debug/commands/threads.rb', line 52
def regexp
/^\s*th(?:read)?\s+(?:sw(?:itch)?\s+)?(\d+)\s*$/
end
|