trepanning 1.93.35 → 2.15.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ChangeLog +491 -55
- data/LICENSE +1 -1
- data/NEWS +18 -14
- data/README.md +5 -22
- data/Rakefile +22 -1
- data/app/breakpoint.rb +5 -3
- data/app/core.rb +147 -179
- data/app/default.rb +47 -46
- data/app/file.rb +6 -7
- data/app/frame.rb +183 -176
- data/app/markdown.rb +2 -9
- data/app/options.rb +1 -1
- data/app/run.rb +71 -37
- data/interface/script.rb +8 -8
- data/io.rb +19 -20
- data/lib/trepanning.rb +292 -297
- data/processor.rb +332 -344
- data/processor/breakpoint.rb +98 -96
- data/processor/command/base/submgr.rb +9 -9
- data/processor/command/break.rb +40 -38
- data/processor/command/continue.rb +15 -10
- data/processor/command/debug.rb +6 -25
- data/processor/command/delete.rb +21 -12
- data/processor/command/directory.rb +15 -13
- data/processor/command/disable.rb +12 -9
- data/processor/command/disassemble.rb +80 -74
- data/processor/command/display.rb +15 -12
- data/processor/command/down.rb +8 -3
- data/processor/command/edit.rb +37 -23
- data/processor/command/enable.rb +11 -8
- data/processor/command/eval.rb +24 -22
- data/processor/command/finish.rb +50 -48
- data/processor/command/help.rb +1 -1
- data/processor/command/info_subcmd/breakpoints.rb +7 -7
- data/processor/command/info_subcmd/files.rb +195 -196
- data/processor/command/info_subcmd/frame.rb +7 -4
- data/processor/command/info_subcmd/locals.rb +29 -12
- data/processor/command/info_subcmd/program.rb +48 -39
- data/processor/command/info_subcmd/registers_subcmd/ep.rb +46 -0
- data/processor/command/info_subcmd/registers_subcmd/helper.rb +32 -35
- data/processor/command/info_subcmd/registers_subcmd/sp.rb +29 -23
- data/processor/command/info_subcmd/return.rb +28 -10
- data/processor/command/info_subcmd/variables_subcmd/class.rb +3 -3
- data/processor/command/info_subcmd/variables_subcmd/constants.rb +77 -0
- data/processor/command/info_subcmd/variables_subcmd/globals.rb +7 -7
- data/processor/command/info_subcmd/variables_subcmd/instance.rb +68 -22
- data/processor/command/info_subcmd/variables_subcmd/locals.rb +148 -67
- data/processor/command/list.rb +14 -8
- data/processor/command/macro.rb +1 -1
- data/processor/command/next.rb +1 -0
- data/processor/command/set_subcmd/auto.rb +3 -3
- data/processor/command/set_subcmd/different.rb +30 -29
- data/processor/command/set_subcmd/events.rb +74 -48
- data/processor/command/set_subcmd/max_subcmd/list.rb +12 -5
- data/processor/command/set_subcmd/max_subcmd/width.rb +28 -19
- data/processor/command/set_subcmd/register.rb +37 -0
- data/processor/command/set_subcmd/register_subcmd/pc.rb +67 -0
- data/processor/command/set_subcmd/register_subcmd/sp.rb +75 -0
- data/processor/command/set_subcmd/reload.rb +12 -10
- data/processor/command/set_subcmd/return.rb +68 -44
- data/processor/command/shell.rb +3 -2
- data/processor/command/show_subcmd/different.rb +17 -14
- data/processor/command/show_subcmd/events.rb +25 -25
- data/processor/default.rb +1 -1
- data/processor/eval.rb +14 -15
- data/processor/frame.rb +43 -36
- data/processor/help.rb +5 -5
- data/processor/hook.rb +26 -29
- data/processor/location.rb +54 -51
- data/processor/mock.rb +4 -3
- data/processor/running.rb +113 -103
- data/processor/validate.rb +401 -373
- data/test/data/debug.cmd +8 -0
- data/test/data/debug.right +13 -0
- data/test/data/debugger-stop.right +6 -4
- data/test/data/fname-with-blank.cmd +1 -1
- data/test/data/fname-with-blank.right +5 -0
- data/test/data/pc.cmd +8 -0
- data/test/data/pc.right +10 -0
- data/test/data/quit.right +3 -1
- data/test/data/trace.cmd +2 -2
- data/test/data/trace.right +41 -20
- data/test/example/assign.rb +6 -0
- data/test/functional/fn_helper.rb +11 -17
- data/test/functional/test-break-long.rb +15 -16
- data/test/functional/test-break.rb +6 -8
- data/test/functional/test-condition.rb +8 -10
- data/test/functional/test-debugger-call-bug.rb +21 -22
- data/test/functional/test-delete.rb +57 -59
- data/test/functional/test-eval.rb +101 -103
- data/test/functional/test-finish.rb +24 -33
- data/test/functional/test-immediate-step-bug.rb +6 -10
- data/test/functional/test-next.rb +64 -65
- data/test/functional/test-raise.rb +63 -64
- data/test/functional/test-recursive-bt.rb +81 -76
- data/test/functional/test-remap.rb +6 -7
- data/test/functional/test-return.rb +44 -38
- data/test/functional/test-step.rb +55 -53
- data/test/functional/test-stepbug.rb +6 -9
- data/test/functional/test-watchg.rb +40 -39
- data/test/integration/test-debug.rb +12 -0
- data/test/integration/test-debugger-stop.rb +7 -7
- data/test/integration/test-pc.rb +24 -0
- data/test/integration/test-trace.rb +1 -1
- data/test/unit/cmd-helper.rb +0 -1
- data/test/unit/test-app-brkpt.rb +21 -21
- data/test/unit/test-app-brkptmgr.rb +7 -8
- data/test/unit/test-app-display.rb +3 -4
- data/test/unit/test-app-frame.rb +4 -5
- data/test/unit/test-base-subsubcmd.rb +2 -2
- data/test/unit/test-cmd-break.rb +6 -6
- data/test/unit/test-cmd-endisable.rb +7 -6
- data/test/unit/test-cmd-parse_list_cmd.rb +24 -24
- data/test/unit/test-io-tcpserver.rb +39 -35
- data/test/unit/test-proc-default.rb +23 -22
- data/test/unit/test-proc-eval.rb +1 -2
- data/test/unit/test-proc-frame.rb +8 -9
- data/test/unit/test-proc-list.rb +1 -1
- data/test/unit/test-proc-location.rb +2 -2
- data/test/unit/test-proc-main.rb +10 -10
- data/test/unit/test-proc-validate.rb +11 -13
- data/test/unit/test-subcmd-help.rb +1 -2
- data/trepanning.gemspec +8 -13
- metadata +44 -95
- data/COPYING +0 -57
- data/data/custom_require.rb +0 -44
- data/data/perldb.bindings +0 -17
- data/data/prelude.rb +0 -38
- data/processor/command/info_subcmd/variables_subcmd/constant.rb +0 -41
- data/processor/command/raise.rb +0 -48
- data/processor/command/set_subcmd/pc.rb +0 -62
- data/processor/command/set_subcmd/sp.rb +0 -67
- data/processor/eventbuf.rb +0 -133
@@ -1,74 +1,72 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'test/unit'
|
3
|
-
require 'trace'
|
4
3
|
require_relative 'fn_helper'
|
5
4
|
require_relative '../../app/breakpoint'
|
6
5
|
|
7
6
|
class TestDelete < Test::Unit::TestCase
|
8
7
|
|
9
|
-
|
8
|
+
include FnTestHelper
|
10
9
|
|
11
|
-
|
10
|
+
def test_delete
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
12
|
+
# See that when we can delete a breakpoint.
|
13
|
+
cmds = ['set basename on',
|
14
|
+
'break ' + (__LINE__ + 9).to_s,
|
15
|
+
'delete 1',
|
16
|
+
'continue',
|
17
|
+
]
|
18
|
+
d = strarray_setup(cmds)
|
19
|
+
d.start(true)
|
20
|
+
########### b1 ###############
|
21
|
+
va = 1
|
22
|
+
vb = 2
|
23
|
+
vc = 3
|
24
|
+
vd = 4
|
25
|
+
ve = 5
|
26
|
+
##############################
|
27
|
+
d.stop
|
28
|
+
out = ['line ',
|
29
|
+
'va = 1',
|
30
|
+
'basename is on.',
|
31
|
+
"Breakpoint 1 set at VM offset 55 of instruction sequence \"test_delete\",
|
33
32
|
\tline 55 in file foo.rb",
|
34
|
-
|
35
|
-
|
33
|
+
"Deleted breakpoint 1."]
|
34
|
+
compare_output(out, d, cmds)
|
36
35
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
36
|
+
# See that when we can delete a breakpoint but get to the next one.
|
37
|
+
cmds = ['set basename on',
|
38
|
+
'set autoeval on',
|
39
|
+
'break ' + (__LINE__ + 12).to_s,
|
40
|
+
'break ' + (__LINE__ + 13).to_s,
|
41
|
+
'delete 1',
|
42
|
+
'continue',
|
43
|
+
'va',
|
44
|
+
'continue',
|
45
|
+
]
|
46
|
+
d = strarray_setup(cmds)
|
47
|
+
d.start(true)
|
48
|
+
########### b1 ###############
|
49
|
+
va = 1
|
50
|
+
vb = 2
|
51
|
+
va = 3
|
52
|
+
vd = 4
|
53
|
+
ve = 5
|
54
|
+
##############################
|
55
|
+
d.stop
|
56
|
+
out = ["line ",
|
57
|
+
"va = 1",
|
58
|
+
"basename is on.",
|
59
|
+
"Evaluation of unrecognized debugger commands is on.",
|
60
|
+
"Breakpoint 1 set at VM offset 55 of instruction sequence \"test_delete\",
|
62
61
|
\tline 55 in file foo.rb",
|
63
|
-
|
62
|
+
"Breakpoint 2 set at VM offset 55 of instruction sequence \"test_delete\",
|
64
63
|
\tline 55 in file foo.rb",
|
65
|
-
|
66
|
-
"
|
67
|
-
|
68
|
-
|
69
|
-
|
64
|
+
"Deleted breakpoint 1.",
|
65
|
+
"brkpt ",
|
66
|
+
"ve = 5",
|
67
|
+
"D=> 3"]
|
68
|
+
compare_output(out, d, cmds)
|
70
69
|
|
71
|
-
|
72
|
-
|
73
|
-
end
|
70
|
+
end
|
74
71
|
|
72
|
+
end
|
@@ -4,112 +4,110 @@ require_relative 'fn_helper'
|
|
4
4
|
|
5
5
|
class TestEval < Test::Unit::TestCase
|
6
6
|
|
7
|
-
|
7
|
+
include FnTestHelper
|
8
8
|
|
9
|
-
|
9
|
+
def test_eval_questionmark
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
# See that eval? strips 'if' and 'then'
|
23
|
-
cmds = %w(eval? continue)
|
24
|
-
d = strarray_setup(cmds)
|
25
|
-
d.start
|
26
|
-
if 3 > 5 then
|
27
|
-
assert false
|
28
|
-
end
|
29
|
-
d.stop
|
30
|
-
out = ['-- ', 'if 3 > 5 then', 'eval: 3 > 5', 'false']
|
31
|
-
compare_output(out, d, cmds)
|
32
|
-
|
33
|
-
# See that eval? strips 'unless'
|
34
|
-
cmds = %w(eval? continue)
|
35
|
-
d = strarray_setup(cmds)
|
36
|
-
d.start
|
37
|
-
unless 3 < 5
|
38
|
-
assert false
|
39
|
-
end
|
40
|
-
d.stop
|
41
|
-
out = ['-- ', 'unless 3 < 5', 'eval: 3 < 5', 'true']
|
42
|
-
compare_output(out, d, cmds)
|
43
|
-
|
44
|
-
# See that eval? strips 'unless' and 'then
|
45
|
-
cmds = %w(eval? continue)
|
46
|
-
d = strarray_setup(cmds)
|
47
|
-
d.start
|
48
|
-
unless 3 < 5 then
|
49
|
-
assert false
|
50
|
-
end
|
51
|
-
d.stop
|
52
|
-
out = ['-- ', 'unless 3 < 5 then', 'eval: 3 < 5', 'true']
|
53
|
-
compare_output(out, d, cmds)
|
54
|
-
|
55
|
-
# See that eval? strips 'while'
|
56
|
-
cmds = %w(eval? continue)
|
57
|
-
d = strarray_setup(cmds)
|
58
|
-
d.start
|
59
|
-
while nil
|
60
|
-
assert false
|
61
|
-
end
|
62
|
-
d.stop
|
63
|
-
out = ['-- ', 'while nil', 'eval: nil', 'nil']
|
64
|
-
compare_output(out, d, cmds)
|
65
|
-
|
66
|
-
# See that eval? strips 'while' and 'do'
|
67
|
-
cmds = %w(eval? continue)
|
68
|
-
d = strarray_setup(cmds)
|
69
|
-
d.start
|
70
|
-
while nil do
|
71
|
-
assert false
|
72
|
-
end
|
73
|
-
d.stop
|
74
|
-
out = ['-- ', 'while nil do', 'eval: nil', 'nil']
|
75
|
-
compare_output(out, d, cmds)
|
76
|
-
|
77
|
-
# See that eval? strips 'until' and 'do'
|
78
|
-
cmds = %w(eval? continue)
|
79
|
-
d = strarray_setup(cmds)
|
80
|
-
d.start
|
81
|
-
until true do
|
82
|
-
assert false
|
83
|
-
end
|
84
|
-
d.stop
|
85
|
-
out = ['-- ', 'until true do', 'eval: true', 'true']
|
86
|
-
compare_output(out, d, cmds)
|
11
|
+
# See that eval? strips 'if'
|
12
|
+
cmds = %w(eval? continue)
|
13
|
+
d = strarray_setup(cmds)
|
14
|
+
d.start(true)
|
15
|
+
if 3 > 5
|
16
|
+
assert false
|
17
|
+
end
|
18
|
+
d.stop
|
19
|
+
out = ['line ', 'if 3 > 5', 'eval: 3 > 5', 'false']
|
20
|
+
compare_output(out, d, cmds)
|
87
21
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
22
|
+
# See that eval? strips 'if' and 'then'
|
23
|
+
cmds = %w(eval? continue)
|
24
|
+
d = strarray_setup(cmds)
|
25
|
+
d.start(true)
|
26
|
+
if 3 > 5 then
|
27
|
+
assert false
|
28
|
+
end
|
29
|
+
d.stop
|
30
|
+
out = ['line ', 'if 3 > 5 then', 'eval: 3 > 5', 'false']
|
31
|
+
compare_output(out, d, cmds)
|
98
32
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
33
|
+
# See that eval? strips 'unless'
|
34
|
+
cmds = %w(eval? continue)
|
35
|
+
d = strarray_setup(cmds)
|
36
|
+
d.start(true)
|
37
|
+
unless 3 < 5
|
38
|
+
assert false
|
39
|
+
end
|
40
|
+
d.stop
|
41
|
+
out = ['line ', 'unless 3 < 5', 'eval: 3 < 5', 'true']
|
42
|
+
compare_output(out, d, cmds)
|
43
|
+
|
44
|
+
# See that eval? strips 'unless' and 'then
|
45
|
+
cmds = %w(eval? continue)
|
46
|
+
d = strarray_setup(cmds)
|
47
|
+
d.start(true)
|
48
|
+
unless 3 < 5 then
|
49
|
+
assert false
|
50
|
+
end
|
51
|
+
d.stop
|
52
|
+
out = ['line ', 'unless 3 < 5 then', 'eval: 3 < 5', 'true']
|
53
|
+
compare_output(out, d, cmds)
|
54
|
+
|
55
|
+
# See that eval? strips 'while'
|
56
|
+
cmds = %w(eval? continue)
|
57
|
+
d = strarray_setup(cmds)
|
58
|
+
d.start(true)
|
59
|
+
while nil
|
60
|
+
assert false
|
61
|
+
end
|
62
|
+
d.stop
|
63
|
+
out = ['line ', 'while nil', 'eval: nil', 'nil']
|
64
|
+
compare_output(out, d, cmds)
|
114
65
|
|
66
|
+
# See that eval? strips 'while' and 'do'
|
67
|
+
cmds = %w(eval? continue)
|
68
|
+
d = strarray_setup(cmds)
|
69
|
+
d.start(true)
|
70
|
+
while nil do
|
71
|
+
assert false
|
72
|
+
end
|
73
|
+
d.stop
|
74
|
+
out = ['line ', 'while nil do', 'eval: nil', 'nil']
|
75
|
+
compare_output(out, d, cmds)
|
115
76
|
|
77
|
+
# See that eval? strips 'until' and 'do'
|
78
|
+
cmds = %w(eval? continue)
|
79
|
+
d = strarray_setup(cmds)
|
80
|
+
d.start(true)
|
81
|
+
until true do
|
82
|
+
assert false
|
83
|
+
end
|
84
|
+
d.stop
|
85
|
+
out = ['line ', 'until true do', 'eval: true', 'true']
|
86
|
+
compare_output(out, d, cmds)
|
87
|
+
|
88
|
+
# See that eval? strips 'until'
|
89
|
+
cmds = %w(eval? continue)
|
90
|
+
d = strarray_setup(cmds)
|
91
|
+
d.start(true)
|
92
|
+
until true
|
93
|
+
assert false
|
94
|
+
end
|
95
|
+
d.stop
|
96
|
+
out = ['line ', 'until true', 'eval: true', 'true']
|
97
|
+
compare_output(out, d, cmds)
|
98
|
+
|
99
|
+
# FIXME
|
100
|
+
# # See that eval? strips 'return'
|
101
|
+
# def five
|
102
|
+
# return 5
|
103
|
+
# end
|
104
|
+
# cmds = %w(step step eval? continue)
|
105
|
+
# d = strarray_setup(cmds)
|
106
|
+
# d.start(true)
|
107
|
+
# five
|
108
|
+
# d.stop
|
109
|
+
# out = ['line ', 'five', 'call', 'return 5', 'return',
|
110
|
+
# '-> ', 'def five', 'line ', 'return 5', 'eval: 5', '5']
|
111
|
+
# compare_output(out, d, cmds)
|
112
|
+
end
|
113
|
+
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'test/unit'
|
3
|
-
require 'trace'
|
4
3
|
require_relative 'fn_helper'
|
5
4
|
|
6
5
|
class TestFinish < Test::Unit::TestCase
|
@@ -8,37 +7,29 @@ class TestFinish < Test::Unit::TestCase
|
|
8
7
|
include FnTestHelper
|
9
8
|
|
10
9
|
def test_finish_between_fn
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
'D=> true']
|
35
|
-
compare_output(out, d, cmds)
|
10
|
+
# Finish over functions
|
11
|
+
def fact(x)
|
12
|
+
return 1 if x <= 1
|
13
|
+
x = x * fact(x-1)
|
14
|
+
return x
|
15
|
+
end
|
16
|
+
cmds = %w(step finish) + ['24 == x', 'continue']
|
17
|
+
d = strarray_setup(cmds)
|
18
|
+
d.start(true)
|
19
|
+
##############################
|
20
|
+
x = fact(4)
|
21
|
+
y = 5
|
22
|
+
##############################
|
23
|
+
d.stop # ({:remove => true})
|
24
|
+
out = ['line ',
|
25
|
+
'x = fact(4)',
|
26
|
+
'call ',
|
27
|
+
'return 1 if x <= 1',
|
28
|
+
'return ',
|
29
|
+
'R=> 24',
|
30
|
+
'end',
|
31
|
+
'D=> true']
|
32
|
+
compare_output(out, d, cmds)
|
36
33
|
end
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
34
|
|
35
|
+
end
|
@@ -1,34 +1,30 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'test/unit'
|
3
|
-
require 'trace'
|
4
3
|
require_relative 'fn_helper'
|
5
4
|
|
6
5
|
class TestStep < Test::Unit::TestCase
|
7
6
|
|
8
7
|
include FnTestHelper
|
9
|
-
include Trace
|
10
|
-
|
11
8
|
def test_step_same_level
|
12
9
|
|
13
|
-
|
14
|
-
|
15
|
-
return
|
10
|
+
skip "FIXME test_step_same_level"
|
11
|
+
|
16
12
|
# See that we can step with parameter which is the same as 'step 1'
|
17
13
|
cmds = ['next', 'next', 'continue', 'continue']
|
18
14
|
d = strarray_setup(cmds)
|
19
15
|
d.core.step_events = TEST_STEP_EVENT_MASK
|
20
16
|
|
21
17
|
########### immediate bug1 ###############
|
22
|
-
2.times do
|
18
|
+
2.times do
|
23
19
|
x = 1
|
24
20
|
d.debugger(:immediate => true)
|
25
21
|
y = 2
|
26
22
|
end
|
27
23
|
##############################
|
28
24
|
d.stop
|
29
|
-
out = [':o ', 'd.debugger(:immediate => true)',
|
30
|
-
'
|
31
|
-
'
|
25
|
+
out = [':o ', 'd.debugger(:immediate => true)',
|
26
|
+
'line ', 'y = 2',
|
27
|
+
'line ', 'x = 1',
|
32
28
|
':o ', 'd.debugger(:immediate => true)']
|
33
29
|
compare_output(out, d, cmds)
|
34
30
|
end
|