rbx-trepanning 0.0.4-universal-rubinius-1.2 → 0.0.6-universal-rubinius-1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +682 -0
- data/NEWS +19 -0
- data/README.textile +8 -9
- data/Rakefile +8 -8
- data/app/complete.rb +52 -0
- data/app/complete.rbc +1288 -0
- data/app/irb.rb +1 -2
- data/app/irb.rbc +55 -72
- data/app/llvm.rbc +780 -878
- data/app/method.rb +1 -1
- data/app/method.rbc +31 -35
- data/app/method_name.rbc +2467 -0
- data/app/options.rb +7 -24
- data/app/options.rbc +238 -132
- data/app/rbx-llvm.rbc +2478 -0
- data/app/util.rb +3 -3
- data/app/util.rbc +23 -27
- data/bin/trepanx +4 -3
- data/bin/trepanx.compiled.rbc +42 -32
- data/data/irbrc +41 -0
- data/data/irbrc.compiled.rbc +640 -0
- data/interface/base_intf.rb +9 -5
- data/interface/base_intf.rbc +200 -146
- data/interface/comcodes.rb +10 -8
- data/interface/comcodes.rbc +68 -26
- data/interface/script.rbc +21 -9
- data/interface/user.rb +74 -8
- data/interface/user.rbc +1702 -156
- data/io/input.rb +37 -14
- data/io/input.rbc +869 -320
- data/io/tcpclient.rb +7 -1
- data/io/tcpclient.rbc +205 -113
- data/io/tcpfns.rb +5 -3
- data/io/tcpfns.rbc +82 -40
- data/io/tcpserver.rb +13 -10
- data/io/tcpserver.rbc +236 -183
- data/lib/trepanning.rb +62 -21
- data/lib/trepanning.rbc +1304 -874
- data/lib/{trepanning.rb.orig → trepanning2.rb} +12 -4
- data/processor/breakpoint.rb +4 -1
- data/processor/command/base/cmd.rb +48 -3
- data/processor/command/base/subcmd.rb +2 -1
- data/processor/command/base/submgr.rb +23 -20
- data/processor/command/base/subsubmgr.rb +13 -2
- data/processor/command/complete.rb +7 -17
- data/processor/command/continue.rb +19 -11
- data/processor/command/disassemble.rb +39 -12
- data/processor/command/eval.rb +23 -5
- data/processor/command/help.rb +60 -6
- data/processor/command/info_subcmd/{file.rb → files.rb} +76 -18
- data/processor/command/info_subcmd/line.rb +86 -0
- data/processor/command/info_subcmd/program.rb +2 -11
- data/processor/command/info_subcmd/ruby.rb +62 -0
- data/processor/command/info_subcmd/variables.rb +7 -0
- data/processor/command/irb.rb +39 -7
- data/processor/command/macro.rb +76 -0
- data/processor/command/set_subcmd/confirm.rb +24 -0
- data/processor/command/set_subcmd/max.rb +4 -5
- data/processor/command/show.rb +11 -0
- data/processor/command/show_subcmd/auto.rb +1 -0
- data/processor/command/show_subcmd/basename.rb +1 -2
- data/processor/command/show_subcmd/confirm.rb +18 -0
- data/processor/command/show_subcmd/max.rb +0 -2
- data/processor/command/source.rb +0 -1
- data/processor/default.rb +2 -0
- data/processor/disassemble.rb +1 -0
- data/processor/load_cmds.rb +104 -20
- data/processor/location.rb +11 -12
- data/processor/main.rb +10 -6
- data/processor/mock.rb +6 -2
- data/processor/stepping.rb +1 -4
- data/processor/subcmd.rb +3 -2
- data/processor/validate.rb +3 -3
- data/sample/list-terminal-colors.rbc +158 -4
- data/sample/rocky-trepanx-colors.rb +15 -7
- data/sample/rocky-trepanx-colors.rbc +530 -0
- data/test/data/quit2.cmd +6 -0
- data/test/data/quit2.right +3 -0
- data/test/data/step-bug.cmd +11 -0
- data/test/data/step-bug.right +3 -0
- data/test/example/step-bug.rb +14 -0
- data/test/integration/helper.rb +1 -1
- data/test/integration/skip-test-step-bug.rb +17 -0
- data/test/integration/test-quit.rb +11 -0
- data/test/unit/test-app-util.rb +0 -1
- data/test/unit/test-base-cmd.rb +47 -0
- data/test/unit/test-base-subcmd.rb +2 -2
- data/test/unit/test-base-submgr.rb +24 -0
- data/test/unit/test-cmd-help.rb +4 -0
- data/test/unit/test-completion.rb +38 -0
- data/test/unit/test-intf-user.rb +2 -2
- data/test/unit/test-io-tcpclient.rb +3 -2
- data/test/unit/test-proc-eval.rb +1 -1
- data/test/unit/test-proc-load_cmds.rb +9 -0
- data/test/unit/test-subcmd-help.rb +1 -5
- metadata +182 -167
- data/app/options.rb.orig +0 -154
- data/bin/trepan.orig +0 -0
- data/bin/trepan.rej +0 -11
- data/lib/trepanning.rb.rej +0 -11
- data/sample/rocky-dot-trepanrc.orig +0 -0
- data/sample/rocky-dot-trepanrc.rej +0 -11
data/lib/trepanning.rb
CHANGED
@@ -4,6 +4,7 @@ require 'readline'
|
|
4
4
|
require 'compiler/iseq'
|
5
5
|
|
6
6
|
require 'rubygems'; require 'require_relative'
|
7
|
+
require_relative '../app/complete'
|
7
8
|
require_relative '../app/frame'
|
8
9
|
require_relative '../app/util' # get_dollar_0
|
9
10
|
require_relative '../processor/main'
|
@@ -51,12 +52,17 @@ class Trepan
|
|
51
52
|
cmdproc_settings = {:highlight => @settings[:highlight]}
|
52
53
|
|
53
54
|
@processor = CmdProcessor.new(self, cmdproc_settings)
|
55
|
+
@completion_proc = method(:completion_method)
|
54
56
|
|
57
|
+
@in_deferred_checking = false
|
58
|
+
|
55
59
|
@intf =
|
56
60
|
if @settings[:server]
|
61
|
+
@completion_proc = nil
|
57
62
|
opts = Trepan::ServerInterface::DEFAULT_INIT_CONNECTION_OPTS.dup
|
58
63
|
opts[:port] = @settings[:port] if @settings[:port]
|
59
64
|
opts[:host] = @settings[:host] if @settings[:host]
|
65
|
+
opts[:readline] = false
|
60
66
|
puts("starting debugger in out-of-process mode port at " +
|
61
67
|
"#{opts[:host]}:#{opts[:port]}")
|
62
68
|
[Trepan::ServerInterface.new(nil, nil, opts)]
|
@@ -64,9 +70,13 @@ class Trepan
|
|
64
70
|
opts = Trepan::ClientInterface::DEFAULT_INIT_CONNECTION_OPTS.dup
|
65
71
|
opts[:port] = @settings[:port] if @settings[:port]
|
66
72
|
opts[:host] = @settings[:host] if @settings[:host]
|
73
|
+
opts[:complete] = @completion_proc
|
74
|
+
opts[:readline] ||= @settings[:readline]
|
67
75
|
[Trepan::ClientInterface.new(nil, nil, nil, nil, opts)]
|
68
76
|
else
|
69
|
-
|
77
|
+
opts = {:complete => @completion_proc,
|
78
|
+
:readline => @settings[:readline]}
|
79
|
+
[Trepan::UserInterface.new(@input, @output, opts)]
|
70
80
|
end
|
71
81
|
|
72
82
|
process_cmdfile_setting(@settings)
|
@@ -83,19 +93,6 @@ class Trepan
|
|
83
93
|
:show_bytecode => false,
|
84
94
|
}
|
85
95
|
|
86
|
-
@history_path = File.expand_path("~/.trepanx")
|
87
|
-
|
88
|
-
if File.exists?(@history_path)
|
89
|
-
File.readlines(@history_path).each do |line|
|
90
|
-
Readline::HISTORY << line.strip
|
91
|
-
end
|
92
|
-
@history_io = File.new(@history_path, "a")
|
93
|
-
else
|
94
|
-
@history_io = File.new(@history_path, "w")
|
95
|
-
end
|
96
|
-
|
97
|
-
@history_io.sync = true
|
98
|
-
|
99
96
|
@processor.dbgr = self
|
100
97
|
@deferred_breakpoints = []
|
101
98
|
@thread = nil
|
@@ -130,6 +127,45 @@ class Trepan
|
|
130
127
|
@settings[:restore_profile] && File.readable?(@settings[:restore_profile])
|
131
128
|
end
|
132
129
|
|
130
|
+
# The method is called when we want to do debugger command completion
|
131
|
+
# such as called from GNU Readline with <TAB>.
|
132
|
+
def completion_method(str, leading=Readline.line_buffer)
|
133
|
+
args =
|
134
|
+
if str.empty? && leading.end_with?(' ')
|
135
|
+
# A line ending with a blank means we want to get all completions
|
136
|
+
# of the *next* token, not the current token.
|
137
|
+
leading.split(' ').compact + ['']
|
138
|
+
else
|
139
|
+
# We split on a single blank rather than sequences of spaces
|
140
|
+
# because we need to keep the line exactly as it is except for the
|
141
|
+
# last token
|
142
|
+
leading.split(' ').compact
|
143
|
+
end
|
144
|
+
completion = @processor.complete(args)
|
145
|
+
if 1 == completion.size
|
146
|
+
last_token = completion[0].split[-1]
|
147
|
+
if last_token == str
|
148
|
+
# If we were at the end of a complete token add a space so that
|
149
|
+
# the next time, we'll complete any context after that.
|
150
|
+
[str + ' ']
|
151
|
+
elsif str.end_with?(' ') && str.strip == last_token
|
152
|
+
# There is nothing more to complete
|
153
|
+
[]
|
154
|
+
elsif str.empty? && completion[0] == leading
|
155
|
+
# There is also nothing more to complete
|
156
|
+
[]
|
157
|
+
else
|
158
|
+
[last_token]
|
159
|
+
end
|
160
|
+
else
|
161
|
+
# We have multiple completions. Get the last token so that will
|
162
|
+
# be presented as a list of completions.
|
163
|
+
completion.map do |cmd|
|
164
|
+
cmd.split[-1]
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
133
169
|
## HACK to skip over loader code. Until I find something better...
|
134
170
|
def skip_loader
|
135
171
|
cmds =
|
@@ -153,9 +189,9 @@ class Trepan
|
|
153
189
|
@intf << startup
|
154
190
|
end
|
155
191
|
|
156
|
-
|
192
|
+
attr_reader :completion_proc # GNU Readline completion proc
|
157
193
|
attr_reader :variables, :current_frame, :breakpoints
|
158
|
-
attr_reader :vm_locations, :
|
194
|
+
attr_reader :vm_locations, :debugee_thread
|
159
195
|
|
160
196
|
def self.global(settings={})
|
161
197
|
@global ||= new(settings)
|
@@ -208,7 +244,7 @@ class Trepan
|
|
208
244
|
alias debugger start
|
209
245
|
|
210
246
|
def stop(settings = {})
|
211
|
-
|
247
|
+
Rubinius::VM.debug_channel = nil
|
212
248
|
end
|
213
249
|
|
214
250
|
def add_command_file(cmdfile, opts={}, stderr=$stderr)
|
@@ -313,15 +349,20 @@ class Trepan
|
|
313
349
|
end
|
314
350
|
|
315
351
|
def add_deferred_breakpoint(klass_name, which, name, line)
|
316
|
-
dbp =
|
317
|
-
|
352
|
+
dbp = Trepan::DeferredBreakpoint.new(self, @current_frame, klass_name,
|
353
|
+
which, name, line,
|
354
|
+
@deferred_breakpoints)
|
318
355
|
@deferred_breakpoints << dbp
|
319
356
|
# @processor.brkpts << dbp
|
320
357
|
end
|
321
358
|
|
322
359
|
def check_deferred_breakpoints
|
323
|
-
@
|
324
|
-
|
360
|
+
unless @in_deferred_checking
|
361
|
+
@in_deferred_checking = true
|
362
|
+
@deferred_breakpoints.delete_if do |bp|
|
363
|
+
bp.resolve!
|
364
|
+
end
|
365
|
+
@in_deferred_checking = false
|
325
366
|
end
|
326
367
|
end
|
327
368
|
|