ruby-debug-ide 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c5a25152aa63a501a44485625d761596335fa586
4
- data.tar.gz: 3f1763ba485ab281aa2cc76cc67f5750d32abb5e
2
+ SHA256:
3
+ metadata.gz: ddd9e5401c5afc093a33c52250939944abab7cf945d57cd2a0efd18389c0adbf
4
+ data.tar.gz: 78d3ec32359393c66234648a0296988c85a7309ef05348fadc4f64b4e5119e48
5
5
  SHA512:
6
- metadata.gz: c8d72c31c0b1e379299410a66ba9c34b3bbc1032395b3c24f1d011cf600872e5835459cf326ea7d7a408ecdcd19df8dc60c9c727dea341e92aa3a560be20bf05
7
- data.tar.gz: 15663403fe209b60cf722cd3b775d6734cfe648ec149bce6329724a83c3925eacd89b2d93adcf1a86d8d4715287d4b3b19cd733141d8d03f7698908b9b68064b
6
+ metadata.gz: 1d323ac8d10c8a890b7b7fec0444d346886f9ecb0ed500d6b7f498a2175726a41ecb6bb9bb48a1a9e6426f9a09be3dea6d960797fef5a02274ead00562babfb0
7
+ data.tar.gz: 90d54997a247fa2fc149b6ead69d56f42f61365d84f0eb12026694468aff275f53e64d3ee7bdff49948c0b4c51fac3dafba62e75c39e62165c7b48faa20ed9ae
File without changes
@@ -17,6 +17,7 @@ options = OpenStruct.new(
17
17
  'port' => 1234,
18
18
  'stop' => false,
19
19
  'tracing' => false,
20
+ 'skip_wait_for_start' => false,
20
21
  'int_handler' => true,
21
22
  'dispatcher_port' => -1,
22
23
  'evaluation_timeout' => 10,
@@ -28,7 +29,8 @@ options = OpenStruct.new(
28
29
  'value_as_nested_element' => false,
29
30
  'attach_mode' => false,
30
31
  'cli_debug' => false,
31
- 'key_value_mode' => false
32
+ 'key_value_mode' => false,
33
+ 'socket_path' => nil
32
34
  )
33
35
 
34
36
  opts = OptionParser.new do |opts|
@@ -67,6 +69,7 @@ EOB
67
69
 
68
70
  opts.on('--stop', 'stop when the script is loaded') {options.stop = true}
69
71
  opts.on("-x", "--trace", "turn on line tracing") {options.tracing = true}
72
+ opts.on("--skip_wait_for_start", "skip wait for 'start' command") {options.skip_wait_for_start = true}
70
73
  opts.on("-l", "--load-mode", "load mode (experimental)") {options.load_mode = true}
71
74
  opts.on("-d", "--debug", "Debug self - prints information for debugging ruby-debug itself") do
72
75
  Debugger.cli_debug = true
@@ -98,6 +101,9 @@ EOB
98
101
  opts.on("--value-as-nested-element", "Allow to pass variable's value as nested element instead of attribute") do
99
102
  options.value_as_nested_element = true
100
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
101
107
  opts.separator ""
102
108
  opts.separator "Common options:"
103
109
  opts.on_tail("-v", "--version", "Show version") do
@@ -2,11 +2,6 @@ install_dir = File.expand_path("../../../..", __FILE__)
2
2
  jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
3
3
  rbx = defined?(RUBY_ENGINE) && 'rbx' == RUBY_ENGINE
4
4
 
5
- def already_installed(dep)
6
- !Gem::DependencyInstaller.new(:domain => :local).find_gems_with_sources(dep).empty? ||
7
- !Gem::DependencyInstaller.new(:domain => :local,:prerelease => true).find_gems_with_sources(dep).empty?
8
- end
9
-
10
5
  unless jruby || rbx
11
6
  require 'rubygems'
12
7
  require 'rubygems/command.rb'
@@ -15,14 +10,14 @@ unless jruby || rbx
15
10
 
16
11
  begin
17
12
  Gem::Command.build_args = ARGV
18
- rescue NoMethodError
13
+ rescue NoMethodError
19
14
  end
20
15
 
21
16
  if RUBY_VERSION < "1.9"
22
17
  dep = Gem::Dependency.new("ruby-debug-base", '>=0.10.4')
23
18
  elsif RUBY_VERSION < '2.0'
24
19
  dep = Gem::Dependency.new("ruby-debug-base19x", '>=0.11.30.pre15')
25
- else
20
+ else
26
21
  dep = Gem::Dependency.new("debase", '> 0')
27
22
  end
28
23
 
@@ -39,7 +34,7 @@ unless jruby || rbx
39
34
  puts e.backtrace.join "\n "
40
35
  exit(1)
41
36
  end
42
- end unless dep.nil? || already_installed(dep)
37
+ end unless dep.nil? || dep.matching_specs.any?
43
38
  end
44
39
 
45
40
  # create dummy rakefile to indicate success
@@ -74,23 +74,29 @@ 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
 
90
96
  # wait for 'start' command
91
97
  @mutex.synchronize do
92
98
  @proceed.wait(@mutex)
93
- end
99
+ end unless options.skip_wait_for_start
94
100
  end
95
101
 
96
102
  def debug_program(options)
@@ -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
 
@@ -23,7 +23,7 @@ module Debugger
23
23
  return unless pos
24
24
  breakpoints.each do |b|
25
25
  if b.id == pos
26
- b.expr = @match[2].empty? ? nil : @match[2]
26
+ b.expr = @match[2].empty? ? nil : Command.unescape_incoming(@match[2])
27
27
  print_contdition_set(b.id)
28
28
  break
29
29
  end
File without changes
File without changes
File without changes
@@ -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.0'
2
+ IDE_VERSION='0.7.2'
3
3
  end
@@ -161,6 +161,11 @@ module Debugger
161
161
  else
162
162
  name = exec_with_allocation_control(k, :to_s, OverflowMessageType::EXCEPTION_MESSAGE)
163
163
  end
164
+
165
+ if k.nil?
166
+ name = 'nil'
167
+ end
168
+
164
169
  print_variable(name, v, 'instance')
165
170
  }
166
171
  end
@@ -44,8 +44,4 @@ EOF
44
44
 
45
45
  spec.required_ruby_version = '>= 1.8.2'
46
46
  spec.date = DateTime.now
47
- spec.rubyforge_project = 'debug-commons'
48
-
49
- # rdoc
50
- spec.has_rdoc = false
51
47
  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.0
4
+ version: 0.7.2
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-06-10 00:00:00.000000000 Z
11
+ date: 2020-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -27,7 +27,7 @@ dependencies:
27
27
  description: 'An interface which glues ruby-debug to IDEs like Eclipse (RDT), NetBeans
28
28
  and RubyMine.
29
29
 
30
- '
30
+ '
31
31
  email: rubymine-feedback@jetbrains.com
32
32
  executables:
33
33
  - rdebug-ide
@@ -103,8 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubyforge_project: debug-commons
107
- rubygems_version: 2.6.10
106
+ rubygems_version: 3.0.3
108
107
  signing_key:
109
108
  specification_version: 4
110
109
  summary: IDE interface for ruby-debug.