ruby-debug-ide 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/rdebug-ide +7 -4
- data/lib/ruby-debug.rb +9 -5
- data/lib/ruby-debug/commands/eval.rb +1 -1
- data/lib/ruby-debug/commands/frame.rb +3 -1
- data/lib/ruby-debug/xml_printer.rb +15 -12
- metadata +3 -3
data/bin/rdebug-ide
CHANGED
@@ -8,11 +8,12 @@ require 'ruby-debug'
|
|
8
8
|
$stdout.sync=true
|
9
9
|
|
10
10
|
options = OpenStruct.new(
|
11
|
+
'frame_bind' => false,
|
11
12
|
'host' => nil,
|
13
|
+
'load_mode' => false,
|
12
14
|
'port' => 1234,
|
13
|
-
'
|
14
|
-
'
|
15
|
-
'load_mode' => false
|
15
|
+
'stop' => false,
|
16
|
+
'tracing' => false
|
16
17
|
)
|
17
18
|
|
18
19
|
opts = OptionParser.new do |opts|
|
@@ -24,6 +25,7 @@ EOB
|
|
24
25
|
opts.separator "Options:"
|
25
26
|
opts.on("-h", "--host HOST", "Host name used for remote debugging") {|options.host|}
|
26
27
|
opts.on("-p", "--port PORT", Integer, "Port used for remote debugging") {|options.port|}
|
28
|
+
opts.on('--stop', 'stop when the script is loaded') {options.stop = true}
|
27
29
|
opts.on("-x", "--trace", "turn on line tracing") {options.tracing = true}
|
28
30
|
opts.on("-l", "--load-mode", "load mode (experimental)") {options.load_mode = true}
|
29
31
|
opts.on("-d", "--debug", "Debug self - prints information for debugging ruby-debug itself") do
|
@@ -75,6 +77,7 @@ trap('INT') { Debugger.interrupt_last }
|
|
75
77
|
|
76
78
|
# set options
|
77
79
|
Debugger.keep_frame_binding = options.frame_bind
|
80
|
+
Debugger.tracing = options.tracing
|
78
81
|
|
79
|
-
Debugger.
|
82
|
+
Debugger.debug_program(options)
|
80
83
|
|
data/lib/ruby-debug.rb
CHANGED
@@ -40,7 +40,11 @@ module Debugger
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def at_tracing(file, line)
|
43
|
-
event_processor
|
43
|
+
if event_processor
|
44
|
+
event_processor.at_tracing(self, file, line)
|
45
|
+
else
|
46
|
+
Debugger::print_debug "trace: location=\"%s:%s\", threadId=%d", file, line, self.thnum
|
47
|
+
end
|
44
48
|
end
|
45
49
|
|
46
50
|
def at_line(file, line)
|
@@ -77,12 +81,12 @@ module Debugger
|
|
77
81
|
end
|
78
82
|
end
|
79
83
|
|
80
|
-
def
|
84
|
+
def debug_program(options)
|
81
85
|
return if started?
|
82
86
|
|
83
87
|
start
|
84
88
|
|
85
|
-
start_control(host, port)
|
89
|
+
start_control(options.host, options.port)
|
86
90
|
|
87
91
|
raise "Control thread did not start (#{@control_thread}}" unless @control_thread && @control_thread.alive?
|
88
92
|
|
@@ -94,7 +98,7 @@ module Debugger
|
|
94
98
|
@proceed.wait(@mutex)
|
95
99
|
end
|
96
100
|
|
97
|
-
debug_load(Debugger::PROG_SCRIPT,
|
101
|
+
debug_load(Debugger::PROG_SCRIPT, options.stop, options.load_mode)
|
98
102
|
end
|
99
103
|
|
100
104
|
def run_prog_script
|
@@ -111,7 +115,7 @@ module Debugger
|
|
111
115
|
unless RUBY_PLATFORM =~ /darwin/i # Mac OS X seems to have problem with 'localhost'
|
112
116
|
host ||= 'localhost' # nil does not seem to work for IPv6, localhost does
|
113
117
|
end
|
114
|
-
$stderr.printf "Fast Debugger (ruby-debug-ide 0.4.
|
118
|
+
$stderr.printf "Fast Debugger (ruby-debug-ide 0.4.1) listens on #{host}:#{port}\n"
|
115
119
|
server = TCPServer.new(host, port)
|
116
120
|
while (session = server.accept)
|
117
121
|
begin
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module Debugger
|
2
|
+
|
2
3
|
module FrameFunctions # :nodoc:
|
4
|
+
|
3
5
|
def adjust_frame(frame_pos, absolute)
|
4
6
|
if absolute
|
5
7
|
if frame_pos < 0
|
@@ -25,7 +27,7 @@ module Debugger
|
|
25
27
|
@state.file = @state.context.frame_file(@state.frame_pos)
|
26
28
|
@state.line = @state.context.frame_line(@state.frame_pos)
|
27
29
|
|
28
|
-
print_current_frame(@state.
|
30
|
+
print_current_frame(@state.frame_pos)
|
29
31
|
end
|
30
32
|
|
31
33
|
end
|
@@ -18,6 +18,7 @@ module Debugger
|
|
18
18
|
|
19
19
|
# Sends debug message to the frontend if XML debug logging flag (--xml-debug) is on.
|
20
20
|
def print_debug(*args)
|
21
|
+
Debugger.print_debug(*args)
|
21
22
|
if Debugger.xml_debug
|
22
23
|
msg, *args = args
|
23
24
|
xml_message = CGI.escapeHTML(msg % args)
|
@@ -32,22 +33,23 @@ module Debugger
|
|
32
33
|
end
|
33
34
|
end
|
34
35
|
|
35
|
-
def print_frames(context,
|
36
|
+
def print_frames(context, current_frame_id)
|
36
37
|
print_element("frames") do
|
37
|
-
(0...context.stack_size).each do |
|
38
|
-
print_frame(context,
|
38
|
+
(0...context.stack_size).each do |id|
|
39
|
+
print_frame(context, id, current_frame_id)
|
39
40
|
end
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
43
|
-
def print_current_frame(
|
44
|
+
def print_current_frame(frame_pos)
|
44
45
|
print_debug "Selected frame no #{frame_pos}"
|
45
46
|
end
|
46
47
|
|
47
|
-
def print_frame(context,
|
48
|
+
def print_frame(context, frame_id, current_frame_id)
|
48
49
|
# idx + 1: one-based numbering as classic-debugger
|
49
|
-
|
50
|
-
|
50
|
+
file = context.frame_file(frame_id)
|
51
|
+
print "<frame no=\'%s\' file=\'%s\' line=\'%s\' #{"current='true' " if frame_id == current_frame_id}/>",
|
52
|
+
frame_id + 1, File.expand_path(file), context.frame_line(frame_id)
|
51
53
|
end
|
52
54
|
|
53
55
|
def print_contexts(contexts)
|
@@ -172,14 +174,13 @@ module Debugger
|
|
172
174
|
print "<eval expression=\"%s\" value=\"%s\" />", CGI.escapeHTML(exp), value
|
173
175
|
end
|
174
176
|
|
175
|
-
def print_pp(
|
177
|
+
def print_pp(value)
|
176
178
|
print value
|
177
179
|
end
|
178
180
|
|
179
181
|
def print_list(b, e, file, line)
|
180
182
|
print "[%d, %d] in %s\n", b, e, file
|
181
183
|
if lines = Debugger.source_for(file)
|
182
|
-
n = 0
|
183
184
|
b.upto(e) do |n|
|
184
185
|
if n > 0 && lines[n-1]
|
185
186
|
if n == line
|
@@ -216,12 +217,14 @@ module Debugger
|
|
216
217
|
end
|
217
218
|
|
218
219
|
def print_trace(context, file, line)
|
219
|
-
|
220
|
+
Debugger::print_debug "trace: location=\"%s:%s\", threadId=%d", file, line, context.thnum
|
221
|
+
# TBD: do we want to clog fronend with the <trace> elements? There are tons of them.
|
222
|
+
# print "<trace file=\"%s\" line=\"%s\" threadId=\"%d\" />", file, line, context.thnum
|
220
223
|
end
|
221
224
|
|
222
225
|
def print_at_line(file, line)
|
223
|
-
print "<suspended file=\
|
224
|
-
|
226
|
+
print "<suspended file=\'%s\' line=\'%s\' threadId=\'%d\' frames=\'%d\'/>",
|
227
|
+
File.expand_path(file), line, Debugger.current_context.thnum, Debugger.current_context.stack_size
|
225
228
|
end
|
226
229
|
|
227
230
|
def print_exception(exception, binding)
|
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.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Barchfeld, Martin Krauskopf
|
@@ -9,7 +9,7 @@ autorequire: ruby-debug-base
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-10
|
12
|
+
date: 2008-11-10 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
requirements: []
|
77
77
|
|
78
78
|
rubyforge_project: debug-commons
|
79
|
-
rubygems_version: 1.3.
|
79
|
+
rubygems_version: 1.3.1.1918
|
80
80
|
signing_key:
|
81
81
|
specification_version: 2
|
82
82
|
summary: IDE interface for ruby-debug.
|