Module: Debugger::TimeoutHandler

Defined in:
lib/ruby-debug-ide/thread_alias.rb

Class Method Summary collapse

Class Method Details

.do_thread_aliasObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/ruby-debug-ide/thread_alias.rb', line 4

def do_thread_alias
  if defined? ::OldThread
    Debugger.print_debug 'Tried to re-alias thread for eval'
    return
  end

  Object.const_set :OldThread, ::Thread
  Object.send :remove_const, :Thread
  Object.const_set :Thread, ::Debugger::DebugThread
end

.undo_thread_aliasObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/ruby-debug-ide/thread_alias.rb', line 15

def undo_thread_alias
  unless defined? ::OldThread
    Debugger.print_debug 'Tried to de-alias thread twice'
    return
  end

  Object.send :remove_const, :Thread
  Object.const_set :Thread, ::OldThread
  Object.send :remove_const, :OldThread
end