Skip to content

Commit 9c96a76

Browse files
equivalence1dmitrii.kravchenko
authored andcommitted
added attached flag to indicate if we are currently under debug. This is needed for attach mode: if we detached pre_child should not be called in fork and exec
1 parent 0c2a329 commit 9c96a76

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

bin/rdebug-ide

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ Debugger.evaluation_timeout = options.evaluation_timeout
140140
Debugger.catchpoint_deleted_event = options.catchpoint_deleted_event || options.rm_protocol_extensions
141141
Debugger.value_as_nested_element = options.value_as_nested_element || options.rm_protocol_extensions
142142

143+
Debugger.attached = true
144+
143145
if options.attach_mode
144146
if Debugger::FRONT_END == "debase"
145147
Debugger.init_variables

lib/ruby-debug-ide.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def cleanup_backtrace(backtrace)
4343
cleared
4444
end
4545

46+
attr_accessor :attached
4647
attr_accessor :cli_debug, :xml_debug, :evaluation_timeout
4748
attr_accessor :control_thread
4849
attr_reader :interface

lib/ruby-debug-ide/commands/control.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ def regexp
136136
end
137137

138138
def execute
139+
Debugger.attached = false
139140
Debugger.stop
140141
Debugger.interface.close
141142
Debugger.control_thread = nil

lib/ruby-debug-ide/multiprocess/pre_child.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module Debugger
22
module MultiProcess
33
class << self
44
def pre_child(options = nil)
5+
return unless Debugger.attached
6+
57
require 'socket'
68
require 'ostruct'
79

0 commit comments

Comments
 (0)