ruby-debug-ide 0.7.1.beta2 → 0.7.1.beta3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39ee3378afdaecb8c7d9b3bb9c0c14177eb13ce31a91835494ad081837f8275e
4
- data.tar.gz: a251044c88ff82e8602bd9cf0d36bef62b2760a6d26067964c4f9c34edffa9f5
3
+ metadata.gz: da4d758d4a52aaf88ca70bc1bd8f8eef21c365d010c253c9a203ec3beae2dc3f
4
+ data.tar.gz: 147b096c266e8e37829f1e3ae505f2a17bde3ec832845e804e8f5e7a1621150e
5
5
  SHA512:
6
- metadata.gz: 7d2b3656dcc6fdf688237b66d77a92aec6d0916fe9ab106877f744209d05d3fbb4a4a6492fa77c9f6f6191b5268a60d24af81f2e9436afbbb771e1dab50569d7
7
- data.tar.gz: 877cae3a9b3bf725d933ab9b6b87c24d11c1fe66f6804e419e59483079bb677f29bd8239882ef489b5b521c95952cd6f639464bc09214ca38b7557f2352a0db4
6
+ metadata.gz: 363c48f2400b17c7412bbe7db3c3b29b51c80aeee2a4a47b7105364ff970fddef55c4c49105ec6addf68db76e36469af3ddddc6b6af779aef6579290aaa6e19a
7
+ data.tar.gz: fdcf0dd87f4852118fd48455ce405a6a1d7bd3edb9eef13e1c88d4a7965dd3bfd1b02df77e47a0ba4b0f5e6569b2da8e0a8ee4e2e517a6bf1a91b6fc2abb44d8
@@ -29,7 +29,8 @@ options = OpenStruct.new(
29
29
  'value_as_nested_element' => false,
30
30
  'attach_mode' => false,
31
31
  'cli_debug' => false,
32
- 'key_value_mode' => false
32
+ 'key_value_mode' => false,
33
+ 'socket_path' => nil
33
34
  )
34
35
 
35
36
  opts = OptionParser.new do |opts|
@@ -100,6 +101,9 @@ EOB
100
101
  opts.on("--value-as-nested-element", "Allow to pass variable's value as nested element instead of attribute") do
101
102
  options.value_as_nested_element = true
102
103
  end
104
+ opts.on("--socket-path PATH", "Listen for debugger on the given UNIX domain socket path") do |path|
105
+ options.socket_path = path
106
+ end
103
107
  opts.separator ""
104
108
  opts.separator "Common options:"
105
109
  opts.on_tail("-v", "--version", "Show version") do
@@ -74,16 +74,22 @@ module Debugger
74
74
  end
75
75
 
76
76
  def start_server(host = nil, port = 1234, notify_dispatcher = false)
77
- return if started?
78
- start
79
- start_control(host, port, notify_dispatcher)
77
+ _start_server_common(host, port, nil, notify_dispatcher)
78
+ end
79
+
80
+ def start_server_unix(socket_path, notify_dispatcher = false)
81
+ _start_server_common(nil, 0, socket_path, notify_dispatcher)
80
82
  end
81
83
 
82
84
  def prepare_debugger(options)
83
85
  @mutex = Mutex.new
84
86
  @proceed = ConditionVariable.new
85
87
 
86
- start_server(options.host, options.port, options.notify_dispatcher)
88
+ if options.socket_path.nil?
89
+ start_server(options.host, options.port, options.notify_dispatcher)
90
+ else
91
+ start_server_unix(options.socket_path, options.notify_dispatcher)
92
+ end
87
93
 
88
94
  raise "Control thread did not start (#{@control_thread}}" unless @control_thread && @control_thread.alive?
89
95
 
@@ -112,24 +118,53 @@ module Debugger
112
118
  end
113
119
 
114
120
  def start_control(host, port, notify_dispatcher)
121
+ _start_control_common(host, port, nil, notify_dispatcher)
122
+ end
123
+
124
+ def start_control_unix(socket_path, notify_dispatcher)
125
+ _start_control_common(nil, 0, socket_path, notify_dispatcher)
126
+ end
127
+
128
+ private
129
+
130
+ def _start_server_common(host, port, socket_path, notify_dispatcher)
131
+ return if started?
132
+ start
133
+ _start_control_common(host, port, socket_path, notify_dispatcher)
134
+ end
135
+
136
+ def _start_control_common(host, port, socket_path, notify_dispatcher)
115
137
  raise "Debugger is not started" unless started?
116
138
  return if @control_thread
117
139
  @control_thread = DebugThread.new do
118
140
  begin
119
- # 127.0.0.1 seemingly works with all systems and with IPv6 as well.
120
- # "localhost" and nil have problems on some systems.
121
- host ||= '127.0.0.1'
122
-
123
- server = notify_dispatcher_if_needed(host, port, notify_dispatcher) do |real_port, port_changed|
124
- s = TCPServer.new(host, real_port)
125
- print_greeting_msg $stderr, host, real_port, port_changed ? "Subprocess" : "Fast" if defined? IDE_VERSION
126
- s
141
+ if socket_path.nil?
142
+ # 127.0.0.1 seemingly works with all systems and with IPv6 as well.
143
+ # "localhost" and nil have problems on some systems.
144
+ host ||= '127.0.0.1'
145
+
146
+ server = notify_dispatcher_if_needed(host, port, notify_dispatcher) do |real_port, port_changed|
147
+ s = TCPServer.new(host, real_port)
148
+ print_greeting_msg $stderr, host, real_port, port_changed ? "Subprocess" : "Fast" if defined? IDE_VERSION
149
+ s
150
+ end
151
+ else
152
+ raise "Cannot specify host and socket_file at the same time" if host
153
+ File.delete(socket_path) if File.exist?(socket_path)
154
+ server = UNIXServer.new(socket_path)
155
+ print_greeting_msg $stderr, nil, nil, "Fast", socket_path if defined? IDE_VERSION
127
156
  end
128
157
 
129
158
  return unless server
130
159
 
131
160
  while (session = server.accept)
132
- $stderr.puts "Connected from #{session.peeraddr[2]}" if Debugger.cli_debug
161
+ if Debugger.cli_debug
162
+ if session.peeraddr == 'AF_INET'
163
+ $stderr.puts "Connected from #{session.peeraddr[2]}"
164
+ else
165
+ $stderr.puts "Connected from local client"
166
+ end
167
+ end
133
168
  dispatcher = ENV['IDE_PROCESS_DISPATCHER']
134
169
  if dispatcher
135
170
  ENV['IDE_PROCESS_DISPATCHER'] = "#{session.peeraddr[2]}:#{dispatcher}" unless dispatcher.include?(":")
@@ -153,8 +188,6 @@ module Debugger
153
188
  end
154
189
  end
155
190
 
156
- private
157
-
158
191
  def notify_dispatcher_if_needed(host, port, need_notify)
159
192
  return yield port unless need_notify
160
193
 
@@ -10,7 +10,7 @@ require 'ruby-debug-ide/ide_processor'
10
10
  module Debugger
11
11
 
12
12
  class << self
13
- def print_greeting_msg(stream, host, port, debugger_name = "Fast")
13
+ def print_greeting_msg(stream, host, port, debugger_name = "Fast", socket_path = nil)
14
14
  base_gem_name = if defined?(JRUBY_VERSION) || RUBY_VERSION < '1.9.0'
15
15
  'ruby-debug-base'
16
16
  elsif RUBY_VERSION < '2.0.0'
@@ -27,6 +27,8 @@ module Debugger
27
27
 
28
28
  if host && port
29
29
  listens_on = " listens on #{host}:#{port}\n"
30
+ elsif socket_path
31
+ listens_on = " listens on #{socket_path}\n"
30
32
  else
31
33
  listens_on = "\n"
32
34
  end
@@ -37,4 +39,4 @@ module Debugger
37
39
  end
38
40
  end
39
41
 
40
- end
42
+ end
@@ -1,3 +1,3 @@
1
1
  module Debugger
2
- IDE_VERSION='0.7.1.beta2'
2
+ IDE_VERSION='0.7.1.beta3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-debug-ide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1.beta2
4
+ version: 0.7.1.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Barchfeld, Martin Krauskopf, Mark Moseley, JetBrains RubyMine Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-05 00:00:00.000000000 Z
11
+ date: 2019-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  - !ruby/object:Gem::Version
102
102
  version: 1.3.1
103
103
  requirements: []
104
- rubygems_version: 3.0.3
104
+ rubygems_version: 3.0.6
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: IDE interface for ruby-debug.