-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4512d5e
commit 279e28e
Showing
5 changed files
with
52 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,23 @@ | ||
if RUBY_VERSION < "1.9" | ||
if RUBY_VERSION < '1.9' | ||
require 'ruby-debug-ide/multiprocess/pre_child' | ||
require 'ruby-debug-ide/multiprocess/monkey' | ||
else | ||
require_relative 'multiprocess/pre_child' | ||
require_relative 'multiprocess/monkey' | ||
end | ||
|
||
module Debugger | ||
module MultiProcess | ||
class << self | ||
def do_monkey | ||
load File.expand_path(File.dirname(__FILE__) + '/multiprocess/monkey.rb') | ||
end | ||
|
||
def undo_monkey | ||
if ENV['IDE_PROCESS_DISPATCHER'] | ||
load File.expand_path(File.dirname(__FILE__) + '/multiprocess/unmonkey.rb') | ||
ruby_opts = ENV['RUBYOPT'].split(' ') | ||
ENV['RUBYOPT'] = ruby_opts.keep_if {|opt| !opt.end_with?('ruby-debug-ide/multiprocess/starter')}.join(' ') | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module Debugger | ||
module MultiProcess | ||
def self.restore_fork | ||
%Q{ | ||
alias fork pre_debugger_fork | ||
} | ||
end | ||
|
||
def self.restore_exec | ||
%Q{ | ||
alias exec pre_debugger_exec | ||
} | ||
end | ||
end | ||
end | ||
|
||
module Kernel | ||
class << self | ||
module_eval Debugger::MultiProcess.restore_fork | ||
module_eval Debugger::MultiProcess.restore_exec | ||
end | ||
module_eval Debugger::MultiProcess.restore_fork | ||
module_eval Debugger::MultiProcess.restore_exec | ||
end | ||
|
||
module Process | ||
class << self | ||
module_eval Debugger::MultiProcess.restore_fork | ||
module_eval Debugger::MultiProcess.restore_exec | ||
end | ||
end |