rbx-trepanning 0.0.7-universal-rubinius-1.2 → 0.0.8-universal-rubinius-1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +236 -0
- data/NEWS +16 -0
- data/Rakefile +60 -11
- data/app/breakpoint.rb +5 -1
- data/app/brkptmgr.rb +5 -0
- data/app/cmd_parse.kpeg +225 -0
- data/app/cmd_parse.rb +209 -0
- data/app/cmd_parser.rb +1894 -0
- data/app/default.rb +0 -1
- data/app/method.rb +12 -8
- data/app/options.rb +2 -9
- data/app/validate.rb +2 -2
- data/bin/trepanx +3 -3
- data/lib/trepanning.rb +9 -6
- data/processor/breakpoint.rb +5 -19
- data/processor/command/alias.rb +4 -5
- data/processor/command/base/submgr.rb +2 -2
- data/processor/command/break.rb +44 -66
- data/processor/command/condition.rb +2 -0
- data/processor/command/continue.rb +11 -41
- data/processor/command/disassemble.rb +2 -0
- data/processor/command/eval.rb +20 -8
- data/processor/command/exit.rb +3 -2
- data/{doc → processor/command/help}/.gitignore +0 -0
- data/processor/command/help/command.txt +48 -0
- data/processor/command/help/filename.txt +40 -0
- data/processor/command/help/location.txt +37 -0
- data/processor/command/help.rb +52 -73
- data/processor/command/info_subcmd/breakpoints.rb +35 -13
- data/processor/command/info_subcmd/files.rb +34 -25
- data/processor/command/info_subcmd/frame.rb +67 -0
- data/processor/command/kill.rb +0 -1
- data/processor/command/restart.rb +8 -8
- data/processor/command/save.rb +58 -0
- data/processor/command/set_subcmd/trace_subcmd/buffer.rb +1 -1
- data/processor/command/set_subcmd/trace_subcmd/print.rb +1 -1
- data/processor/command/show.rb +7 -6
- data/processor/command/step.rb +16 -3
- data/processor/command/tbreak.rb +1 -1
- data/processor/disassemble.rb +1 -1
- data/processor/help.rb +20 -0
- data/processor/load_cmds.rb +53 -4
- data/processor/location.rb +47 -1
- data/processor/main.rb +4 -9
- data/processor/mock.rb +3 -3
- data/processor/running.rb +16 -17
- data/processor/validate.rb +171 -159
- data/rbx-trepanning.gemspec +1 -1
- data/test/example/debugger-stop.rb +16 -0
- data/test/functional/test-break-name.rb +1 -1
- data/test/functional/test-eval.rb +115 -0
- data/test/functional/test-tbreak.rb +1 -1
- data/test/integration/helper.rb +5 -2
- data/test/unit/cmd-helper.rb +1 -1
- data/test/unit/test-app-cmd_parse.rb +97 -0
- data/test/unit/test-app-cmd_parser.rb +22 -0
- data/test/unit/test-app-options.rb +1 -0
- data/test/unit/test-app-validate.rb +2 -2
- data/test/unit/test-cmd-break.rb +47 -5
- data/test/unit/test-completion.rb +2 -1
- data/test/unit/test-proc-location.rb +11 -0
- data/test/unit/test-proc-validate.rb +68 -30
- metadata +26 -11
- data/doc/debugger.html +0 -108
@@ -0,0 +1,97 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
require 'rubygems'; require 'require_relative'
|
4
|
+
require_relative '../../app/cmd_parse'
|
5
|
+
|
6
|
+
class TestCmdParse < Test::Unit::TestCase
|
7
|
+
|
8
|
+
# require_relative '../../lib/trepanning'
|
9
|
+
def test_parse_location
|
10
|
+
[['fn', [:fn, nil, nil]],
|
11
|
+
['fn 2', [:fn, :line, 2]],
|
12
|
+
['fn @5', [:fn, :offset, 5]],
|
13
|
+
['@3', [nil, :offset, 3]],
|
14
|
+
['fn:6', [:fn, :line, 6]],
|
15
|
+
["#{__FILE__}:5", [:file, :line, 5]],
|
16
|
+
['fn:@15', [:fn, :offset, 15]],
|
17
|
+
].each do |location, expect|
|
18
|
+
cp = parse_location(location)
|
19
|
+
assert cp, "should be able to parse #{location} as a location"
|
20
|
+
assert_equal(expect[0], cp.container_type,
|
21
|
+
"mismatch container_type on #{location}")
|
22
|
+
assert_equal(expect[1], cp.position_type,
|
23
|
+
"mismatch position_type on #{location}")
|
24
|
+
assert_equal(expect[2], cp.position,
|
25
|
+
"mismatch position on #{location}")
|
26
|
+
end
|
27
|
+
|
28
|
+
# %w(0 1e10 a.b).each do |location|
|
29
|
+
# begin
|
30
|
+
# cp = CmdParse.new(name)
|
31
|
+
# assert_equal nil cp._location,
|
32
|
+
# "should be able to parse #{name} as a location"
|
33
|
+
# end
|
34
|
+
# end
|
35
|
+
end
|
36
|
+
|
37
|
+
module Testing
|
38
|
+
def testing; 5 end
|
39
|
+
module_function :testing
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_parse_identifier
|
43
|
+
%w(a a1 $global __FILE__ Constant).each do |name|
|
44
|
+
cp = CmdParse.new(name)
|
45
|
+
assert cp._identifier, "should be able to parse #{name} as an identifier"
|
46
|
+
end
|
47
|
+
%w(0 1e10 @10).each do |name|
|
48
|
+
cp = CmdParse.new(name)
|
49
|
+
assert_equal(true, !cp._identifier,
|
50
|
+
"should not have been able to parse of #{name}")
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_parse_method
|
55
|
+
[['Object', 0], ['A::B', 1], ['A::B::C', 2],
|
56
|
+
['A::B::C::D', 3], ['A::B.c', 2], ['A.b.c.d', 3]].each do |name, count|
|
57
|
+
cp = CmdParse.new(name)
|
58
|
+
assert cp._class_module_chain, "should be able to parse of #{name}"
|
59
|
+
m = cp.result
|
60
|
+
count.times do |i|
|
61
|
+
assert m, "Chain item #{i} of #{name} should not be nil"
|
62
|
+
m = m.chain[1]
|
63
|
+
end
|
64
|
+
assert_nil m.chain, "#{count} chain item in #{cp.result} should be nil"
|
65
|
+
end
|
66
|
+
['A(5)'].each do |name|
|
67
|
+
cp = CmdParse.new(name)
|
68
|
+
cp._class_module_chain
|
69
|
+
assert_not_equal(name, cp.result.name,
|
70
|
+
"should not have been able to parse of #{name}")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
include Trepan::CmdParser
|
75
|
+
def test_method_name
|
76
|
+
def five; 5 end
|
77
|
+
%w(five Rubinius::VM.backtrace Kernel.eval
|
78
|
+
Testing.testing Kernel::eval File.basename).each do |str|
|
79
|
+
meth = meth_for_string(str, binding)
|
80
|
+
assert meth.kind_of?(Method), "#{str} method's class should be Method, not #{meth.class}"
|
81
|
+
end
|
82
|
+
x = File
|
83
|
+
def x.five; 5; end
|
84
|
+
%w(x.basename x.five).each do |str|
|
85
|
+
meth = meth_for_string(str, binding)
|
86
|
+
assert meth.kind_of?(Method), "#{str} method's class should be Method, not #{meth.class}"
|
87
|
+
end
|
88
|
+
%w(Array.map).each do |str|
|
89
|
+
meth = meth_for_string(str, binding)
|
90
|
+
assert meth.kind_of?(UnboundMethod), "#{meth.class}"
|
91
|
+
end
|
92
|
+
%w(O5).each do |str|
|
93
|
+
meth = meth_for_string(str, binding)
|
94
|
+
assert_equal nil, meth, "should have found a method for #{str}"
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
require_relative '../../app/cmd_parser'
|
4
|
+
|
5
|
+
class TestAppCmdParser < Test::Unit::TestCase
|
6
|
+
def setup
|
7
|
+
@cp = CmdParse.new('', true)
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_parse_filename
|
11
|
+
[
|
12
|
+
['filename', 'filename'],
|
13
|
+
['"this is a filename"', 'this is a filename'],
|
14
|
+
['this\ is\ another\ filename', 'this is another filename'],
|
15
|
+
['C\:filename', 'C:filename']
|
16
|
+
].each do |name, expect|
|
17
|
+
@cp.setup_parser(name, true)
|
18
|
+
res = @cp._filename
|
19
|
+
assert_equal(expect, @cp.result)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -6,8 +6,8 @@ require_relative '../../app/validate'
|
|
6
6
|
class TestAppValidate < Test::Unit::TestCase
|
7
7
|
include Trepan::Validate
|
8
8
|
def test_line_or_ip
|
9
|
-
[
|
10
|
-
['
|
9
|
+
[
|
10
|
+
['@2', [2, nil]],
|
11
11
|
['oink', [nil, nil]],
|
12
12
|
['1' , [nil, 1]],
|
13
13
|
['12', [nil, 12]],
|
data/test/unit/test-cmd-break.rb
CHANGED
@@ -10,13 +10,55 @@ class TestCommandBreak < Test::Unit::TestCase
|
|
10
10
|
@cmdproc.frame_setup
|
11
11
|
@name = File.basename(__FILE__, '.rb').split(/-/)[2]
|
12
12
|
@my_cmd = @cmds[@name]
|
13
|
+
@brkpt_set_pat = /^Set breakpoint \d+: .*$/
|
13
14
|
end
|
14
|
-
|
15
|
+
|
16
|
+
def run_cmd(cmd, args)
|
17
|
+
cmd.proc.instance_variable_set('@cmd_argstr', args[1..-1].join(' '))
|
18
|
+
cmd.run(args)
|
19
|
+
end
|
20
|
+
|
21
|
+
# require_relative '../../lib/trepanning'
|
15
22
|
def test_basic
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
# [
|
24
|
+
# [@name, __LINE__.to_s],
|
25
|
+
# ].each_with_index do |args, i|
|
26
|
+
# run_cmd(@my_cmd, args)
|
27
|
+
# assert_equal(true, @cmdproc.errmsgs.empty?, @cmdproc.errmsgs)
|
28
|
+
# assert_equal(0, @cmdproc.msgs[0] =~ @brkpt_set_pat, @cmdproc.msgs[0])
|
29
|
+
# reset_cmdproc_vars
|
30
|
+
# end
|
31
|
+
|
32
|
+
# pc_offset = tf.pc_offset
|
33
|
+
# [[@name],
|
34
|
+
# [@name, "@#{pc_offset}"],
|
35
|
+
# #[@name, 'FileUtils.cp']
|
36
|
+
# ].each_with_index do |args, i|
|
37
|
+
# run_cmd(@my_cmd, args)
|
38
|
+
# assert_equal(true, @cmdproc.errmsgs.empty?, @cmdproc.errmsgs)
|
39
|
+
# assert_equal(0, @cmdproc.msgs[0] =~ @brkpt_set_pat, @cmdproc.msgs[0])
|
40
|
+
# reset_cmdproc_vars
|
41
|
+
# end
|
42
|
+
|
43
|
+
common_setup
|
44
|
+
def foo
|
45
|
+
5
|
46
|
+
end
|
47
|
+
[[@name, 'foo', (__LINE__-3).to_s]].each_with_index do |args, i|
|
48
|
+
run_cmd(@my_cmd, args)
|
49
|
+
assert_equal(true, @cmdproc.errmsgs.empty?,
|
50
|
+
@cmdproc.errmsgs)
|
51
|
+
assert_equal(true, @cmdproc.errmsgs.empty?, @cmdproc.errmsgs)
|
52
|
+
reset_cmdproc_vars
|
53
|
+
end
|
54
|
+
|
55
|
+
# [[@name, 'foo']].each_with_index do |args, i|
|
56
|
+
# run_cmd(@my_cmd, args)
|
57
|
+
# assert_equal(true, @cmdproc.errmsgs.empty?,
|
58
|
+
# @cmdproc.errmsgs)
|
59
|
+
# assert_equal(0, @cmdproc.msgs[0] =~ @brkpt_set_pat, @cmdproc.msgs[0])
|
60
|
+
# reset_cmdproc_vars
|
61
|
+
# end
|
20
62
|
end
|
21
63
|
|
22
64
|
end
|
@@ -28,7 +28,8 @@ class TestCompletion < Test::Unit::TestCase
|
|
28
28
|
|
29
29
|
['set auto e', 'e', ['eval']],
|
30
30
|
['disas', 'disas', ['disassemble']], # Another single completion
|
31
|
-
|
31
|
+
## FIXME:
|
32
|
+
# ['help syn', 'syn', ['syntax']],
|
32
33
|
['help br', 'br', ['break', 'breakpoints']],
|
33
34
|
['where', 'where', ['where']], # Single alias completion
|
34
35
|
['set basename o', 'o', ['off', 'on']],
|
@@ -47,7 +47,18 @@ class TestCmdProcessorLocation < Test::Unit::TestCase
|
|
47
47
|
dir = @proc.settings[:directory] = File.dirname(__FILE__)
|
48
48
|
loc, line_no, text = @proc.loc_and_text('hi')
|
49
49
|
assert loc and line_no.is_a?(Fixnum) and text
|
50
|
+
assert @proc.current_source_text
|
50
51
|
# FIXME test that filename remapping works.
|
51
52
|
end
|
52
53
|
|
54
|
+
def test_eval_current_source_text
|
55
|
+
eval <<-EOE
|
56
|
+
@proc.frame_index = 0
|
57
|
+
@proc.frame_initialize
|
58
|
+
@proc.frame_setup
|
59
|
+
LineCache::clear_file_cache
|
60
|
+
assert @proc.current_source_text
|
61
|
+
EOE
|
62
|
+
end
|
63
|
+
|
53
64
|
end
|
@@ -5,6 +5,7 @@ require_relative '../../processor/main' # Have to include before validate!
|
|
5
5
|
# FIXME
|
6
6
|
require_relative '../../processor/validate'
|
7
7
|
require_relative '../../app/mock'
|
8
|
+
require_relative 'cmd-helper'
|
8
9
|
|
9
10
|
$errors = []
|
10
11
|
$msgs = []
|
@@ -13,11 +14,12 @@ $msgs = []
|
|
13
14
|
class TestValidate < Test::Unit::TestCase
|
14
15
|
|
15
16
|
def setup
|
16
|
-
$errors
|
17
|
-
$msgs
|
18
|
-
@
|
17
|
+
$errors = []
|
18
|
+
$msgs = []
|
19
|
+
@dbg ||= MockDebugger::MockDebugger.new(:nx => true)
|
20
|
+
@cmdproc = Trepan::CmdProcessor.new(@dbg)
|
19
21
|
|
20
|
-
class << @
|
22
|
+
class << @cmdproc
|
21
23
|
def errmsg(msg)
|
22
24
|
$errors << msg
|
23
25
|
end
|
@@ -29,61 +31,97 @@ class TestValidate < Test::Unit::TestCase
|
|
29
31
|
end
|
30
32
|
end
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
+
def test_get_int
|
35
|
+
[['1', 1], ['1E', nil], ['bad', nil], ['1+1', 2], ['-5', -5]].each do
|
36
|
+
|arg, expected|
|
37
|
+
assert_equal(expected, @cmdproc.get_int_noerr(arg))
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_get_on_off
|
34
42
|
onoff =
|
35
43
|
[['1', true], ['on', true],
|
36
44
|
['0', false], ['off', false]].each do |arg, expected|
|
37
|
-
assert_equal(expected, @
|
45
|
+
assert_equal(expected, @cmdproc.get_onoff(arg))
|
38
46
|
end
|
39
|
-
|
40
|
-
|
41
|
-
|
47
|
+
end
|
48
|
+
|
49
|
+
include UnitHelper
|
50
|
+
def outer_line
|
51
|
+
@line = __LINE__
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_parse_position
|
55
|
+
common_setup
|
56
|
+
outer_line
|
57
|
+
@dbg.instance_variable_set('@current_frame',
|
58
|
+
Trepan::Frame.new(self, 0,
|
59
|
+
Rubinius::VM.backtrace(0, true)[0]))
|
60
|
+
@cmdproc.frame_setup
|
61
|
+
file = File.basename(__FILE__)
|
62
|
+
[
|
63
|
+
[__FILE__, [false, file, nil, nil]],
|
64
|
+
['@8', [true, file, 8, :offset]],
|
65
|
+
[@line.to_s , [true, file, @line, :line]],
|
66
|
+
['8' , [true, file, 8, :line]],
|
67
|
+
["#{__FILE__}:#{__LINE__}" , [true, file, __LINE__, :line]],
|
68
|
+
["#{__FILE__} #{__LINE__}" , [true, file, __LINE__, :line]]
|
69
|
+
].each do |pos_str, expected|
|
70
|
+
result = @cmdproc.parse_position(pos_str)
|
71
|
+
result[1] = File.basename(result[1])
|
72
|
+
result[0] = !!result[0]
|
73
|
+
assert_equal(expected, result, "parsing position #{pos_str}")
|
42
74
|
end
|
43
75
|
end
|
44
76
|
|
45
|
-
def
|
46
|
-
|
47
|
-
|
48
|
-
|
77
|
+
def test_breakpoint_position
|
78
|
+
start_line = __LINE__
|
79
|
+
common_setup
|
80
|
+
outer_line
|
81
|
+
@dbg.instance_variable_set('@current_frame',
|
82
|
+
Trepan::Frame.new(self, 0,
|
83
|
+
Rubinius::VM.backtrace(0, true)[0]))
|
84
|
+
@cmdproc.frame_setup
|
49
85
|
|
50
86
|
def munge(args)
|
51
|
-
args[
|
87
|
+
args[0] = args[0].class
|
52
88
|
args
|
53
89
|
end
|
54
90
|
|
55
|
-
assert_equal([
|
56
|
-
munge(@
|
57
|
-
|
58
|
-
|
59
|
-
assert_equal([
|
60
|
-
|
91
|
+
assert_equal([Rubinius::CompiledMethod, start_line, 0, 'true', false],
|
92
|
+
munge(@cmdproc.breakpoint_position('@0', false)))
|
93
|
+
result = @cmdproc.breakpoint_position("outer_line:#{@line}", true)
|
94
|
+
result[0] = result[0].name
|
95
|
+
assert_equal([:outer_line, @line, 0, 'true', false], result)
|
96
|
+
result = @cmdproc.breakpoint_position("#{@line} unless 1 == 2", true)
|
97
|
+
result[0] = result[0].name
|
98
|
+
assert_equal([:outer_line, @line, 0, '1 == 2', true], result)
|
61
99
|
end
|
62
100
|
|
63
101
|
def test_int_list
|
64
|
-
assert_equal([1,2,3], @
|
102
|
+
assert_equal([1,2,3], @cmdproc.get_int_list(%w(1+0 3-1 3)))
|
65
103
|
assert_equal(0, $errors.size)
|
66
|
-
assert_equal([2,3], @
|
104
|
+
assert_equal([2,3], @cmdproc.get_int_list(%w(a 2 3)))
|
67
105
|
assert_equal(1, $errors.size)
|
68
106
|
end
|
69
107
|
|
70
|
-
def
|
108
|
+
def test_method?
|
71
109
|
def foo; 5 end
|
72
110
|
|
73
111
|
# require_relative '../../lib/rbdbgr'
|
74
112
|
# dbgr = Trepan.new(:set_restart => true)
|
75
|
-
# FIXME: 'foo',
|
76
|
-
['Array
|
113
|
+
# FIXME: 'foo',
|
114
|
+
['Array.map', 'Trepan::CmdProcessor.new',
|
115
|
+
'errmsg'
|
77
116
|
].each do |str|
|
78
117
|
# dbgr.debugger if 'foo' == str
|
79
|
-
|
80
|
-
"#{str} should be known as a method")
|
118
|
+
assert @cmdproc.method?(str), "#{str} should be known as a method"
|
81
119
|
end
|
82
120
|
['food', '.errmsg'
|
83
121
|
].each do |str|
|
84
122
|
# dbgr.debugger if 'foo' == str
|
85
|
-
assert_equal(false,
|
86
|
-
"#{str} should be known as a method")
|
123
|
+
assert_equal(false, !!@cmdproc.method?(str),
|
124
|
+
"#{str} should not be known as a method")
|
87
125
|
end
|
88
126
|
|
89
127
|
end
|
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:
|
5
|
-
prerelease:
|
4
|
+
hash: 15
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 8
|
10
|
+
version: 0.0.8
|
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-03-15 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -68,11 +68,11 @@ dependencies:
|
|
68
68
|
requirements:
|
69
69
|
- - ~>
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
hash:
|
71
|
+
hash: 11
|
72
72
|
segments:
|
73
73
|
- 1
|
74
|
-
-
|
75
|
-
version: "1.
|
74
|
+
- 2
|
75
|
+
version: "1.2"
|
76
76
|
type: :runtime
|
77
77
|
version_requirements: *id004
|
78
78
|
description: |
|
@@ -104,6 +104,9 @@ files:
|
|
104
104
|
- app/breakpoint.rb
|
105
105
|
- app/brkptmgr.rb
|
106
106
|
- app/client.rb
|
107
|
+
- app/cmd_parse.kpeg
|
108
|
+
- app/cmd_parse.rb
|
109
|
+
- app/cmd_parser.rb
|
107
110
|
- app/complete.rb
|
108
111
|
- app/condition.rb
|
109
112
|
- app/default.rb
|
@@ -123,8 +126,6 @@ files:
|
|
123
126
|
- bin/trepanx
|
124
127
|
- data/.gitignore
|
125
128
|
- data/irbrc
|
126
|
-
- doc/.gitignore
|
127
|
-
- doc/debugger.html
|
128
129
|
- interface/.gitignore
|
129
130
|
- interface/base_intf.rb
|
130
131
|
- interface/client.rb
|
@@ -168,10 +169,15 @@ files:
|
|
168
169
|
- processor/command/finish.rb
|
169
170
|
- processor/command/frame.rb
|
170
171
|
- processor/command/help.rb
|
172
|
+
- processor/command/help/.gitignore
|
173
|
+
- processor/command/help/command.txt
|
174
|
+
- processor/command/help/filename.txt
|
175
|
+
- processor/command/help/location.txt
|
171
176
|
- processor/command/info.rb
|
172
177
|
- processor/command/info_subcmd/.gitignore
|
173
178
|
- processor/command/info_subcmd/breakpoints.rb
|
174
179
|
- processor/command/info_subcmd/files.rb
|
180
|
+
- processor/command/info_subcmd/frame.rb
|
175
181
|
- processor/command/info_subcmd/line.rb
|
176
182
|
- processor/command/info_subcmd/method.rb
|
177
183
|
- processor/command/info_subcmd/program.rb
|
@@ -186,6 +192,7 @@ files:
|
|
186
192
|
- processor/command/pr.rb
|
187
193
|
- processor/command/ps.rb
|
188
194
|
- processor/command/restart.rb
|
195
|
+
- processor/command/save.rb
|
189
196
|
- processor/command/server.rb
|
190
197
|
- processor/command/set.rb
|
191
198
|
- processor/command/set_subcmd/.gitignore
|
@@ -292,6 +299,7 @@ files:
|
|
292
299
|
- test/data/quit2.cmd
|
293
300
|
- test/data/quit2.right
|
294
301
|
- test/example/.gitignore
|
302
|
+
- test/example/debugger-stop.rb
|
295
303
|
- test/example/fname with blank.rb
|
296
304
|
- test/example/gcd-server.rb
|
297
305
|
- test/example/gcd.rb
|
@@ -302,6 +310,7 @@ files:
|
|
302
310
|
- test/functional/fn_helper.rb
|
303
311
|
- test/functional/test-break-name.rb
|
304
312
|
- test/functional/test-break.rb
|
313
|
+
- test/functional/test-eval.rb
|
305
314
|
- test/functional/test-finish.rb
|
306
315
|
- test/functional/test-fn_helper.rb
|
307
316
|
- test/functional/test-list.rb
|
@@ -321,6 +330,8 @@ files:
|
|
321
330
|
- test/unit/mock-helper.rb
|
322
331
|
- test/unit/test-app-brkpt.rb
|
323
332
|
- test/unit/test-app-brkptmgr.rb
|
333
|
+
- test/unit/test-app-cmd_parse.rb
|
334
|
+
- test/unit/test-app-cmd_parser.rb
|
324
335
|
- test/unit/test-app-complete.rb
|
325
336
|
- test/unit/test-app-condition.rb
|
326
337
|
- test/unit/test-app-iseq.rb
|
@@ -390,7 +401,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
390
401
|
requirements: []
|
391
402
|
|
392
403
|
rubyforge_project:
|
393
|
-
rubygems_version: 1.
|
404
|
+
rubygems_version: 1.5.2
|
394
405
|
signing_key:
|
395
406
|
specification_version: 3
|
396
407
|
summary: Trepan Ruby Debugger for Rubinius 1.2.1 and higher
|
@@ -407,6 +418,7 @@ test_files:
|
|
407
418
|
- test/data/quit2.cmd
|
408
419
|
- test/data/quit2.right
|
409
420
|
- test/example/.gitignore
|
421
|
+
- test/example/debugger-stop.rb
|
410
422
|
- test/example/fname with blank.rb
|
411
423
|
- test/example/gcd-server.rb
|
412
424
|
- test/example/gcd.rb
|
@@ -417,6 +429,7 @@ test_files:
|
|
417
429
|
- test/functional/fn_helper.rb
|
418
430
|
- test/functional/test-break-name.rb
|
419
431
|
- test/functional/test-break.rb
|
432
|
+
- test/functional/test-eval.rb
|
420
433
|
- test/functional/test-finish.rb
|
421
434
|
- test/functional/test-fn_helper.rb
|
422
435
|
- test/functional/test-list.rb
|
@@ -436,6 +449,8 @@ test_files:
|
|
436
449
|
- test/unit/mock-helper.rb
|
437
450
|
- test/unit/test-app-brkpt.rb
|
438
451
|
- test/unit/test-app-brkptmgr.rb
|
452
|
+
- test/unit/test-app-cmd_parse.rb
|
453
|
+
- test/unit/test-app-cmd_parser.rb
|
439
454
|
- test/unit/test-app-complete.rb
|
440
455
|
- test/unit/test-app-condition.rb
|
441
456
|
- test/unit/test-app-iseq.rb
|
data/doc/debugger.html
DELETED
@@ -1,108 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title: Debugger
|
3
|
-
---
|
4
|
-
|
5
|
-
Debugger
|
6
|
-
========
|
7
|
-
|
8
|
-
Trepanning source-level debugger
|
9
|
-
|
10
|
-
Invoking in Code
|
11
|
-
----------------
|
12
|
-
|
13
|
-
The Rubinius debugger can be invoked from code by embedding a call to start
|
14
|
-
the debugger
|
15
|
-
|
16
|
-
Consider the following code in app.rb
|
17
|
-
|
18
|
-
class Toast
|
19
|
-
attr_accessor :setting
|
20
|
-
def initialize
|
21
|
-
require 'rubygems'
|
22
|
-
require 'trepanning'
|
23
|
-
Trepan.start ## See Note 1 below.
|
24
|
-
@setting = :brown
|
25
|
-
@kind = :rye
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
p Toast.new.setting
|
30
|
-
|
31
|
-
Running the code in Rubinius would produce the following:
|
32
|
-
|
33
|
-
$ rbx app.rb
|
34
|
-
|
35
|
-
| Breakpoint: Toast#initialize at tmp/toast.rb:5
|
36
|
-
| 5: Trepan.start ## See Note 1 below.
|
37
|
-
(trepanx): help
|
38
|
-
|
39
|
-
Classes of commands:
|
40
|
-
breakpoints -- Making the program stop at certain points
|
41
|
-
data -- Examining data
|
42
|
-
files -- Specifying and examining files
|
43
|
-
running -- Running the program
|
44
|
-
stack -- Examining the call stack
|
45
|
-
status -- Status inquiries
|
46
|
-
support -- Support facilities
|
47
|
-
|
48
|
-
Type "help" followed by a class name for a list of commands in that class.
|
49
|
-
Type "help *" for the list of all commands.
|
50
|
-
Type "help REGEXP" for the list of commands matching /^#{REGEXP}/
|
51
|
-
Type "help CLASS *" for the list of all commands in class CLASS.
|
52
|
-
Type "help" followed by command name for full documentation.
|
53
|
-
|
54
|
-
(trepanx): help *
|
55
|
-
All command names:
|
56
|
-
alias delete exit kill restart step
|
57
|
-
backtrace disassemble frame next set tbreak
|
58
|
-
break down help nexti show unalias
|
59
|
-
continue eval info ps source up
|
60
|
-
(trepanx): bt
|
61
|
-
Backtrace:
|
62
|
-
0 Toast#initialize at tmp/toast.rb:5
|
63
|
-
1 main.__script__ at tmp/toast.rb:11
|
64
|
-
2 Rubinius::CodeLoader#load_script(debug) at kernel/delta/codeloader.rb:67
|
65
|
-
3 Rubinius::CodeLoader.load_script(name) at kernel/delta/codeloader.rb:91
|
66
|
-
4 Rubinius::Loader#script at kernel/loader.rb:460
|
67
|
-
5 Rubinius::Loader#main at kernel/loader.rb:552
|
68
|
-
6 Rubinius::Loader.main at kernel/loader.rb:589
|
69
|
-
7 Object#__script__ at kernel/loader.rb:601
|
70
|
-
(trepanx): n
|
71
|
-
|
72
|
-
| Breakpoint: Toast#initialize at app.rb:6 (16)
|
73
|
-
| 6: @setting = :brown
|
74
|
-
(trepanx): n
|
75
|
-
|
76
|
-
| Breakpoint: Toast#initialize at app.rb:7 (21)
|
77
|
-
| 7: @kind = :rye
|
78
|
-
(trepanx): eval @setting = :light_brown ## See Note 2 below.
|
79
|
-
$d0 = :light_brown
|
80
|
-
(trepanx): c # See Note 3.
|
81
|
-
:light_brown # output from running program
|
82
|
-
|
83
|
-
Help for the debugger commands is available by typing `help` when in the
|
84
|
-
debugger.
|
85
|
-
|
86
|
-
** Note 1.
|
87
|
-
Or if you haven't mucked with ARGV, Dir.pwd, and $0 use:
|
88
|
-
Trepan.start(:set_restart => true). This tells the debugger to
|
89
|
-
capture this information so you can easily restart your program if you
|
90
|
-
need to.
|
91
|
-
|
92
|
-
** Note 2.
|
93
|
-
If you run "set autoeval on" (actually this is on by default), then
|
94
|
-
unrecognized commands are automatically evaluated. So the "eval" is
|
95
|
-
not needed. However if this confuses you "set autoeval off". Another
|
96
|
-
way to explicitly evaluate commands is to start the line with !.
|
97
|
-
|
98
|
-
** Note 3.
|
99
|
-
|
100
|
-
To quit execution, you can use exit which prompts for confimation or
|
101
|
-
q! which won't prompt. You can supply an exit code to return to the
|
102
|
-
OS. A related command is "kill" which sends a signal to the process,
|
103
|
-
the default when none is supplied being "TERM". Finally there's
|
104
|
-
"restart" which you would use if you had started with :set_restart =>
|
105
|
-
true.
|
106
|
-
|
107
|
-
|
108
|
-
More later....
|