ruby-debug-ide 0.4.17.beta16 → 0.4.17.beta17

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ if (RUBY_VERSION < '2.0')
6
6
  require 'ruby-debug-base'
7
7
  else
8
8
  require 'debase'
9
- end
9
+ end
10
10
 
11
11
  require 'ruby-debug-ide/version'
12
12
  require 'ruby-debug-ide/xml_printer'
@@ -14,7 +14,7 @@ require 'ruby-debug-ide/ide_processor'
14
14
  require 'ruby-debug-ide/event_processor'
15
15
 
16
16
  module Debugger
17
-
17
+
18
18
  class << self
19
19
  # Prints to the stderr using printf(*args) if debug logging flag (-d) is on.
20
20
  def print_debug(*args)
@@ -25,7 +25,7 @@ module Debugger
25
25
  $stderr.flush
26
26
  end
27
27
  end
28
-
28
+
29
29
  def cleanup_backtrace(backtrace)
30
30
  cleared = []
31
31
  return cleared unless backtrace
@@ -40,12 +40,12 @@ module Debugger
40
40
  end
41
41
  cleared
42
42
  end
43
-
43
+
44
44
  attr_accessor :cli_debug, :xml_debug
45
45
  attr_accessor :control_thread
46
46
  attr_reader :interface
47
47
 
48
-
48
+
49
49
  #
50
50
  # Interrupts the last debugged thread
51
51
  #
@@ -69,10 +69,10 @@ module Debugger
69
69
  start_server(options.host, options.port)
70
70
 
71
71
  raise "Control thread did not start (#{@control_thread}}" unless @control_thread && @control_thread.alive?
72
-
72
+
73
73
  @mutex = Mutex.new
74
74
  @proceed = ConditionVariable.new
75
-
75
+
76
76
  # wait for 'start' command
77
77
  @mutex.synchronize do
78
78
  @proceed.wait(@mutex)
@@ -89,14 +89,14 @@ module Debugger
89
89
  $stderr.print Debugger.cleanup_backtrace(bt.backtrace).map{|l| "\t#{l}"}.join("\n"), "\n"
90
90
  end
91
91
  end
92
-
92
+
93
93
  def run_prog_script
94
94
  return unless @mutex
95
95
  @mutex.synchronize do
96
96
  @proceed.signal
97
97
  end
98
98
  end
99
-
99
+
100
100
  def start_control(host, port)
101
101
  raise "Debugger is not started" unless started?
102
102
  return if @control_thread
@@ -110,11 +110,12 @@ module Debugger
110
110
  $stderr.printf "Fast Debugger (ruby-debug-ide #{IDE_VERSION}, #{gem_name} #{VERSION}) listens on #{host}:#{port}\n"
111
111
  server = TCPServer.new(host, port)
112
112
  while (session = server.accept)
113
- $stderr.puts "Connected from #{session.addr[2]}" if Debugger.cli_debug
113
+ $stderr.puts "Connected from #{session.peeraddr[2]}" if Debugger.cli_debug
114
114
  dispatcher = ENV['IDE_PROCESS_DISPATCHER']
115
115
  if (dispatcher)
116
- ENV['IDE_PROCESS_DISPATCHER'] = "#{session.addr[2]}:#{dispatcher}" unless dispatcher.include?(":")
117
- end
116
+ ENV['IDE_PROCESS_DISPATCHER'] = "#{session.peeraddr[2]}:#{dispatcher}" unless dispatcher.include?(":")
117
+ ENV['DEBUGGER_HOST'] = host
118
+ end
118
119
  begin
119
120
  @interface = RemoteInterface.new(session)
120
121
  self.handler = EventProcessor.new(interface)
@@ -132,9 +133,9 @@ module Debugger
132
133
  end
133
134
  end
134
135
  end
135
-
136
+
136
137
  end
137
-
138
+
138
139
  class Exception # :nodoc:
139
140
  attr_reader :__debug_file, :__debug_line, :__debug_binding, :__debug_context
140
141
  end
@@ -5,10 +5,10 @@ module Debugger
5
5
 
6
6
  require "socket"
7
7
  require "ostruct"
8
-
9
- host = '127.0.0.1'
8
+
9
+ host = ENV['DEBUGGER_HOST']
10
10
  port = find_free_port(host)
11
-
11
+
12
12
  options = OpenStruct.new(
13
13
  'frame_bind' => false,
14
14
  'host' => host,
@@ -18,10 +18,10 @@ module Debugger
18
18
  'tracing' => false,
19
19
  'int_handler' => true
20
20
  )
21
-
21
+
22
22
  acceptor_host, acceptor_port = ENV['IDE_PROCESS_DISPATCHER'].split(":")
23
23
  acceptor_host, acceptor_port = '127.0.0.1', acceptor_host unless acceptor_port
24
-
24
+
25
25
  connected = false
26
26
  3.times do |i|
27
27
  begin
@@ -39,28 +39,28 @@ module Debugger
39
39
  end unless connected
40
40
  end
41
41
  end
42
-
42
+
43
43
  def start_debugger(options)
44
44
  if Debugger.started?
45
45
  #we're in forked child, only need to restart control thread
46
- Debugger.breakpoints.clear
46
+ Debugger.breakpoints.clear
47
47
  Debugger.control_thread = nil
48
48
  Debugger.start_control(options.host, options.port)
49
49
  end
50
-
50
+
51
51
  if options.int_handler
52
52
  # install interruption handler
53
53
  trap('INT') { Debugger.interrupt_last }
54
54
  end
55
-
55
+
56
56
  # set options
57
57
  Debugger.keep_frame_binding = options.frame_bind
58
- Debugger.tracing = options.tracing
59
-
58
+ Debugger.tracing = options.tracing
59
+
60
60
  Debugger.prepare_debugger(options)
61
61
  end
62
-
63
-
62
+
63
+
64
64
  def find_free_port(host)
65
65
  server = TCPServer.open(host, 0)
66
66
  port = server.addr[1]
@@ -1,3 +1,3 @@
1
1
  module Debugger
2
- IDE_VERSION='0.4.17.beta16'
2
+ IDE_VERSION='0.4.17.beta17'
3
3
  end
@@ -160,7 +160,10 @@ module Debugger
160
160
  end
161
161
 
162
162
  if value_str.respond_to?('encode')
163
+ begin
163
164
  value_str = value_str.encode("UTF-8")
165
+ rescue
166
+ end
164
167
  end
165
168
  value_str = "[Binary Data]" if (value_str.respond_to?('is_binary_data?') && value_str.is_binary_data?)
166
169
  print("<variable name=\"%s\" kind=\"%s\" value=\"%s\" type=\"%s\" hasChildren=\"%s\" objectId=\"%#+x\"/>",
@@ -22,7 +22,7 @@ end
22
22
  Gem::Specification.new do |spec|
23
23
  spec.name = "ruby-debug-ide"
24
24
 
25
- spec.homepage = "https://github.com/JetBrains/ruby-debug-ide"
25
+ spec.homepage = "https://github.com/ruby-debug/ruby-debug-ide"
26
26
  spec.summary = "IDE interface for ruby-debug."
27
27
  spec.description = <<-EOF
28
28
  An interface which glues ruby-debug to IDEs like Eclipse (RDT), NetBeans and RubyMine.
@@ -47,4 +47,4 @@ EOF
47
47
 
48
48
  # rdoc
49
49
  spec.has_rdoc = false
50
- end
50
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-debug-ide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.17.beta16
4
+ version: 0.4.17.beta17
5
5
  prerelease: 7
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-26 00:00:00.000000000 Z
12
+ date: 2013-04-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -74,7 +74,7 @@ files:
74
74
  - lib/ruby-debug-ide/version.rb
75
75
  - lib/ruby-debug-ide/xml_printer.rb
76
76
  - lib/ruby-debug-ide.rb
77
- homepage: https://github.com/JetBrains/ruby-debug-ide
77
+ homepage: https://github.com/ruby-debug/ruby-debug-ide
78
78
  licenses: []
79
79
  post_install_message:
80
80
  rdoc_options: []
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  version: 1.3.1
95
95
  requirements: []
96
96
  rubyforge_project: debug-commons
97
- rubygems_version: 1.8.24
97
+ rubygems_version: 1.8.25
98
98
  signing_key:
99
99
  specification_version: 3
100
100
  summary: IDE interface for ruby-debug.