rbx-trepanning 0.0.8-universal-rubinius-1.2 → 0.1.0-universal-rubinius-1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +762 -238
- data/NEWS +44 -0
- data/Rakefile +61 -32
- data/app/breakpoint.rb +2 -0
- data/app/brkptmgr.rb +9 -11
- data/app/client.rb +0 -1
- data/app/cmd_parse.kpeg +21 -4
- data/app/cmd_parse.rb +10 -10
- data/app/cmd_parser.rb +1029 -840
- data/app/complete.rb +1 -1
- data/app/display.rb +38 -0
- data/app/file.rb +24 -0
- data/app/frame.rb +11 -4
- data/app/irb.rb +41 -39
- data/app/iseq.rb +71 -0
- data/app/options.rb +55 -30
- data/app/rbx-llvm.rb +0 -2
- data/app/run.rb +13 -9
- data/app/util.rb +55 -5
- data/bin/trepanx +3 -3
- data/data/irbrc +13 -13
- data/{interface/base_intf.rb → interface.rb} +5 -1
- data/interface/client.rb +4 -0
- data/interface/script.rb +13 -5
- data/interface/server.rb +5 -1
- data/interface/user.rb +8 -1
- data/{io/base_io.rb → io.rb} +0 -0
- data/io/input.rb +1 -1
- data/io/null_output.rb +28 -24
- data/io/string_array.rb +2 -3
- data/io/tcpclient.rb +1 -1
- data/io/tcpserver.rb +1 -1
- data/lib/trepanning.rb +11 -13
- data/{processor/main.rb → processor.rb} +50 -54
- data/processor/breakpoint.rb +150 -137
- data/processor/{command/base/cmd.rb → command.rb} +1 -1
- data/processor/command/alias.rb +14 -3
- data/processor/command/backtrace.rb +2 -1
- data/processor/command/base/subcmd.rb +1 -5
- data/processor/command/base/submgr.rb +5 -2
- data/processor/command/base/subsubcmd.rb +1 -1
- data/processor/command/base/subsubmgr.rb +4 -4
- data/processor/command/break.rb +1 -1
- data/processor/command/complete.rb +2 -1
- data/processor/command/condition.rb +2 -2
- data/processor/command/continue.rb +4 -4
- data/processor/command/delete.rb +34 -20
- data/processor/command/directory.rb +4 -4
- data/processor/command/disable.rb +71 -0
- data/processor/command/disassemble.rb +55 -22
- data/processor/command/display.rb +3 -1
- data/processor/command/down.rb +8 -8
- data/processor/command/edit.rb +74 -0
- data/processor/command/enable.rb +43 -0
- data/processor/command/eval.rb +37 -15
- data/processor/command/exit.rb +25 -6
- data/processor/command/finish.rb +5 -5
- data/processor/command/frame.rb +2 -2
- data/processor/command/help.rb +7 -9
- data/processor/command/help/README +10 -0
- data/processor/command/help/command.txt +37 -27
- data/processor/command/help/examples.txt +16 -0
- data/processor/command/help/filename.txt +1 -1
- data/processor/command/help/suffixes.txt +17 -0
- data/processor/command/info.rb +3 -1
- data/processor/command/info_subcmd/files.rb +3 -2
- data/processor/command/info_subcmd/frame.rb +2 -1
- data/processor/command/info_subcmd/line.rb +17 -28
- data/processor/command/info_subcmd/locals.rb +22 -0
- data/processor/command/{show_subcmd → info_subcmd}/macro.rb +4 -4
- data/processor/command/info_subcmd/program.rb +2 -0
- data/processor/command/info_subcmd/ruby.rb +2 -0
- data/processor/command/info_subcmd/source.rb +75 -0
- data/processor/command/info_subcmd/stack.rb +25 -0
- data/processor/command/info_subcmd/variables.rb +23 -36
- data/processor/command/info_subcmd/variables_subcmd/.gitignore +2 -0
- data/processor/command/info_subcmd/variables_subcmd/class.rb +42 -0
- data/processor/command/info_subcmd/variables_subcmd/constant.rb +42 -0
- data/processor/command/info_subcmd/variables_subcmd/globals.rb +69 -0
- data/processor/command/info_subcmd/variables_subcmd/instance.rb +42 -0
- data/processor/command/info_subcmd/variables_subcmd/locals.rb +80 -0
- data/processor/command/kill.rb +8 -9
- data/processor/command/list.rb +101 -167
- data/processor/command/macro.rb +28 -10
- data/processor/command/next.rb +2 -1
- data/processor/command/nexti.rb +1 -1
- data/processor/command/parsetree.rb +51 -0
- data/processor/command/pr.rb +1 -2
- data/processor/command/ps.rb +1 -1
- data/processor/command/restart.rb +2 -2
- data/processor/command/save.rb +1 -1
- data/processor/command/server.rb +1 -1
- data/processor/command/set_subcmd/abbrev.rb +25 -0
- data/processor/command/set_subcmd/auto.rb +7 -1
- data/processor/command/set_subcmd/auto_subcmd/eval.rb +1 -2
- data/processor/command/set_subcmd/auto_subcmd/irb.rb +2 -3
- data/processor/command/set_subcmd/auto_subcmd/list.rb +2 -3
- data/processor/command/set_subcmd/different.rb +1 -1
- data/processor/command/set_subcmd/highlight.rb +7 -1
- data/processor/command/set_subcmd/reload.rb +42 -0
- data/processor/command/set_subcmd/timer.rb +58 -0
- data/processor/command/set_subcmd/trace.rb +4 -3
- data/processor/command/{irb.rb → shell.rb} +22 -19
- data/processor/command/show_subcmd/abbrev.rb +20 -0
- data/processor/command/show_subcmd/{alias.rb → aliases.rb} +2 -2
- data/processor/command/show_subcmd/auto_subcmd/eval.rb +2 -6
- data/processor/command/show_subcmd/directories.rb +22 -0
- data/processor/command/show_subcmd/hidelevel.rb +1 -1
- data/processor/command/show_subcmd/highlight.rb +2 -1
- data/processor/command/show_subcmd/reload.rb +18 -0
- data/processor/command/show_subcmd/timer.rb +18 -0
- data/processor/command/source.rb +9 -9
- data/processor/command/step.rb +1 -1
- data/processor/command/tbreak.rb +3 -2
- data/processor/command/unalias.rb +11 -6
- data/processor/command/undisplay.rb +13 -9
- data/processor/command/up.rb +13 -14
- data/processor/default.rb +47 -44
- data/processor/disassemble.rb +48 -35
- data/processor/display.rb +38 -3
- data/processor/eval.rb +54 -53
- data/processor/eventbuf.rb +69 -69
- data/processor/frame.rb +186 -187
- data/processor/help.rb +6 -4
- data/processor/hook.rb +103 -102
- data/processor/list.rb +123 -0
- data/processor/load_cmds.rb +9 -1
- data/processor/location.rb +193 -188
- data/processor/mock.rb +1 -7
- data/processor/msg.rb +56 -42
- data/processor/running.rb +26 -15
- data/processor/stepping.rb +2 -1
- data/processor/subcmd.rb +18 -43
- data/processor/validate.rb +41 -30
- data/processor/virtual.rb +33 -0
- data/rbx-trepanning.gemspec +7 -8
- data/sample/rocky-trepanx-colors.rb +0 -1
- data/test/data/fname-with-blank.right +2 -0
- data/test/data/inline-call.right +11 -10
- data/test/data/quit.right +1 -0
- data/test/example/debugger-stop.rb +1 -1
- data/test/example/goto2goto.rb +11 -0
- data/test/functional/fn_helper.rb +2 -2
- data/test/functional/test-list.rb +7 -6
- data/test/integration/helper.rb +5 -5
- data/test/unit/cmd-helper.rb +2 -6
- data/test/unit/test-app-cmd_parser.rb +3 -2
- data/test/unit/test-app-display.rb +22 -0
- data/test/unit/test-app-options.rb +14 -10
- data/test/unit/test-app-run.rb +0 -2
- data/test/unit/test-app-util.rb +21 -4
- data/test/unit/test-base-cmd.rb +5 -7
- data/test/unit/test-base-subcmd.rb +1 -5
- data/test/unit/test-base-submgr.rb +1 -1
- data/test/unit/test-base-subsubcmd.rb +0 -4
- data/test/unit/test-bin-trepanx.rb +2 -2
- data/test/unit/test-cmd-break.rb +2 -0
- data/test/unit/test-cmd-edit.rb +34 -0
- data/test/unit/test-cmd-kill.rb +11 -4
- data/test/unit/test-cmd-parse_list_cmd.rb +36 -0
- data/test/unit/test-command.rb +45 -0
- data/test/unit/test-completion.rb +1 -1
- data/test/unit/test-proc-eval.rb +1 -2
- data/test/unit/test-proc-frame.rb +5 -3
- data/test/unit/test-proc-list.rb +55 -0
- data/test/unit/test-proc-load_cmds.rb +4 -3
- data/test/unit/test-proc-location.rb +32 -29
- data/test/unit/test-proc-main.rb +1 -5
- data/test/unit/test-proc-validate.rb +14 -4
- data/test/unit/test-subcmd-help.rb +1 -5
- metadata +73 -107
data/test/unit/test-cmd-kill.rb
CHANGED
@@ -24,10 +24,17 @@ class TestCommandKill < Test::Unit::TestCase
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_kill_command
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
assert_equal(['unconditionally'], @cmd.complete('uncon'))
|
28
|
+
|
29
|
+
if Signal.list.member?('HUP')
|
30
|
+
assert_equal(['hup'], @cmd.complete('hu'))
|
31
|
+
assert_equal(['HUP'], @cmd.complete('HU'))
|
32
|
+
end
|
33
|
+
|
34
|
+
@cmd.run([@name, 'foo'])
|
35
|
+
assert_equal(false, @cmd.proc.leave_cmd_loop)
|
36
|
+
assert_equal(1, @cmd.instance_variable_get('@errmsgs').size)
|
37
|
+
|
31
38
|
if false
|
32
39
|
save_trap = Signal.trap(10) {
|
33
40
|
@success = true
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'; require 'require_relative'
|
3
|
+
require_relative 'cmd-helper'
|
4
|
+
require_relative '../../processor/command/list'
|
5
|
+
|
6
|
+
class TestCommandParseListCmd < Test::Unit::TestCase
|
7
|
+
include UnitHelper
|
8
|
+
def setup
|
9
|
+
common_setup
|
10
|
+
@cmd = @cmds['list']
|
11
|
+
end
|
12
|
+
def test_parse_list_cmd
|
13
|
+
@dbg.instance_variable_set('@current_frame',
|
14
|
+
Trepan::Frame.new(self, 0,
|
15
|
+
Rubinius::VM.backtrace(0, true)[0]))
|
16
|
+
@cmdproc.frame_setup
|
17
|
+
short_file = File.basename(__FILE__)
|
18
|
+
listsize = 10
|
19
|
+
line = __LINE__ - 14
|
20
|
+
load 'tmpdir.rb'
|
21
|
+
[['', [short_file, line, line+listsize-1]],
|
22
|
+
["#{__FILE__}:10", [short_file, 5, 14]],
|
23
|
+
["#{__FILE__} 10", [short_file, 5, 14]],
|
24
|
+
['tmpdir.rb', ['tmpdir.rb', 1, listsize]],
|
25
|
+
['tmpdir.rb 10', ['tmpdir.rb', 5, 5+listsize-1]],
|
26
|
+
['Columnize.columnize 15', ['columnize.rb', 10, 10+listsize -1]],
|
27
|
+
['Columnize.columnize 30 3', ['columnize.rb', 30, 32]],
|
28
|
+
['Columnize.columnize 40 50', ['columnize.rb', 40, 50]],
|
29
|
+
].each do |arg_str, expect|
|
30
|
+
got = @cmdproc.parse_list_cmd(arg_str, listsize, listsize/2)[1..-1]
|
31
|
+
got[0] = File.basename(got[0])
|
32
|
+
assert_equal expect, got, arg_str
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
require 'rubygems'; require 'require_relative'
|
4
|
+
require_relative '../../processor/command'
|
5
|
+
|
6
|
+
class Trepan::Command::Test < Trepan::Command
|
7
|
+
NAME = 'test'
|
8
|
+
CATEGORY = 'testcategory'
|
9
|
+
completion %w(a aa ab ba aac)
|
10
|
+
end
|
11
|
+
|
12
|
+
class TestBaseCommand < Test::Unit::TestCase
|
13
|
+
|
14
|
+
class MockCmdProcessor
|
15
|
+
# The below functions aren't tested/called, but they are the
|
16
|
+
# methods required by a command and are placeholders for when we
|
17
|
+
# do start testing.
|
18
|
+
def initialize(dbgr)
|
19
|
+
end
|
20
|
+
def confirm(message, default)
|
21
|
+
p ['confirm: ', message, default]
|
22
|
+
end
|
23
|
+
def errmsg(message, opts)
|
24
|
+
p ['err:', message, opts]
|
25
|
+
end
|
26
|
+
def msg(message, opts)
|
27
|
+
p [message, opts]
|
28
|
+
end
|
29
|
+
def msg_nocr(message, opts)
|
30
|
+
p ['nocr: ', message, opts]
|
31
|
+
end
|
32
|
+
def section(message, opts)
|
33
|
+
p ['section: ', message, opts]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def setup
|
38
|
+
@proc = MockCmdProcessor.new(nil)
|
39
|
+
@cmd = Trepan::Command::Test.new(@proc)
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_base_completion
|
43
|
+
assert_equal(%w(aa aac), @cmd.complete('aa'))
|
44
|
+
end
|
45
|
+
end
|
@@ -14,7 +14,7 @@ class TestCompletion < Test::Unit::TestCase
|
|
14
14
|
def test_completion
|
15
15
|
dbgr = Trepan.new
|
16
16
|
[
|
17
|
-
['
|
17
|
+
['sho', 'sho', ['show']], # Simple single completion
|
18
18
|
['se', 'se', ['server', 'set']], # Simple multiple completion
|
19
19
|
['show', 'show', ['show']], # Completion when word is complete
|
20
20
|
['irb ', 'irb ', []], # Don't add anything - no more
|
data/test/unit/test-proc-eval.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'rubygems'; require 'require_relative'
|
3
3
|
require_relative 'cmd-helper'
|
4
|
-
require_relative '../../processor
|
5
|
-
# FIXME
|
4
|
+
require_relative '../../processor'
|
6
5
|
require_relative '../../app/frame'
|
7
6
|
require_relative '../../processor/eval'
|
8
7
|
require_relative '../../processor/mock'
|
@@ -1,8 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'test/unit'
|
3
3
|
require 'rubygems'; require 'require_relative'
|
4
|
-
require_relative '../../processor
|
5
|
-
# FIXME
|
4
|
+
require_relative '../../processor'
|
6
5
|
require_relative '../../processor/frame'
|
7
6
|
require_relative '../../processor/mock'
|
8
7
|
|
@@ -20,6 +19,9 @@ class TestCmdProcessorFrame < Test::Unit::TestCase
|
|
20
19
|
@proc.frame_index = 0
|
21
20
|
@proc.frame_initialize
|
22
21
|
class << @proc
|
22
|
+
def msg(msg)
|
23
|
+
$msgs << msg
|
24
|
+
end
|
23
25
|
def errmsg(msg)
|
24
26
|
$errors << msg
|
25
27
|
end
|
@@ -39,7 +41,7 @@ class TestCmdProcessorFrame < Test::Unit::TestCase
|
|
39
41
|
0.upto(@proc.stack_size-1) do |i|
|
40
42
|
@proc.adjust_frame(i, true)
|
41
43
|
assert_equal(0, $errors.size)
|
42
|
-
assert_equal(
|
44
|
+
assert_equal(true, $msgs.size >= i+1)
|
43
45
|
end
|
44
46
|
|
45
47
|
# Test absolute before the beginning fo the stack
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
require 'rubygems'; require 'require_relative'
|
4
|
+
require_relative '../../processor'
|
5
|
+
require_relative '../../processor/frame'
|
6
|
+
require_relative '../../processor/list'
|
7
|
+
require_relative '../../processor/mock'
|
8
|
+
|
9
|
+
# Test Trepan::CmdProcessor List portion
|
10
|
+
class TestProcList < Test::Unit::TestCase
|
11
|
+
|
12
|
+
def setup
|
13
|
+
$errors = []
|
14
|
+
$msgs = []
|
15
|
+
@dbgr = MockDebugger::MockDebugger.new
|
16
|
+
@proc = Trepan::CmdProcessor.new(@dbgr)
|
17
|
+
@proc.frame_index = 0
|
18
|
+
@proc.frame_initialize
|
19
|
+
class << @proc
|
20
|
+
def msg(msg)
|
21
|
+
$msgs << msg
|
22
|
+
end
|
23
|
+
def errmsg(msg)
|
24
|
+
$errors << msg
|
25
|
+
end
|
26
|
+
def print_location
|
27
|
+
# $msgs << "#{@frame.source_container} #{@frame.source_location[0]}"
|
28
|
+
$msgs << "#{@frame.source_container} "
|
29
|
+
# puts $msgs
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_basic
|
35
|
+
@proc.frame_setup
|
36
|
+
|
37
|
+
def foo; 5 end
|
38
|
+
def check(cmdp, arg, last=10)
|
39
|
+
r = cmdp.parse_list_cmd('.', last)
|
40
|
+
assert r[1]
|
41
|
+
assert r[2]
|
42
|
+
assert r[3]
|
43
|
+
end
|
44
|
+
check(@proc, '-')
|
45
|
+
check(@proc, 'foo')
|
46
|
+
check(@proc, '@0')
|
47
|
+
check(@proc, "#{__LINE__}")
|
48
|
+
check(@proc, "#{__FILE__} @0")
|
49
|
+
check(@proc, "#{__FILE__}:#{__LINE__}")
|
50
|
+
check(@proc, "#{__FILE__} #{__LINE__}")
|
51
|
+
check(@proc, "#{__FILE__} #{__LINE__}", -10)
|
52
|
+
check(@proc, "@proc.errmsg")
|
53
|
+
check(@proc, "@proc.errmsg:@0")
|
54
|
+
end
|
55
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'test/unit'
|
3
3
|
require 'rubygems'; require 'require_relative'
|
4
|
-
require_relative '../../processor
|
4
|
+
require_relative '../../processor'
|
5
5
|
require_relative '../../app/mock'
|
6
6
|
|
7
7
|
class TestCmdProcessorLoadCmds < Test::Unit::TestCase
|
@@ -19,10 +19,11 @@ class TestCmdProcessorLoadCmds < Test::Unit::TestCase
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_complete
|
22
|
-
assert_equal(%w(delete directory disassemble display down),
|
22
|
+
assert_equal(%w(delete directory disable disassemble display down),
|
23
23
|
@proc.complete('d', 'd'),
|
24
24
|
"Failed completion of 'd' commands")
|
25
|
-
assert_equal(['debug', 'different'
|
25
|
+
assert_equal(['debug', 'different', 'directories'],
|
26
|
+
@proc.complete('sho d', 'd'),
|
26
27
|
"Failed completion of 'sho d' subcommands")
|
27
28
|
$errors = []
|
28
29
|
end
|
@@ -2,62 +2,65 @@
|
|
2
2
|
require 'test/unit'
|
3
3
|
require 'rubygems'; require 'require_relative'
|
4
4
|
require 'linecache'
|
5
|
-
require_relative '../../processor/main' # Have to include before frame!
|
6
|
-
# FIXME
|
7
5
|
require_relative '../../processor/location'
|
8
|
-
require_relative '
|
9
|
-
|
10
|
-
$errors = []
|
11
|
-
$msgs = []
|
6
|
+
require_relative 'cmd-helper'
|
12
7
|
|
13
8
|
# Test Trepan::CmdProcessor location portion
|
14
9
|
class TestCmdProcessorLocation < Test::Unit::TestCase
|
15
10
|
|
11
|
+
include UnitHelper
|
16
12
|
def setup
|
17
|
-
|
18
|
-
|
19
|
-
@dbgr = MockDebugger::MockDebugger.new
|
20
|
-
@proc = Trepan::CmdProcessor.new(@dbgr)
|
21
|
-
@file = File.basename(__FILE__)
|
13
|
+
common_setup
|
14
|
+
@file ||= File.basename(__FILE__)
|
22
15
|
end
|
23
16
|
|
24
17
|
# Test resolve_file_with_dir() and line_at()
|
25
18
|
def test_line_at
|
26
|
-
@
|
27
|
-
assert_equal(nil, @
|
19
|
+
@cmdproc.settings[:directory] = ''
|
20
|
+
assert_equal(nil, @cmdproc.resolve_file_with_dir(@file))
|
28
21
|
if File.expand_path(Dir.pwd) == File.expand_path(File.dirname(__FILE__))
|
29
|
-
line = @
|
30
|
-
assert_match(/line = @
|
22
|
+
line = @cmdproc.line_at(@file, __LINE__)
|
23
|
+
assert_match(/line = @cmdproc.line_at/, line)
|
31
24
|
else
|
32
|
-
assert_equal(nil, @
|
25
|
+
assert_equal(nil, @cmdproc.line_at(@file, __LINE__))
|
33
26
|
end
|
34
|
-
dir = @
|
27
|
+
dir = @cmdproc.settings[:directory] = File.dirname(__FILE__)
|
35
28
|
assert_equal(File.join(dir, @file),
|
36
|
-
@
|
29
|
+
@cmdproc.resolve_file_with_dir('test-proc-location.rb'))
|
37
30
|
test_line = 'test_line'
|
38
|
-
line = @
|
31
|
+
line = @cmdproc.line_at(@file, __LINE__-1)
|
39
32
|
assert_match(/#{line}/, line)
|
40
33
|
end
|
41
34
|
|
42
35
|
def test_loc_and_text
|
43
|
-
@
|
44
|
-
@
|
45
|
-
@
|
36
|
+
@cmdproc.frame_index = 0
|
37
|
+
@cmdproc.frame_initialize
|
38
|
+
@cmdproc.frame_setup
|
46
39
|
LineCache::clear_file_cache
|
47
|
-
dir = @
|
48
|
-
loc, line_no, text = @
|
40
|
+
dir = @cmdproc.settings[:directory] = File.dirname(__FILE__)
|
41
|
+
loc, line_no, text = @cmdproc.loc_and_text('hi')
|
49
42
|
assert loc and line_no.is_a?(Fixnum) and text
|
50
|
-
assert @
|
43
|
+
assert @cmdproc.current_source_text
|
51
44
|
# FIXME test that filename remapping works.
|
52
45
|
end
|
53
46
|
|
47
|
+
def test_canonic_file
|
48
|
+
@cmdproc.settings[:basename] = false
|
49
|
+
assert_equal __FILE__, @cmdproc.canonic_file(__FILE__)
|
50
|
+
assert @cmdproc.canonic_file('lib/compiler/ast.rb')
|
51
|
+
@cmdproc.settings[:basename] = true
|
52
|
+
assert_equal File.basename(__FILE__), @cmdproc.canonic_file(__FILE__)
|
53
|
+
assert_equal 'ast.rb', @cmdproc.canonic_file('lib/compiler/ast.rb')
|
54
|
+
end
|
55
|
+
|
56
|
+
|
54
57
|
def test_eval_current_source_text
|
55
58
|
eval <<-EOE
|
56
|
-
@
|
57
|
-
@
|
58
|
-
@
|
59
|
+
@cmdproc.frame_index = 0
|
60
|
+
@cmdproc.frame_initialize
|
61
|
+
@cmdproc.frame_setup
|
59
62
|
LineCache::clear_file_cache
|
60
|
-
assert @
|
63
|
+
assert @cmdproc.current_source_text
|
61
64
|
EOE
|
62
65
|
end
|
63
66
|
|
data/test/unit/test-proc-main.rb
CHANGED
@@ -1,13 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'rubygems'; require 'require_relative'
|
3
3
|
require_relative 'cmd-helper'
|
4
|
-
require_relative '../../processor
|
4
|
+
require_relative '../../processor'
|
5
5
|
## require_relative '../../app/core'
|
6
6
|
|
7
|
-
# Mock debugger stub. FIXME: put in comment helper routine.
|
8
|
-
class Trepan
|
9
|
-
end
|
10
|
-
|
11
7
|
# Test Trepan:CmdProcessor
|
12
8
|
class TestCmdProcessor < Test::Unit::TestCase
|
13
9
|
|
@@ -1,8 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'test/unit'
|
3
3
|
require 'rubygems'; require 'require_relative'
|
4
|
-
require_relative '../../processor
|
5
|
-
# FIXME
|
4
|
+
require_relative '../../processor'
|
6
5
|
require_relative '../../processor/validate'
|
7
6
|
require_relative '../../app/mock'
|
8
7
|
require_relative 'cmd-helper'
|
@@ -60,10 +59,10 @@ class TestValidate < Test::Unit::TestCase
|
|
60
59
|
@cmdproc.frame_setup
|
61
60
|
file = File.basename(__FILE__)
|
62
61
|
[
|
63
|
-
[__FILE__, [
|
62
|
+
[__FILE__, [true, file, nil, nil]],
|
64
63
|
['@8', [true, file, 8, :offset]],
|
65
64
|
[@line.to_s , [true, file, @line, :line]],
|
66
|
-
['
|
65
|
+
['2' , [true, file, 2, :line]],
|
67
66
|
["#{__FILE__}:#{__LINE__}" , [true, file, __LINE__, :line]],
|
68
67
|
["#{__FILE__} #{__LINE__}" , [true, file, __LINE__, :line]]
|
69
68
|
].each do |pos_str, expected|
|
@@ -74,6 +73,17 @@ class TestValidate < Test::Unit::TestCase
|
|
74
73
|
end
|
75
74
|
end
|
76
75
|
|
76
|
+
def test_file_exists_proc
|
77
|
+
load 'tmpdir.rb'
|
78
|
+
# %W(#{__FILE__} tmpdir.rb mock.rb).each do |name|
|
79
|
+
%W(#{__FILE__}).each do |name|
|
80
|
+
assert_equal true, @cmdproc.file_exists_proc.call(name), "Should find #{name}"
|
81
|
+
end
|
82
|
+
%W(#{File.dirname(__FILE__)} tmpdir).each do |name|
|
83
|
+
assert_equal false, !!@cmdproc.file_exists_proc.call(name), "Should not find #{name}"
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
77
87
|
def test_breakpoint_position
|
78
88
|
start_line = __LINE__
|
79
89
|
common_setup
|
@@ -1,11 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'test/unit'
|
3
3
|
require 'rubygems'; require 'require_relative'
|
4
|
-
require_relative '../../processor
|
5
|
-
|
6
|
-
# Mock debugger stub. FIXME: put in comment helper routine.
|
7
|
-
class Trepan
|
8
|
-
end
|
4
|
+
require_relative '../../processor'
|
9
5
|
|
10
6
|
# Test Trepan::CmdProcessor
|
11
7
|
class TestSubCmdHelp < Test::Unit::TestCase
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbx-trepanning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.0.8
|
10
|
+
version: 0.1.0
|
11
11
|
platform: universal-rubinius-1.2
|
12
12
|
authors:
|
13
13
|
- R. Bernstein
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-10-27 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
segments:
|
45
45
|
- 0
|
46
46
|
version: "0"
|
47
|
-
type: :
|
47
|
+
type: :development
|
48
48
|
version_requirements: *id002
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: rbx-require-relative
|
@@ -54,10 +54,12 @@ dependencies:
|
|
54
54
|
requirements:
|
55
55
|
- - ">="
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
hash:
|
57
|
+
hash: 23
|
58
58
|
segments:
|
59
59
|
- 0
|
60
|
-
|
60
|
+
- 0
|
61
|
+
- 4
|
62
|
+
version: 0.0.4
|
61
63
|
type: :runtime
|
62
64
|
version_requirements: *id003
|
63
65
|
- !ruby/object:Gem::Dependency
|
@@ -68,13 +70,28 @@ dependencies:
|
|
68
70
|
requirements:
|
69
71
|
- - ~>
|
70
72
|
- !ruby/object:Gem::Version
|
71
|
-
hash:
|
73
|
+
hash: 9
|
72
74
|
segments:
|
73
75
|
- 1
|
74
|
-
-
|
75
|
-
version: "1.
|
76
|
+
- 3
|
77
|
+
version: "1.3"
|
76
78
|
type: :runtime
|
77
79
|
version_requirements: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: coderay
|
82
|
+
prerelease: false
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
hash: 15
|
89
|
+
segments:
|
90
|
+
- 1
|
91
|
+
- 0
|
92
|
+
version: "1.0"
|
93
|
+
type: :runtime
|
94
|
+
version_requirements: *id005
|
78
95
|
description: |
|
79
96
|
A modular, testable, Ruby debugger using some of good ideas from
|
80
97
|
ruby-debug, other debuggers, and Ruby Rails.
|
@@ -112,6 +129,7 @@ files:
|
|
112
129
|
- app/default.rb
|
113
130
|
- app/display.rb
|
114
131
|
- app/eventbuffer.rb
|
132
|
+
- app/file.rb
|
115
133
|
- app/frame.rb
|
116
134
|
- app/irb.rb
|
117
135
|
- app/iseq.rb
|
@@ -126,15 +144,15 @@ files:
|
|
126
144
|
- bin/trepanx
|
127
145
|
- data/.gitignore
|
128
146
|
- data/irbrc
|
147
|
+
- interface.rb
|
129
148
|
- interface/.gitignore
|
130
|
-
- interface/base_intf.rb
|
131
149
|
- interface/client.rb
|
132
150
|
- interface/comcodes.rb
|
133
151
|
- interface/script.rb
|
134
152
|
- interface/server.rb
|
135
153
|
- interface/user.rb
|
154
|
+
- io.rb
|
136
155
|
- io/.gitignore
|
137
|
-
- io/base_io.rb
|
138
156
|
- io/input.rb
|
139
157
|
- io/null_output.rb
|
140
158
|
- io/string_array.rb
|
@@ -143,14 +161,15 @@ files:
|
|
143
161
|
- io/tcpserver.rb
|
144
162
|
- lib/.gitignore
|
145
163
|
- lib/trepanning.rb
|
164
|
+
- processor.rb
|
146
165
|
- processor/.gitignore
|
147
166
|
- processor/Makefile
|
148
167
|
- processor/breakpoint.rb
|
168
|
+
- processor/command.rb
|
149
169
|
- processor/command/.gitignore
|
150
170
|
- processor/command/alias.rb
|
151
171
|
- processor/command/backtrace.rb
|
152
172
|
- processor/command/base/.gitignore
|
153
|
-
- processor/command/base/cmd.rb
|
154
173
|
- processor/command/base/subcmd.rb
|
155
174
|
- processor/command/base/submgr.rb
|
156
175
|
- processor/command/base/subsubcmd.rb
|
@@ -161,34 +180,50 @@ files:
|
|
161
180
|
- processor/command/continue.rb
|
162
181
|
- processor/command/delete.rb
|
163
182
|
- processor/command/directory.rb
|
183
|
+
- processor/command/disable.rb
|
164
184
|
- processor/command/disassemble.rb
|
165
185
|
- processor/command/display.rb
|
166
186
|
- processor/command/down.rb
|
187
|
+
- processor/command/edit.rb
|
188
|
+
- processor/command/enable.rb
|
167
189
|
- processor/command/eval.rb
|
168
190
|
- processor/command/exit.rb
|
169
191
|
- processor/command/finish.rb
|
170
192
|
- processor/command/frame.rb
|
171
193
|
- processor/command/help.rb
|
172
194
|
- processor/command/help/.gitignore
|
195
|
+
- processor/command/help/README
|
173
196
|
- processor/command/help/command.txt
|
197
|
+
- processor/command/help/examples.txt
|
174
198
|
- processor/command/help/filename.txt
|
175
199
|
- processor/command/help/location.txt
|
200
|
+
- processor/command/help/suffixes.txt
|
176
201
|
- processor/command/info.rb
|
177
202
|
- processor/command/info_subcmd/.gitignore
|
178
203
|
- processor/command/info_subcmd/breakpoints.rb
|
179
204
|
- processor/command/info_subcmd/files.rb
|
180
205
|
- processor/command/info_subcmd/frame.rb
|
181
206
|
- processor/command/info_subcmd/line.rb
|
207
|
+
- processor/command/info_subcmd/locals.rb
|
208
|
+
- processor/command/info_subcmd/macro.rb
|
182
209
|
- processor/command/info_subcmd/method.rb
|
183
210
|
- processor/command/info_subcmd/program.rb
|
184
211
|
- processor/command/info_subcmd/ruby.rb
|
212
|
+
- processor/command/info_subcmd/source.rb
|
213
|
+
- processor/command/info_subcmd/stack.rb
|
185
214
|
- processor/command/info_subcmd/variables.rb
|
186
|
-
- processor/command/
|
215
|
+
- processor/command/info_subcmd/variables_subcmd/.gitignore
|
216
|
+
- processor/command/info_subcmd/variables_subcmd/class.rb
|
217
|
+
- processor/command/info_subcmd/variables_subcmd/constant.rb
|
218
|
+
- processor/command/info_subcmd/variables_subcmd/globals.rb
|
219
|
+
- processor/command/info_subcmd/variables_subcmd/instance.rb
|
220
|
+
- processor/command/info_subcmd/variables_subcmd/locals.rb
|
187
221
|
- processor/command/kill.rb
|
188
222
|
- processor/command/list.rb
|
189
223
|
- processor/command/macro.rb
|
190
224
|
- processor/command/next.rb
|
191
225
|
- processor/command/nexti.rb
|
226
|
+
- processor/command/parsetree.rb
|
192
227
|
- processor/command/pr.rb
|
193
228
|
- processor/command/ps.rb
|
194
229
|
- processor/command/restart.rb
|
@@ -196,6 +231,7 @@ files:
|
|
196
231
|
- processor/command/server.rb
|
197
232
|
- processor/command/set.rb
|
198
233
|
- processor/command/set_subcmd/.gitignore
|
234
|
+
- processor/command/set_subcmd/abbrev.rb
|
199
235
|
- processor/command/set_subcmd/auto.rb
|
200
236
|
- processor/command/set_subcmd/auto_subcmd/.gitignore
|
201
237
|
- processor/command/set_subcmd/auto_subcmd/dis.rb
|
@@ -219,16 +255,20 @@ files:
|
|
219
255
|
- processor/command/set_subcmd/max_subcmd/stack.rb
|
220
256
|
- processor/command/set_subcmd/max_subcmd/string.rb
|
221
257
|
- processor/command/set_subcmd/max_subcmd/width.rb
|
258
|
+
- processor/command/set_subcmd/reload.rb
|
222
259
|
- processor/command/set_subcmd/substitute.rb
|
223
260
|
- processor/command/set_subcmd/substitute_subcmd/.gitignore
|
224
261
|
- processor/command/set_subcmd/substitute_subcmd/path.rb
|
262
|
+
- processor/command/set_subcmd/timer.rb
|
225
263
|
- processor/command/set_subcmd/trace.rb
|
226
264
|
- processor/command/set_subcmd/trace_subcmd/.gitignore
|
227
265
|
- processor/command/set_subcmd/trace_subcmd/buffer.rb
|
228
266
|
- processor/command/set_subcmd/trace_subcmd/print.rb
|
267
|
+
- processor/command/shell.rb
|
229
268
|
- processor/command/show.rb
|
230
269
|
- processor/command/show_subcmd/.gitignore
|
231
|
-
- processor/command/show_subcmd/
|
270
|
+
- processor/command/show_subcmd/abbrev.rb
|
271
|
+
- processor/command/show_subcmd/aliases.rb
|
232
272
|
- processor/command/show_subcmd/args.rb
|
233
273
|
- processor/command/show_subcmd/auto.rb
|
234
274
|
- processor/command/show_subcmd/auto_subcmd/.gitignore
|
@@ -244,16 +284,18 @@ files:
|
|
244
284
|
- processor/command/show_subcmd/debug_subcmd/skip.rb
|
245
285
|
- processor/command/show_subcmd/debug_subcmd/step.rb
|
246
286
|
- processor/command/show_subcmd/different.rb
|
287
|
+
- processor/command/show_subcmd/directories.rb
|
247
288
|
- processor/command/show_subcmd/hidelevel.rb
|
248
289
|
- processor/command/show_subcmd/highlight.rb
|
249
290
|
- processor/command/show_subcmd/kernelstep.rb
|
250
|
-
- processor/command/show_subcmd/macro.rb
|
251
291
|
- processor/command/show_subcmd/max.rb
|
252
292
|
- processor/command/show_subcmd/max_subcmd/.gitignore
|
253
293
|
- processor/command/show_subcmd/max_subcmd/list.rb
|
254
294
|
- processor/command/show_subcmd/max_subcmd/stack.rb
|
255
295
|
- processor/command/show_subcmd/max_subcmd/string.rb
|
256
296
|
- processor/command/show_subcmd/max_subcmd/width.rb
|
297
|
+
- processor/command/show_subcmd/reload.rb
|
298
|
+
- processor/command/show_subcmd/timer.rb
|
257
299
|
- processor/command/show_subcmd/trace.rb
|
258
300
|
- processor/command/show_subcmd/trace_subcmd/.gitignore
|
259
301
|
- processor/command/show_subcmd/trace_subcmd/buffer.rb
|
@@ -273,15 +315,16 @@ files:
|
|
273
315
|
- processor/frame.rb
|
274
316
|
- processor/help.rb
|
275
317
|
- processor/hook.rb
|
318
|
+
- processor/list.rb
|
276
319
|
- processor/load_cmds.rb
|
277
320
|
- processor/location.rb
|
278
|
-
- processor/main.rb
|
279
321
|
- processor/mock.rb
|
280
322
|
- processor/msg.rb
|
281
323
|
- processor/running.rb
|
282
324
|
- processor/stepping.rb
|
283
325
|
- processor/subcmd.rb
|
284
326
|
- processor/validate.rb
|
327
|
+
- processor/virtual.rb
|
285
328
|
- rbx-trepanning.gemspec
|
286
329
|
- sample/.gitignore
|
287
330
|
- sample/list-terminal-colors.rb
|
@@ -303,6 +346,7 @@ files:
|
|
303
346
|
- test/example/fname with blank.rb
|
304
347
|
- test/example/gcd-server.rb
|
305
348
|
- test/example/gcd.rb
|
349
|
+
- test/example/goto2goto.rb
|
306
350
|
- test/example/inline-call.rb
|
307
351
|
- test/example/null.rb
|
308
352
|
- test/example/thread1.rb
|
@@ -334,6 +378,7 @@ files:
|
|
334
378
|
- test/unit/test-app-cmd_parser.rb
|
335
379
|
- test/unit/test-app-complete.rb
|
336
380
|
- test/unit/test-app-condition.rb
|
381
|
+
- test/unit/test-app-display.rb
|
337
382
|
- test/unit/test-app-iseq.rb
|
338
383
|
- test/unit/test-app-method.rb
|
339
384
|
- test/unit/test-app-options.rb
|
@@ -347,12 +392,15 @@ files:
|
|
347
392
|
- test/unit/test-bin-trepanx.rb
|
348
393
|
- test/unit/test-cmd-alias.rb
|
349
394
|
- test/unit/test-cmd-break.rb
|
395
|
+
- test/unit/test-cmd-edit.rb
|
350
396
|
- test/unit/test-cmd-exit.rb
|
351
397
|
- test/unit/test-cmd-finish.rb
|
352
398
|
- test/unit/test-cmd-help.rb
|
353
399
|
- test/unit/test-cmd-kill.rb
|
400
|
+
- test/unit/test-cmd-parse_list_cmd.rb
|
354
401
|
- test/unit/test-cmd-source.rb
|
355
402
|
- test/unit/test-cmd-step.rb
|
403
|
+
- test/unit/test-command.rb
|
356
404
|
- test/unit/test-completion.rb
|
357
405
|
- test/unit/test-intf-user.rb
|
358
406
|
- test/unit/test-io-input.rb
|
@@ -364,6 +412,7 @@ files:
|
|
364
412
|
- test/unit/test-proc-frame.rb
|
365
413
|
- test/unit/test-proc-help.rb
|
366
414
|
- test/unit/test-proc-hook.rb
|
415
|
+
- test/unit/test-proc-list.rb
|
367
416
|
- test/unit/test-proc-load_cmds.rb
|
368
417
|
- test/unit/test-proc-location.rb
|
369
418
|
- test/unit/test-proc-main.rb
|
@@ -381,14 +430,12 @@ require_paths:
|
|
381
430
|
required_ruby_version: !ruby/object:Gem::Requirement
|
382
431
|
none: false
|
383
432
|
requirements:
|
384
|
-
- -
|
433
|
+
- - ">="
|
385
434
|
- !ruby/object:Gem::Version
|
386
|
-
hash:
|
435
|
+
hash: 3
|
387
436
|
segments:
|
388
|
-
-
|
389
|
-
|
390
|
-
- 7
|
391
|
-
version: 1.8.7
|
437
|
+
- 0
|
438
|
+
version: "0"
|
392
439
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
393
440
|
none: false
|
394
441
|
requirements:
|
@@ -404,87 +451,6 @@ rubyforge_project:
|
|
404
451
|
rubygems_version: 1.5.2
|
405
452
|
signing_key:
|
406
453
|
specification_version: 3
|
407
|
-
summary: Trepan Ruby Debugger for Rubinius 1.2.
|
408
|
-
test_files:
|
409
|
-
|
410
|
-
- test/data/enable.right
|
411
|
-
- test/data/fname-with-blank.cmd
|
412
|
-
- test/data/fname-with-blank.right
|
413
|
-
- test/data/inline-call.cmd
|
414
|
-
- test/data/inline-call.right
|
415
|
-
- test/data/quit-Xdebug.right
|
416
|
-
- test/data/quit.cmd
|
417
|
-
- test/data/quit.right
|
418
|
-
- test/data/quit2.cmd
|
419
|
-
- test/data/quit2.right
|
420
|
-
- test/example/.gitignore
|
421
|
-
- test/example/debugger-stop.rb
|
422
|
-
- test/example/fname with blank.rb
|
423
|
-
- test/example/gcd-server.rb
|
424
|
-
- test/example/gcd.rb
|
425
|
-
- test/example/inline-call.rb
|
426
|
-
- test/example/null.rb
|
427
|
-
- test/example/thread1.rb
|
428
|
-
- test/functional/.gitignore
|
429
|
-
- test/functional/fn_helper.rb
|
430
|
-
- test/functional/test-break-name.rb
|
431
|
-
- test/functional/test-break.rb
|
432
|
-
- test/functional/test-eval.rb
|
433
|
-
- test/functional/test-finish.rb
|
434
|
-
- test/functional/test-fn_helper.rb
|
435
|
-
- test/functional/test-list.rb
|
436
|
-
- test/functional/test-next-bug.rb
|
437
|
-
- test/functional/test-next.rb
|
438
|
-
- test/functional/test-step.rb
|
439
|
-
- test/functional/test-step2.rb
|
440
|
-
- test/functional/test-tbreak.rb
|
441
|
-
- test/integration/.gitignore
|
442
|
-
- test/integration/file-diff.rb
|
443
|
-
- test/integration/helper.rb
|
444
|
-
- test/integration/test-fname-with-blank.rb
|
445
|
-
- test/integration/test-inline-call.rb
|
446
|
-
- test/integration/test-quit.rb
|
447
|
-
- test/unit/.gitignore
|
448
|
-
- test/unit/cmd-helper.rb
|
449
|
-
- test/unit/mock-helper.rb
|
450
|
-
- test/unit/test-app-brkpt.rb
|
451
|
-
- test/unit/test-app-brkptmgr.rb
|
452
|
-
- test/unit/test-app-cmd_parse.rb
|
453
|
-
- test/unit/test-app-cmd_parser.rb
|
454
|
-
- test/unit/test-app-complete.rb
|
455
|
-
- test/unit/test-app-condition.rb
|
456
|
-
- test/unit/test-app-iseq.rb
|
457
|
-
- test/unit/test-app-method.rb
|
458
|
-
- test/unit/test-app-options.rb
|
459
|
-
- test/unit/test-app-run.rb
|
460
|
-
- test/unit/test-app-util.rb
|
461
|
-
- test/unit/test-app-validate.rb
|
462
|
-
- test/unit/test-base-cmd.rb
|
463
|
-
- test/unit/test-base-subcmd.rb
|
464
|
-
- test/unit/test-base-submgr.rb
|
465
|
-
- test/unit/test-base-subsubcmd.rb
|
466
|
-
- test/unit/test-bin-trepanx.rb
|
467
|
-
- test/unit/test-cmd-alias.rb
|
468
|
-
- test/unit/test-cmd-break.rb
|
469
|
-
- test/unit/test-cmd-exit.rb
|
470
|
-
- test/unit/test-cmd-finish.rb
|
471
|
-
- test/unit/test-cmd-help.rb
|
472
|
-
- test/unit/test-cmd-kill.rb
|
473
|
-
- test/unit/test-cmd-source.rb
|
474
|
-
- test/unit/test-cmd-step.rb
|
475
|
-
- test/unit/test-completion.rb
|
476
|
-
- test/unit/test-intf-user.rb
|
477
|
-
- test/unit/test-io-input.rb
|
478
|
-
- test/unit/test-io-tcp.rb
|
479
|
-
- test/unit/test-io-tcpclient.rb
|
480
|
-
- test/unit/test-io-tcpfns.rb
|
481
|
-
- test/unit/test-io-tcpserver.rb
|
482
|
-
- test/unit/test-proc-eval.rb
|
483
|
-
- test/unit/test-proc-frame.rb
|
484
|
-
- test/unit/test-proc-help.rb
|
485
|
-
- test/unit/test-proc-hook.rb
|
486
|
-
- test/unit/test-proc-load_cmds.rb
|
487
|
-
- test/unit/test-proc-location.rb
|
488
|
-
- test/unit/test-proc-main.rb
|
489
|
-
- test/unit/test-proc-validate.rb
|
490
|
-
- test/unit/test-subcmd-help.rb
|
454
|
+
summary: Trepan Ruby Debugger for Rubinius 1.2.4 and higher
|
455
|
+
test_files: []
|
456
|
+
|