debugger-xml 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +14 -6
- data/bin/rdebug-ide +10 -1
- data/bin/rdebug-vim +5 -0
- data/lib/debugger/xml.rb +8 -0
- data/lib/debugger/xml/extensions/vim_server.rb +10 -2
- data/lib/debugger/xml/fake_logger.rb +11 -0
- data/lib/debugger/xml/ide/interface.rb +7 -2
- data/lib/debugger/xml/ide/logger.rb +11 -0
- data/lib/debugger/xml/version.rb +1 -1
- data/lib/debugger/xml/vim/interface.rb +4 -1
- data/lib/debugger/xml/vim/logger.rb +18 -0
- data/test/test_helper.rb +1 -0
- metadata +12 -9
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
OTZiODljZjRmYmUxMzk5NTEwMTMwNzlhMWM4NWY3MjhmMGQxOTk3Mw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
OTM4ZDY2YzJhYzJmMDZkOGU0ZDY4MjA3MDBkZjhmYjE4NWFhZDYxOA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZTFlNGRkNTdlMzlmMDQyNWEyMDgyYzk4YzJiZTVhYjA3YTU2NDlmMTY3YmJj
|
10
|
+
Mzk4YTFkNDdlNDA1ZjI0Mzk5M2Q5ZmYxOTNjY2EzNjk2NzQyMDNkMmQzNmJl
|
11
|
+
YWVhNzlmMjMxN2FiMTdiMjUwZGExNDUwZmMwMzRiOTdjZDk3OTY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YzhjZDIwZmU1YzA3ZGY1MWVlN2MxYjBmZmZiM2M0YWQ0N2JlNmMxNmFmM2I2
|
14
|
+
MjcwNDc1MzViOTM2MmZlMTBkODQ1YzQ5ZTFmMGVmNmNlOWRjMDQ1Nzc2OTNm
|
15
|
+
YTgzYzU5ZjMwNWZlYjgwMzE0MWZjZjNhMmM3YTQ1ZjJlMDAzY2E=
|
data/bin/rdebug-ide
CHANGED
@@ -20,6 +20,11 @@ class RdebugIde
|
|
20
20
|
Debugger.wait_connection = true
|
21
21
|
Debugger.printer = Printers::Xml.new
|
22
22
|
Debugger.const_set("PROG_SCRIPT", ARGV.shift)
|
23
|
+
Debugger::Xml.logger = if options.debug_mode
|
24
|
+
Debugger::Xml::Ide::Logger.new
|
25
|
+
else
|
26
|
+
Debugger::Xml::FakeLogger.new
|
27
|
+
end
|
23
28
|
end
|
24
29
|
|
25
30
|
def run
|
@@ -61,7 +66,10 @@ class RdebugIde
|
|
61
66
|
|
62
67
|
def opts
|
63
68
|
@opts ||= begin
|
64
|
-
@options = OpenStruct.new(
|
69
|
+
@options = OpenStruct.new(
|
70
|
+
host: "127.0.0.1", port: 12345, stop: false, tracing: false, wait_for_start: true,
|
71
|
+
int_handler: true, debug_mode: false
|
72
|
+
)
|
65
73
|
opts = OptionParser.new do |opts|
|
66
74
|
opts.banner = %{
|
67
75
|
Using rdebug-ide
|
@@ -71,6 +79,7 @@ class RdebugIde
|
|
71
79
|
opts.separator ""
|
72
80
|
opts.separator "Options:"
|
73
81
|
opts.on("-h", "--host HOST", "Host name used for remote debugging") { |host| @options.host = host }
|
82
|
+
opts.on("-d", "--debug", "Enable debug mode") { |host| @options.debug_mode = true }
|
74
83
|
opts.on("--cport PORT", Integer, "Port used for control commands") { |cport| @options.cport = cport }
|
75
84
|
opts.on("-p", "--port PORT", Integer, "Port used for remote debugging") { |port| @options.port = port }
|
76
85
|
opts.on("--wait", String, "Wait for 'start' command") do |bool|
|
data/bin/rdebug-vim
CHANGED
@@ -16,6 +16,11 @@ class RdebugVim
|
|
16
16
|
Debugger.wait_for_start = true
|
17
17
|
Debugger.printer = Printers::Xml.new
|
18
18
|
Debugger.const_set("PROG_SCRIPT", options.script)
|
19
|
+
Debugger::Xml.logger = if options.debug_mode
|
20
|
+
Debugger::Xml::Vim::Logger.new(options.logger_file)
|
21
|
+
else
|
22
|
+
Debugger::Xml::FakeLogger.new
|
23
|
+
end
|
19
24
|
end
|
20
25
|
|
21
26
|
def run
|
data/lib/debugger/xml.rb
CHANGED
@@ -5,29 +5,37 @@ module Debugger
|
|
5
5
|
|
6
6
|
def start_for_vim(options)
|
7
7
|
return if @control_thread
|
8
|
+
Xml.logger.puts("Going to daemonize");
|
8
9
|
daemonize!
|
10
|
+
Xml.logger.puts("Successfully daemonized");
|
9
11
|
$stdout.reopen(options.output_file, 'w')
|
10
12
|
$stdout.sync
|
11
13
|
$stderr.reopen($stdout)
|
14
|
+
Xml.logger.puts("Redirected stderr");
|
12
15
|
@mutex = Mutex.new
|
13
16
|
@proceed = ConditionVariable.new
|
14
17
|
start
|
18
|
+
Xml.logger.puts("Started debugger");
|
15
19
|
File.unlink(options.socket) if File.exist?(options.socket)
|
16
20
|
server = UNIXServer.new(options.socket)
|
17
21
|
Xml::Vim::Notification.new("establish_connection", options).send
|
22
|
+
Xml.logger.puts("Sent 'established_connection' command");
|
18
23
|
@control_thread = DebugThread.new do
|
19
24
|
begin
|
20
25
|
while (session = server.accept)
|
26
|
+
Xml.logger.puts("Accepted connection");
|
21
27
|
interface = Xml::Vim::Interface.new(session, options)
|
22
28
|
processor = Xml::Vim::ControlCommandProcessor.new(interface)
|
23
29
|
self.handler = Xml::Vim::Processor.new(interface)
|
30
|
+
Xml.logger.puts("Going to process commands");
|
24
31
|
processor.process_commands
|
25
32
|
end
|
26
33
|
rescue Exception => e
|
27
|
-
puts
|
28
|
-
puts
|
34
|
+
Xml.logger.puts("INTERNAL ERROR!!! #{$!}") rescue nil
|
35
|
+
Xml.logger.puts($!.backtrace.map{|l| "\t#{l}"}.join("\n")) rescue nil
|
29
36
|
raise e
|
30
37
|
ensure
|
38
|
+
Xml.logger.puts("Closing server");
|
31
39
|
server.close
|
32
40
|
end
|
33
41
|
end
|
@@ -50,7 +50,9 @@ module Debugger
|
|
50
50
|
def read_command(*args)
|
51
51
|
result = non_blocking_gets
|
52
52
|
raise IOError unless result
|
53
|
-
result.chomp
|
53
|
+
result.chomp.tap do |r|
|
54
|
+
Xml.logger.puts("Read command: #{r}")
|
55
|
+
end
|
54
56
|
end
|
55
57
|
|
56
58
|
def readline_support?
|
@@ -58,7 +60,10 @@ module Debugger
|
|
58
60
|
end
|
59
61
|
|
60
62
|
def print(*args)
|
61
|
-
|
63
|
+
escaped_args = escape_input(args)
|
64
|
+
value = escaped_args.first % escaped_args[1..-1]
|
65
|
+
Xml.logger.puts("Going to print: #{value}")
|
66
|
+
@socket.printf(value)
|
62
67
|
end
|
63
68
|
|
64
69
|
end
|
data/lib/debugger/xml/version.rb
CHANGED
@@ -11,7 +11,10 @@ module Debugger
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def print(*args)
|
14
|
-
|
14
|
+
escaped_args = escape_input(args)
|
15
|
+
value = escaped_args.first % escaped_args[1..-1]
|
16
|
+
Xml.logger.puts("Going to print: #{value}")
|
17
|
+
@output << sprintf(value)
|
15
18
|
end
|
16
19
|
|
17
20
|
def send_response
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Debugger
|
2
|
+
module Xml
|
3
|
+
module Vim
|
4
|
+
class Logger
|
5
|
+
def initialize(logger_file)
|
6
|
+
@logger_file = logger_file
|
7
|
+
end
|
8
|
+
|
9
|
+
def puts(string)
|
10
|
+
File.open(@logger_file, 'a') do |f|
|
11
|
+
# match vim redir style new lines, rather than trailing
|
12
|
+
f << "\ndebugger-xml, #{Time.now.strftime("%H:%M:%S")} : #{string.chomp}"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debugger-xml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Astashov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debugger
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - '>='
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.6.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - '>='
|
24
|
+
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.6.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: builder
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - '>='
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - '>='
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -114,12 +114,15 @@ files:
|
|
114
114
|
- lib/debugger/xml/extensions/ide_server.rb
|
115
115
|
- lib/debugger/xml/extensions/processor.rb
|
116
116
|
- lib/debugger/xml/extensions/vim_server.rb
|
117
|
+
- lib/debugger/xml/fake_logger.rb
|
117
118
|
- lib/debugger/xml/ide/control_command_processor.rb
|
118
119
|
- lib/debugger/xml/ide/interface.rb
|
120
|
+
- lib/debugger/xml/ide/logger.rb
|
119
121
|
- lib/debugger/xml/ide/processor.rb
|
120
122
|
- lib/debugger/xml/version.rb
|
121
123
|
- lib/debugger/xml/vim/control_command_processor.rb
|
122
124
|
- lib/debugger/xml/vim/interface.rb
|
125
|
+
- lib/debugger/xml/vim/logger.rb
|
123
126
|
- lib/debugger/xml/vim/notification.rb
|
124
127
|
- lib/debugger/xml/vim/processor.rb
|
125
128
|
- test/breakpoints_test.rb
|
@@ -185,17 +188,17 @@ require_paths:
|
|
185
188
|
- lib
|
186
189
|
required_ruby_version: !ruby/object:Gem::Requirement
|
187
190
|
requirements:
|
188
|
-
- - '>='
|
191
|
+
- - ! '>='
|
189
192
|
- !ruby/object:Gem::Version
|
190
193
|
version: '0'
|
191
194
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
192
195
|
requirements:
|
193
|
-
- - '>='
|
196
|
+
- - ! '>='
|
194
197
|
- !ruby/object:Gem::Version
|
195
198
|
version: '0'
|
196
199
|
requirements: []
|
197
200
|
rubyforge_project:
|
198
|
-
rubygems_version: 2.0.
|
201
|
+
rubygems_version: 2.0.7
|
199
202
|
signing_key:
|
200
203
|
specification_version: 4
|
201
204
|
summary: Implements XML interface for the 'debugger' gem, compatible with ruby-debug-ide
|