rbx-trepanning 0.0.6-universal-rubinius-1.2 → 0.0.7-universal-rubinius-1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/ChangeLog +161 -0
- data/Makefile +13 -0
- data/NEWS +11 -0
- data/Rakefile +6 -5
- data/app/.gitignore +2 -0
- data/app/breakpoint.rb +53 -36
- data/app/brkptmgr.rb +10 -0
- data/app/complete.rb +29 -2
- data/app/condition.rb +22 -0
- data/app/default.rb +1 -0
- data/app/eventbuffer.rb +147 -0
- data/app/frame.rb +3 -1
- data/app/options.rb +2 -2
- data/app/run.rb +5 -3
- data/bin/.gitignore +2 -0
- data/data/.gitignore +2 -0
- data/doc/.gitignore +1 -0
- data/doc/debugger.html +108 -0
- data/interface/.gitignore +2 -0
- data/interface/user.rb +8 -7
- data/io/.gitignore +3 -0
- data/io/input.rb +14 -8
- data/lib/.gitignore +2 -0
- data/lib/trepanning.rb +25 -33
- data/processor/.gitignore +3 -0
- data/processor/Makefile +7 -0
- data/processor/breakpoint.rb +4 -0
- data/processor/command/.gitignore +2 -0
- data/processor/command/backtrace.rb +5 -0
- data/processor/command/base/.gitignore +2 -0
- data/processor/command/base/subcmd.rb +2 -1
- data/processor/command/base/subsubcmd.rb +23 -1
- data/processor/command/base/subsubmgr.rb +2 -1
- data/processor/command/complete.rb +2 -1
- data/processor/command/condition.rb +62 -0
- data/processor/command/down.rb +4 -4
- data/processor/command/eval.rb +14 -6
- data/processor/command/exit.rb +8 -7
- data/processor/command/frame.rb +6 -2
- data/processor/command/info_subcmd/.gitignore +3 -0
- data/processor/command/info_subcmd/breakpoints.rb +8 -0
- data/processor/command/info_subcmd/files.rb +1 -1
- data/processor/command/info_subcmd/line.rb +1 -1
- data/processor/command/info_subcmd/ruby.rb +1 -1
- data/processor/command/kill.rb +21 -10
- data/processor/command/macro.rb +15 -23
- data/processor/command/set_subcmd/.gitignore +2 -0
- data/processor/command/set_subcmd/auto_subcmd/.gitignore +2 -0
- data/processor/command/set_subcmd/debug_subcmd/.gitignore +2 -0
- data/processor/command/set_subcmd/different.rb +2 -0
- data/processor/command/set_subcmd/max_subcmd/.gitignore +2 -0
- data/processor/command/set_subcmd/substitute_subcmd/.gitignore +3 -0
- data/processor/command/set_subcmd/trace_subcmd/.gitignore +2 -0
- data/processor/command/set_subcmd/trace_subcmd/buffer.rb +42 -0
- data/processor/command/set_subcmd/trace_subcmd/print.rb +13 -29
- data/processor/command/show_subcmd/.gitignore +3 -0
- data/processor/command/show_subcmd/alias.rb +7 -3
- data/processor/command/show_subcmd/auto_subcmd/.gitignore +3 -0
- data/processor/command/show_subcmd/auto_subcmd/irb.rb +1 -1
- data/processor/command/show_subcmd/debug_subcmd/.gitignore +3 -0
- data/processor/command/show_subcmd/macro.rb +62 -0
- data/processor/command/show_subcmd/max_subcmd/.gitignore +2 -0
- data/processor/command/show_subcmd/trace_subcmd/.gitignore +2 -0
- data/processor/command/show_subcmd/trace_subcmd/buffer.rb +64 -0
- data/processor/command/show_subcmd/trace_subcmd/print.rb +5 -20
- data/processor/command/source.rb +7 -0
- data/processor/command/up.rb +12 -8
- data/processor/eventbuf.rb +101 -0
- data/processor/frame.rb +19 -1
- data/processor/hook.rb +2 -2
- data/processor/load_cmds.rb +57 -49
- data/processor/location.rb +40 -0
- data/processor/main.rb +27 -26
- data/processor/msg.rb +17 -0
- data/processor/stepping.rb +21 -1
- data/processor/validate.rb +1 -0
- data/rbx-trepanning.gemspec +40 -0
- data/sample/.gitignore +2 -0
- data/test/data/.gitignore +1 -0
- data/test/example/.gitignore +2 -0
- data/test/functional/.gitignore +3 -0
- data/test/functional/test-finish.rb +2 -2
- data/test/integration/.gitignore +3 -0
- data/test/unit/.gitignore +3 -0
- data/test/unit/cmd-helper.rb +6 -2
- data/test/unit/test-app-brkpt.rb +14 -12
- data/test/unit/test-app-complete.rb +39 -0
- data/test/unit/test-app-condition.rb +18 -0
- data/test/unit/test-app-options.rb +8 -1
- data/test/unit/test-base-subsubcmd.rb +21 -0
- data/test/unit/test-cmd-finish.rb +4 -0
- data/test/unit/test-completion.rb +11 -6
- data/test/unit/test-proc-load_cmds.rb +2 -2
- metadata +295 -218
- data/app/breakpoint.rbc +0 -3551
- data/app/brkptmgr.rbc +0 -2903
- data/app/client.rbc +0 -1225
- data/app/complete.rbc +0 -1288
- data/app/default.rbc +0 -1132
- data/app/display.rbc +0 -2578
- data/app/frame.rbc +0 -1808
- data/app/irb.rbc +0 -2094
- data/app/iseq.rbc +0 -2192
- data/app/llvm.rbc +0 -2478
- data/app/method.rbc +0 -2492
- data/app/method_name.rbc +0 -2467
- data/app/mock.rbc +0 -398
- data/app/options.rbc +0 -2898
- data/app/rbx-llvm.rbc +0 -2478
- data/app/run.rbc +0 -1244
- data/app/util.rbc +0 -1146
- data/app/validate.rbc +0 -676
- data/bin/trepan.compiled.rbc +0 -1043
- data/bin/trepanx.compiled.rbc +0 -1049
- data/data/irbrc.compiled.rbc +0 -640
- data/interface/base_intf.rbc +0 -1899
- data/interface/client.rbc +0 -1072
- data/interface/comcodes.rbc +0 -385
- data/interface/script.rbc +0 -1642
- data/interface/server.rbc +0 -2213
- data/interface/user.rbc +0 -2867
- data/io/base_io.rbc +0 -2111
- data/io/input.rbc +0 -2528
- data/io/null_output.rbc +0 -730
- data/io/string_array.rbc +0 -2466
- data/io/tcpclient.rbc +0 -2419
- data/io/tcpfns.rbc +0 -694
- data/io/tcpserver.rbc +0 -2638
- data/lib/trepanning.rbc +0 -7705
- data/lib/trepanning2.rb +0 -441
- data/sample/list-terminal-colors.rbc +0 -2318
- data/sample/rocky-trepanx-colors.rbc +0 -530
- data/test/data/step-bug.cmd +0 -11
- data/test/data/step-bug.right +0 -3
- data/test/example/step-bug.rb +0 -14
- data/test/integration/skip-test-step-bug.rb +0 -17
@@ -42,7 +42,7 @@ class TestFinish < Test::Unit::TestCase
|
|
42
42
|
def five; 5 end
|
43
43
|
def something(x)
|
44
44
|
return 1 if x <= 1
|
45
|
-
x =
|
45
|
+
x =
|
46
46
|
if five > 5
|
47
47
|
24
|
48
48
|
else
|
@@ -63,7 +63,7 @@ class TestFinish < Test::Unit::TestCase
|
|
63
63
|
'-> ',
|
64
64
|
'return 1 if x <= 1',
|
65
65
|
'<- ',
|
66
|
-
'
|
66
|
+
'x =', '22']
|
67
67
|
compare_output(out, d, cmds)
|
68
68
|
end
|
69
69
|
|
data/test/unit/cmd-helper.rb
CHANGED
@@ -9,6 +9,7 @@ require_relative '../../processor/frame'
|
|
9
9
|
|
10
10
|
module UnitHelper
|
11
11
|
|
12
|
+
module_function
|
12
13
|
def common_setup
|
13
14
|
@dbg = MockDebugger::MockDebugger.new(:nx => true)
|
14
15
|
@cmdproc = Trepan::CmdProcessor.new(@dbg)
|
@@ -33,13 +34,16 @@ module UnitHelper
|
|
33
34
|
end
|
34
35
|
reset_cmdproc_vars
|
35
36
|
end
|
36
|
-
|
37
|
+
|
38
|
+
def common_teardown
|
39
|
+
@cmdproc.finalize
|
40
|
+
end
|
37
41
|
|
38
42
|
def reset_cmdproc_vars
|
39
43
|
@cmdproc.instance_variable_set('@msgs', [])
|
40
44
|
@cmdproc.instance_variable_set('@errmsgs', [])
|
41
45
|
end
|
42
|
-
|
46
|
+
|
43
47
|
end
|
44
48
|
|
45
49
|
if __FILE__ == $0
|
data/test/unit/test-app-brkpt.rb
CHANGED
@@ -11,19 +11,21 @@ class TestAppBrkpt < Test::Unit::TestCase
|
|
11
11
|
assert_equal(false, b1.temp?)
|
12
12
|
assert_equal(0, b1.hits)
|
13
13
|
assert_equal('B', b1.icon_char)
|
14
|
-
|
15
|
-
|
16
|
-
# assert_equal(b1.source_container, tf.source_container)
|
14
|
+
assert_equal(true, b1.condition?(binding))
|
15
|
+
assert_equal(1, b1.hits)
|
17
16
|
b1.enabled = false
|
17
|
+
assert_equal(false, b1.active?)
|
18
18
|
assert_equal('b', b1.icon_char)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
b2
|
27
|
-
assert_equal(
|
19
|
+
assert_raises ArgumentError do
|
20
|
+
b1.activate
|
21
|
+
end
|
22
|
+
|
23
|
+
b2 = Trepan::Breakpoint.new('<start>', method, 0, 2, 0)
|
24
|
+
b2.activate
|
25
|
+
assert_equal(true, b2.active?)
|
26
|
+
b2.remove!
|
27
|
+
assert_equal(false, b2.active?)
|
28
|
+
b3 = Trepan::Breakpoint.new('temp brkpt', method, 2, 3, 0, :temp => true)
|
29
|
+
assert_equal('t', b3.icon_char)
|
28
30
|
end
|
29
31
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
require 'rubygems'; require 'require_relative'
|
4
|
+
require_relative '../../app/complete'
|
5
|
+
|
6
|
+
class TestAppUtil < Test::Unit::TestCase
|
7
|
+
include Trepan::Complete
|
8
|
+
def test_complete
|
9
|
+
hash = {'ab' => 1, 'aac' => 2, 'aa' => 3, 'a' => 4}
|
10
|
+
ary = hash.keys.sort
|
11
|
+
[[[], 'b'], [ary, 'a'], [%w(aa aac), 'aa'],
|
12
|
+
[ary, ''], [['ab'], 'ab'], [[], 'abc']].each do |result, prefix|
|
13
|
+
assert_equal(result, complete_token(ary, prefix),
|
14
|
+
"Trouble matching #{ary}.inspect on #{prefix.inspect}")
|
15
|
+
end
|
16
|
+
[[ary, 'a'], [%w(aa aac), 'aa'],
|
17
|
+
[['ab'], 'ab'], [[], 'abc']].each do |result_keys, prefix|
|
18
|
+
result = result_keys.map {|key| [key, hash[key]]}
|
19
|
+
assert_equal(result, complete_token_with_next(hash, prefix),
|
20
|
+
"Trouble matching #{hash}.inspect on #{prefix.inspect}")
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_next_token
|
26
|
+
x = ' now is the time'
|
27
|
+
[[0, [ 5, 'now']],
|
28
|
+
[2, [ 5, 'now']],
|
29
|
+
[5, [ 8, 'is']],
|
30
|
+
[8, [13, 'the']],
|
31
|
+
[9, [13, 'the']],
|
32
|
+
[13, [19, 'time']],
|
33
|
+
[19, [19, '']],
|
34
|
+
].each do |pos, expect|
|
35
|
+
assert_equal expect, next_token(x, pos)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'stringio'
|
3
|
+
require 'test/unit'
|
4
|
+
require 'rubygems'; require 'require_relative'
|
5
|
+
require_relative '../../app/condition'
|
6
|
+
|
7
|
+
class TestAppCondition < Test::Unit::TestCase
|
8
|
+
include Trepan::Condition
|
9
|
+
|
10
|
+
def test_basic
|
11
|
+
assert valid_condition?('1+2')
|
12
|
+
old_stderr = $stderr
|
13
|
+
new_stdout = StringIO.new
|
14
|
+
$stderr = new_stdout
|
15
|
+
assert_equal nil, valid_condition?('1+')
|
16
|
+
$stderr = old_stderr
|
17
|
+
end
|
18
|
+
end
|
@@ -35,13 +35,20 @@ class TestAppOptions < Test::Unit::TestCase
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_binary_opts
|
38
|
-
%w(nx).each do |name|
|
38
|
+
%w(nx readline).each do |name|
|
39
39
|
setup
|
40
40
|
o = ["--#{name}"]
|
41
41
|
rest = @opts.parse o
|
42
42
|
assert_equal('', @stderr.string)
|
43
43
|
assert_equal(true, @options[name.to_sym])
|
44
44
|
end
|
45
|
+
# --no- options
|
46
|
+
%w(readline).each do |name|
|
47
|
+
o = ["--no-#{name}"]
|
48
|
+
rest = @opts.parse o
|
49
|
+
assert_equal('', @stderr.string)
|
50
|
+
assert_equal(false, @options[name.to_sym])
|
51
|
+
end
|
45
52
|
end
|
46
53
|
|
47
54
|
def test_help_and_version_opts
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
require 'rubygems'; require 'require_relative'
|
4
|
+
require_relative '../../processor/command/base/subsubcmd'
|
5
|
+
|
6
|
+
# Mock debugger stub. FIXME: put in common helper routine.
|
7
|
+
class Trepan
|
8
|
+
end
|
9
|
+
|
10
|
+
$errors = []
|
11
|
+
class TestBaseSubCommand < Test::Unit::TestCase
|
12
|
+
|
13
|
+
def test_prefix_set
|
14
|
+
Trepanning::SubSubcommand.set_name_prefix('/tmp/show_subcmd/auto_subcmd/food.rb',
|
15
|
+
self.class)
|
16
|
+
assert_equal('food', NAME, "should have set NAME")
|
17
|
+
assert_equal('show auto food', CMD)
|
18
|
+
assert_equal(%w(show auto food), PREFIX)
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -16,21 +16,26 @@ class TestCompletion < Test::Unit::TestCase
|
|
16
16
|
[
|
17
17
|
['sh', 'sh', ['show']], # Simple single completion
|
18
18
|
['se', 'se', ['server', 'set']], # Simple multiple completion
|
19
|
-
['show', 'show', ['show
|
19
|
+
['show', 'show', ['show']], # Completion when word is complete
|
20
20
|
['irb ', 'irb ', []], # Don't add anything - no more
|
21
|
-
|
21
|
+
['set auto', 'auto', ['auto']], # Single completion on two words
|
22
22
|
['set au', 'au', ['auto']], # Single completion when there are two words
|
23
|
-
['
|
24
|
-
['set auto ', '', ['
|
23
|
+
['sho aut', 'aut', ['auto']], # Add a space because there is more
|
24
|
+
['set auto eval ', '', ['off', 'on']], # Many 3-word completions
|
25
|
+
|
26
|
+
# Many two-word completions
|
27
|
+
['set auto ', '', ['dis', 'eval', 'irb', 'list']],
|
28
|
+
|
25
29
|
['set auto e', 'e', ['eval']],
|
26
|
-
['disas', 'disas
|
30
|
+
['disas', 'disas', ['disassemble']], # Another single completion
|
27
31
|
['help syn', 'syn', ['syntax']],
|
28
32
|
['help br', 'br', ['break', 'breakpoints']],
|
33
|
+
['where', 'where', ['where']], # Single alias completion
|
29
34
|
['set basename o', 'o', ['off', 'on']],
|
30
35
|
].each do |line, token, expect_completion|
|
31
36
|
assert_equal(expect_completion,
|
32
37
|
dbgr.completion_method(token, line),
|
33
|
-
"Bad completion
|
38
|
+
"Bad completion on #{line.inspect} with #{token.inspect}")
|
34
39
|
end
|
35
40
|
assert(dbgr.completion_method('', '').size > 30,
|
36
41
|
'Initial completion should return more than 30 commands')
|
@@ -20,9 +20,9 @@ class TestCmdProcessorLoadCmds < Test::Unit::TestCase
|
|
20
20
|
|
21
21
|
def test_complete
|
22
22
|
assert_equal(%w(delete directory disassemble display down),
|
23
|
-
@proc.complete(
|
23
|
+
@proc.complete('d', 'd'),
|
24
24
|
"Failed completion of 'd' commands")
|
25
|
-
assert_equal(['
|
25
|
+
assert_equal(['debug', 'different'], @proc.complete('sho d', 'd'),
|
26
26
|
"Failed completion of 'sho d' subcommands")
|
27
27
|
$errors = []
|
28
28
|
end
|