debugger 1.2.4 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +14 -0
- data/.travis.yml +0 -1
- data/CHANGELOG.md +9 -0
- data/Gemfile +3 -0
- data/README.md +2 -0
- data/Rakefile +3 -55
- data/debugger.gemspec +2 -0
- data/lib/debugger/version.rb +1 -1
- data/lib/ruby-debug-base.rb +3 -1
- data/lib/ruby-debug/commands/irb.rb +1 -1
- data/lib/ruby-debug/commands/jump.rb +1 -1
- data/lib/ruby-debug/commands/method.rb +1 -1
- data/lib/ruby-debug/commands/show.rb +1 -1
- data/lib/ruby-debug/commands/trace.rb +2 -2
- data/lib/ruby-debug/commands/variables.rb +3 -3
- data/test/breakpoints_test.rb +365 -0
- data/test/conditions_test.rb +76 -0
- data/test/continue_test.rb +28 -0
- data/test/display_test.rb +141 -0
- data/test/edit_test.rb +55 -0
- data/test/eval_test.rb +92 -0
- data/test/examples/breakpoint1.rb +15 -0
- data/test/examples/breakpoint2.rb +7 -0
- data/test/examples/conditions.rb +4 -0
- data/test/examples/continue.rb +4 -0
- data/test/examples/display.rb +5 -0
- data/test/examples/edit.rb +3 -0
- data/test/examples/edit2.rb +3 -0
- data/test/examples/eval.rb +4 -0
- data/test/examples/finish.rb +20 -0
- data/test/examples/frame.rb +31 -0
- data/test/examples/help.rb +2 -0
- data/test/examples/info.rb +48 -0
- data/test/examples/info2.rb +3 -0
- data/test/examples/irb.rb +6 -0
- data/test/examples/jump.rb +14 -0
- data/test/examples/kill.rb +2 -0
- data/test/examples/list.rb +12 -0
- data/test/examples/method.rb +15 -0
- data/test/examples/post_mortem.rb +19 -0
- data/test/examples/quit.rb +2 -0
- data/test/examples/reload.rb +6 -0
- data/test/examples/restart.rb +6 -0
- data/test/examples/save.rb +3 -0
- data/test/examples/set.rb +3 -0
- data/test/examples/set_annotate.rb +12 -0
- data/test/examples/settings.rb +1 -0
- data/test/examples/show.rb +2 -0
- data/test/examples/source.rb +3 -0
- data/test/examples/stepping.rb +21 -0
- data/test/examples/thread.rb +32 -0
- data/test/examples/tmate.rb +10 -0
- data/test/examples/trace.rb +7 -0
- data/test/examples/trace_threads.rb +20 -0
- data/test/examples/variables.rb +26 -0
- data/test/finish_test.rb +48 -0
- data/test/frame_test.rb +140 -0
- data/test/help_test.rb +50 -0
- data/test/info_test.rb +325 -0
- data/test/irb_test.rb +81 -0
- data/test/jump_test.rb +70 -0
- data/test/kill_test.rb +47 -0
- data/test/list_test.rb +145 -0
- data/test/method_test.rb +70 -0
- data/test/post_mortem_test.rb +25 -0
- data/test/quit_test.rb +55 -0
- data/test/reload_test.rb +43 -0
- data/test/restart_test.rb +143 -0
- data/test/save_test.rb +92 -0
- data/test/set_test.rb +163 -0
- data/test/show_test.rb +292 -0
- data/test/source_test.rb +44 -0
- data/test/stepping_test.rb +118 -0
- data/test/support/breakpoint.rb +12 -0
- data/test/support/context.rb +14 -0
- data/test/support/matchers.rb +67 -0
- data/test/support/mocha_extensions.rb +71 -0
- data/test/support/processor.rb +7 -0
- data/test/support/test_dsl.rb +205 -0
- data/test/support/test_interface.rb +66 -0
- data/test/test_helper.rb +8 -0
- data/test/thread_test.rb +122 -0
- data/test/tmate_test.rb +43 -0
- data/test/trace_test.rb +154 -0
- data/test/variables_test.rb +114 -0
- metadata +107 -158
- data/test/base/base.rb +0 -71
- data/test/base/binding.rb +0 -24
- data/test/base/catchpoint.rb +0 -22
- data/test/base/load.rb +0 -36
- data/test/bp_loop_issue.rb +0 -3
- data/test/classes.rb +0 -11
- data/test/config.yaml +0 -8
- data/test/data/annotate.cmd +0 -29
- data/test/data/annotate.right +0 -139
- data/test/data/break_bad.cmd +0 -18
- data/test/data/break_bad.right +0 -28
- data/test/data/break_loop_bug.cmd +0 -5
- data/test/data/break_loop_bug.right +0 -15
- data/test/data/breakpoints.cmd +0 -38
- data/test/data/breakpoints.right +0 -98
- data/test/data/catch.cmd +0 -20
- data/test/data/catch.right +0 -49
- data/test/data/catch2.cmd +0 -19
- data/test/data/catch2.right +0 -65
- data/test/data/catch3.cmd +0 -11
- data/test/data/catch3.right +0 -37
- data/test/data/condition.cmd +0 -28
- data/test/data/condition.right +0 -65
- data/test/data/ctrl.cmd +0 -23
- data/test/data/ctrl.right +0 -70
- data/test/data/display.cmd +0 -24
- data/test/data/display.right +0 -44
- data/test/data/dollar-0.right +0 -2
- data/test/data/dollar-0a.right +0 -2
- data/test/data/dollar-0b.right +0 -2
- data/test/data/edit.cmd +0 -12
- data/test/data/edit.right +0 -19
- data/test/data/emacs_basic.cmd +0 -43
- data/test/data/emacs_basic.right +0 -106
- data/test/data/enable.cmd +0 -20
- data/test/data/enable.right +0 -36
- data/test/data/finish.cmd +0 -16
- data/test/data/finish.right +0 -31
- data/test/data/frame.cmd +0 -26
- data/test/data/frame.right +0 -55
- data/test/data/help.cmd +0 -20
- data/test/data/help.right +0 -21
- data/test/data/history.right +0 -7
- data/test/data/info-thread.cmd +0 -13
- data/test/data/info-thread.right +0 -37
- data/test/data/info-var-bug2.cmd +0 -5
- data/test/data/info-var-bug2.right +0 -10
- data/test/data/info-var.cmd +0 -23
- data/test/data/info-var.right +0 -52
- data/test/data/info.cmd +0 -21
- data/test/data/info.right +0 -65
- data/test/data/jump.cmd +0 -16
- data/test/data/jump.right +0 -56
- data/test/data/jump2.cmd +0 -16
- data/test/data/jump2.right +0 -44
- data/test/data/linetrace.cmd +0 -6
- data/test/data/linetrace.right +0 -23
- data/test/data/list.cmd +0 -19
- data/test/data/list.right +0 -127
- data/test/data/method.cmd +0 -10
- data/test/data/method.right +0 -21
- data/test/data/methodsig.cmd +0 -10
- data/test/data/methodsig.right +0 -20
- data/test/data/next.cmd +0 -22
- data/test/data/next.right +0 -61
- data/test/data/noquit.right +0 -1
- data/test/data/output.cmd +0 -6
- data/test/data/output.right +0 -31
- data/test/data/pm-bug.cmd +0 -7
- data/test/data/pm-bug.right +0 -12
- data/test/data/post-mortem-next.cmd +0 -8
- data/test/data/post-mortem-next.right +0 -14
- data/test/data/post-mortem-osx.right +0 -31
- data/test/data/post-mortem.cmd +0 -13
- data/test/data/post-mortem.right +0 -32
- data/test/data/quit.cmd +0 -6
- data/test/data/quit.right +0 -0
- data/test/data/raise.cmd +0 -11
- data/test/data/raise.right +0 -23
- data/test/data/save.cmd +0 -34
- data/test/data/save.right +0 -59
- data/test/data/scope-var.cmd +0 -42
- data/test/data/scope-var.right +0 -587
- data/test/data/setshow.cmd +0 -56
- data/test/data/setshow.right +0 -98
- data/test/data/source.cmd +0 -5
- data/test/data/source.right +0 -15
- data/test/data/stepping.cmd +0 -21
- data/test/data/stepping.right +0 -50
- data/test/data/test-init-cygwin.right +0 -7
- data/test/data/test-init-osx.right +0 -4
- data/test/data/test-init.right +0 -5
- data/test/data/trace.right +0 -14
- data/test/dollar-0.rb +0 -5
- data/test/gcd-dbg-nox.rb +0 -30
- data/test/gcd-dbg.rb +0 -29
- data/test/gcd.rb +0 -18
- data/test/helper.rb +0 -142
- data/test/info-var-bug.rb +0 -47
- data/test/info-var-bug2.rb +0 -2
- data/test/jump.rb +0 -14
- data/test/jump2.rb +0 -27
- data/test/lib/commands/catchpoint_test.rb +0 -28
- data/test/lib/commands/unit/regexp.rb +0 -38
- data/test/next.rb +0 -18
- data/test/null.rb +0 -1
- data/test/output.rb +0 -2
- data/test/pm-base.rb +0 -17
- data/test/pm-bug.rb +0 -3
- data/test/pm-catch.rb +0 -12
- data/test/pm-catch2.rb +0 -27
- data/test/pm-catch3.rb +0 -47
- data/test/pm.rb +0 -11
- data/test/raise.rb +0 -3
- data/test/rdebug-save.1 +0 -7
- data/test/runall +0 -12
- data/test/scope-var.rb +0 -29
- data/test/tdebug.rb +0 -246
- data/test/test-annotate.rb +0 -24
- data/test/test-break-bad.rb +0 -36
- data/test/test-breakpoints.rb +0 -24
- data/test/test-catch.rb +0 -24
- data/test/test-catch2.rb +0 -24
- data/test/test-catch3.rb +0 -24
- data/test/test-condition.rb +0 -24
- data/test/test-ctrl.rb +0 -51
- data/test/test-display.rb +0 -25
- data/test/test-dollar-0.rb +0 -39
- data/test/test-edit.rb +0 -25
- data/test/test-emacs-basic.rb +0 -25
- data/test/test-enable.rb +0 -24
- data/test/test-finish.rb +0 -33
- data/test/test-frame.rb +0 -33
- data/test/test-help.rb +0 -54
- data/test/test-hist.rb +0 -65
- data/test/test-info-thread.rb +0 -31
- data/test/test-info-var.rb +0 -46
- data/test/test-info.rb +0 -25
- data/test/test-init.rb +0 -43
- data/test/test-jump.rb +0 -34
- data/test/test-list.rb +0 -24
- data/test/test-method.rb +0 -33
- data/test/test-next.rb +0 -24
- data/test/test-output.rb +0 -25
- data/test/test-quit.rb +0 -29
- data/test/test-raise.rb +0 -24
- data/test/test-remote.rb +0 -14
- data/test/test-save.rb +0 -30
- data/test/test-scope-var.rb +0 -24
- data/test/test-setshow.rb +0 -24
- data/test/test-source.rb +0 -24
- data/test/test-stepping.rb +0 -25
- data/test/test-trace.rb +0 -46
- data/test/thread1.rb +0 -25
- data/test/trunc-call.rb +0 -30
data/test/data/info-var-bug2.cmd
DELETED
data/test/data/info-var.cmd
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# ***************************************************
|
2
|
-
# Test handling of info variables when we have
|
3
|
-
# redefined inspect or to_s which give an error.
|
4
|
-
# ***************************************************
|
5
|
-
set debuggertesting on
|
6
|
-
# Go to where we have a bad "inspect" of a local variable
|
7
|
-
continue 36
|
8
|
-
info variables
|
9
|
-
# Go to where we have a bad "inspect" and "to_s" of a local variable
|
10
|
-
continue 40
|
11
|
-
info variables
|
12
|
-
break 31
|
13
|
-
# The first time through, we can do inspect.
|
14
|
-
continue
|
15
|
-
info locals
|
16
|
-
# Now go to where we have a bad "inspect" of an class variable
|
17
|
-
continue
|
18
|
-
info locals
|
19
|
-
info variables
|
20
|
-
# Now go to where we have a bad "inspect" and "to_s" of an class variable
|
21
|
-
continue
|
22
|
-
info locals
|
23
|
-
quit
|
data/test/data/info-var.right
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
info-var-bug.rb:1
|
2
|
-
class Lousy_inspect
|
3
|
-
# # ***************************************************
|
4
|
-
# # Test handling of info variables when we have
|
5
|
-
# # redefined inspect or to_s which give an error.
|
6
|
-
# # ***************************************************
|
7
|
-
# set debuggertesting on
|
8
|
-
Currently testing the debugger is on.
|
9
|
-
# # Go to where we have a bad "inspect" of a local variable
|
10
|
-
# continue 36
|
11
|
-
info-var-bug.rb:36
|
12
|
-
x
|
13
|
-
# info variables
|
14
|
-
self = main
|
15
|
-
x = #<Lousy_inspect:0xb7825034>
|
16
|
-
# # Go to where we have a bad "inspect" and "to_s" of a local variable
|
17
|
-
# continue 40
|
18
|
-
info-var-bug.rb:40
|
19
|
-
x
|
20
|
-
# info variables
|
21
|
-
self = main
|
22
|
-
x = *Error in evaluation*
|
23
|
-
# break 31
|
24
|
-
Breakpoint 1 file ./info-var-bug.rb, line 31
|
25
|
-
# # The first time through, we can do inspect.
|
26
|
-
# continue
|
27
|
-
Breakpoint 1 at info-var-bug.rb:31
|
28
|
-
info-var-bug.rb:31
|
29
|
-
@b = 5
|
30
|
-
# info locals
|
31
|
-
a = 10
|
32
|
-
# # Now go to where we have a bad "inspect" of an class variable
|
33
|
-
# continue
|
34
|
-
Breakpoint 1 at info-var-bug.rb:31
|
35
|
-
info-var-bug.rb:31
|
36
|
-
@b = 5
|
37
|
-
# info locals
|
38
|
-
a = #<Lousy_inspect:0xb784945c>
|
39
|
-
# info variables
|
40
|
-
a = #<Lousy_inspect:0xb780ddd0>
|
41
|
-
self = #<UnsuspectingClass:0xb78075e8>
|
42
|
-
@a = #<Lousy_inspect:0xb780ddd0>
|
43
|
-
@@Const = "A constant"
|
44
|
-
@@var = "a class variable"
|
45
|
-
# # Now go to where we have a bad "inspect" and "to_s" of an class variable
|
46
|
-
# continue
|
47
|
-
Breakpoint 1 at info-var-bug.rb:31
|
48
|
-
info-var-bug.rb:31
|
49
|
-
@b = 5
|
50
|
-
# info locals
|
51
|
-
*Error in evaluation*
|
52
|
-
# quit
|
data/test/data/info.cmd
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# ***************************************************
|
2
|
-
# This tests info command handling
|
3
|
-
# ***************************************************
|
4
|
-
set debuggertesting on
|
5
|
-
set callstyle last
|
6
|
-
help info
|
7
|
-
info args
|
8
|
-
info line
|
9
|
-
info locals
|
10
|
-
info stack
|
11
|
-
info display
|
12
|
-
help info break
|
13
|
-
help info display
|
14
|
-
break 10
|
15
|
-
break 12
|
16
|
-
info break 10
|
17
|
-
info break 1
|
18
|
-
info break 1 2
|
19
|
-
info break
|
20
|
-
info file ./gcd.rb break
|
21
|
-
quit
|
data/test/data/info.right
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
gcd.rb:4
|
2
|
-
def gcd(a, b)
|
3
|
-
# # ***************************************************
|
4
|
-
# # This tests info command handling
|
5
|
-
# # ***************************************************
|
6
|
-
# set debuggertesting on
|
7
|
-
Currently testing the debugger is on.
|
8
|
-
# set callstyle last
|
9
|
-
Frame call-display style is last.
|
10
|
-
# help info
|
11
|
-
Generic command for showing things about the program being debugged.
|
12
|
-
--
|
13
|
-
List of info subcommands:
|
14
|
-
--
|
15
|
-
info args -- Argument variables of current stack frame
|
16
|
-
info breakpoints -- Status of user-settable breakpoints
|
17
|
-
info catch -- Exceptions that can be caught in the current stack frame
|
18
|
-
info display -- Expressions to display when program stops
|
19
|
-
info file -- Info about a particular file read in
|
20
|
-
info files -- File names and timestamps of files read in
|
21
|
-
info global_variables -- Global variables
|
22
|
-
info instance_variables -- Instance variables of the current stack frame
|
23
|
-
info line -- Line number and file name of current position in source file
|
24
|
-
info locals -- Local variables of the current stack frame
|
25
|
-
info program -- Execution status of the program
|
26
|
-
info stack -- Backtrace of the stack
|
27
|
-
info thread -- List info about thread NUM
|
28
|
-
info threads -- information of currently-known threads
|
29
|
-
info variables -- Local and instance variables of the current stack frame
|
30
|
-
# info args
|
31
|
-
# info line
|
32
|
-
Line 4 of "./gcd.rb"
|
33
|
-
# info locals
|
34
|
-
# info stack
|
35
|
-
--> #0 at line gcd.rb:4
|
36
|
-
# info display
|
37
|
-
There are no auto-display expressions now.
|
38
|
-
# help info break
|
39
|
-
Status of user-settable breakpoints.
|
40
|
-
Without argument, list info about all breakpoints. With an
|
41
|
-
integer argument, list info on that breakpoint.
|
42
|
-
# help info display
|
43
|
-
Expressions to display when program stops.
|
44
|
-
# break 10
|
45
|
-
Breakpoint 1 file ./gcd.rb, line 10
|
46
|
-
# break 12
|
47
|
-
Breakpoint 2 file ./gcd.rb, line 12
|
48
|
-
# info break 10
|
49
|
-
*** No breakpoints found among list given.
|
50
|
-
# info break 1
|
51
|
-
Num Enb What
|
52
|
-
1 y at ./gcd.rb:10
|
53
|
-
# info break 1 2
|
54
|
-
Num Enb What
|
55
|
-
1 y at ./gcd.rb:10
|
56
|
-
2 y at ./gcd.rb:12
|
57
|
-
# info break
|
58
|
-
Num Enb What
|
59
|
-
1 y at ./gcd.rb:10
|
60
|
-
2 y at ./gcd.rb:12
|
61
|
-
# info file ./gcd.rb break
|
62
|
-
File ./gcd.rb
|
63
|
-
breakpoint line numbers:
|
64
|
-
4 6 7 10 12 13 15 18
|
65
|
-
# quit
|
data/test/data/jump.cmd
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# ********************************************************
|
2
|
-
# This tests jump command
|
3
|
-
# ********************************************************
|
4
|
-
set debuggertesting on
|
5
|
-
set callstyle last
|
6
|
-
set force off
|
7
|
-
break 7
|
8
|
-
cont
|
9
|
-
jump -1
|
10
|
-
cont
|
11
|
-
delete 1
|
12
|
-
jump -1
|
13
|
-
jump +1
|
14
|
-
next
|
15
|
-
jump 2
|
16
|
-
cont
|
data/test/data/jump.right
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
jump.rb:1
|
2
|
-
def foo
|
3
|
-
# # ********************************************************
|
4
|
-
# # This tests jump command
|
5
|
-
# # ********************************************************
|
6
|
-
# set debuggertesting on
|
7
|
-
Currently testing the debugger is on.
|
8
|
-
# set callstyle last
|
9
|
-
Frame call-display style is last.
|
10
|
-
# set force off
|
11
|
-
force-stepping is off.
|
12
|
-
# break 7
|
13
|
-
Breakpoint 1 file ./jump.rb, line 7
|
14
|
-
# cont
|
15
|
-
Breakpoint 1 at jump.rb:7
|
16
|
-
jump.rb:7
|
17
|
-
puts j
|
18
|
-
# jump -1
|
19
|
-
jump.rb:6
|
20
|
-
j = j + k
|
21
|
-
# cont
|
22
|
-
Breakpoint 1 at jump.rb:7
|
23
|
-
jump.rb:7
|
24
|
-
puts j
|
25
|
-
# delete 1
|
26
|
-
# jump -1
|
27
|
-
jump.rb:6
|
28
|
-
j = j + k
|
29
|
-
# jump +1
|
30
|
-
jump.rb:7
|
31
|
-
puts j
|
32
|
-
# next
|
33
|
-
21
|
34
|
-
jump.rb:6
|
35
|
-
j = j + k
|
36
|
-
# jump 2
|
37
|
-
jump.rb:2
|
38
|
-
j = 0
|
39
|
-
# cont
|
40
|
-
11
|
41
|
-
22
|
42
|
-
34
|
43
|
-
12
|
44
|
-
23
|
45
|
-
35
|
46
|
-
13
|
47
|
-
24
|
48
|
-
36
|
49
|
-
14
|
50
|
-
25
|
51
|
-
37
|
52
|
-
15
|
53
|
-
26
|
54
|
-
38
|
55
|
-
38
|
56
|
-
done
|
data/test/data/jump2.cmd
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# ********************************************************
|
2
|
-
# This tests jump command
|
3
|
-
# ********************************************************
|
4
|
-
set debuggertesting on
|
5
|
-
set callstyle last
|
6
|
-
set force off
|
7
|
-
step
|
8
|
-
step
|
9
|
-
step
|
10
|
-
step
|
11
|
-
step
|
12
|
-
step
|
13
|
-
step
|
14
|
-
step
|
15
|
-
jump 20
|
16
|
-
cont
|
data/test/data/jump2.right
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
jump2.rb:1
|
2
|
-
def foo3(arg)
|
3
|
-
# # ********************************************************
|
4
|
-
# # This tests jump command
|
5
|
-
# # ********************************************************
|
6
|
-
# set debuggertesting on
|
7
|
-
Currently testing the debugger is on.
|
8
|
-
# set callstyle last
|
9
|
-
Frame call-display style is last.
|
10
|
-
# set force off
|
11
|
-
force-stepping is off.
|
12
|
-
# step
|
13
|
-
jump2.rb:9
|
14
|
-
def foo2(arg)
|
15
|
-
# step
|
16
|
-
jump2.rb:17
|
17
|
-
def foo1(arg)
|
18
|
-
# step
|
19
|
-
jump2.rb:25
|
20
|
-
foo1(0)
|
21
|
-
# step
|
22
|
-
jump2.rb:18
|
23
|
-
arg = arg + 1
|
24
|
-
# step
|
25
|
-
jump2.rb:19
|
26
|
-
foo2(arg)
|
27
|
-
# step
|
28
|
-
jump2.rb:10
|
29
|
-
arg = arg + 2
|
30
|
-
# step
|
31
|
-
jump2.rb:11
|
32
|
-
foo3(arg)
|
33
|
-
# step
|
34
|
-
jump2.rb:2
|
35
|
-
arg = arg + 3
|
36
|
-
# jump 20
|
37
|
-
jump2.rb:20
|
38
|
-
puts arg
|
39
|
-
# cont
|
40
|
-
1
|
41
|
-
15
|
42
|
-
r3
|
43
|
-
12
|
44
|
-
done
|
data/test/data/linetrace.cmd
DELETED
data/test/data/linetrace.right
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
gcd.rb:4
|
2
|
-
def gcd(a, b)
|
3
|
-
# # ********************************************************
|
4
|
-
# # This tests the 'linetrace' command.
|
5
|
-
# # ********************************************************
|
6
|
-
# set basename on
|
7
|
-
basename is on.
|
8
|
-
# set linetrace on
|
9
|
-
line tracing is on.
|
10
|
-
# continue
|
11
|
-
Tracing(1):gcd.rb:18 gcd(3,5)
|
12
|
-
Tracing(1):gcd.rb:6 if a > b
|
13
|
-
Tracing(1):gcd.rb:10 return nil if a <= 0
|
14
|
-
Tracing(1):gcd.rb:12 if a == 1 or b-a == 0
|
15
|
-
Tracing(1):gcd.rb:15 gcd(b-a, a)
|
16
|
-
Tracing(1):gcd.rb:6 if a > b
|
17
|
-
Tracing(1):gcd.rb:10 return nil if a <= 0
|
18
|
-
Tracing(1):gcd.rb:12 if a == 1 or b-a == 0
|
19
|
-
Tracing(1):gcd.rb:15 gcd(b-a, a)
|
20
|
-
Tracing(1):gcd.rb:6 if a > b
|
21
|
-
Tracing(1):gcd.rb:10 return nil if a <= 0
|
22
|
-
Tracing(1):gcd.rb:12 if a == 1 or b-a == 0
|
23
|
-
Tracing(1):gcd.rb:13 return a
|
data/test/data/list.cmd
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# ********************************************************
|
2
|
-
# This tests the 'list' command.
|
3
|
-
# ********************************************************
|
4
|
-
set basename on
|
5
|
-
list
|
6
|
-
list
|
7
|
-
list
|
8
|
-
list
|
9
|
-
list -
|
10
|
-
list -
|
11
|
-
list -
|
12
|
-
list -
|
13
|
-
list 1
|
14
|
-
list 20
|
15
|
-
set listsize 5
|
16
|
-
list 5
|
17
|
-
list =
|
18
|
-
list 3-4
|
19
|
-
|
data/test/data/list.right
DELETED
@@ -1,127 +0,0 @@
|
|
1
|
-
gcd.rb:4
|
2
|
-
def gcd(a, b)
|
3
|
-
# # ********************************************************
|
4
|
-
# # This tests the 'list' command.
|
5
|
-
# # ********************************************************
|
6
|
-
# set basename on
|
7
|
-
basename is on.
|
8
|
-
# list
|
9
|
-
[-1, 8] in ./gcd.rb
|
10
|
-
1 #!/usr/bin/env ruby
|
11
|
-
2
|
12
|
-
3 # GCD. We assume positive numbers
|
13
|
-
=> 4 def gcd(a, b)
|
14
|
-
5 # Make: a <= b
|
15
|
-
6 if a > b
|
16
|
-
7 a, b = [b, a]
|
17
|
-
8 end
|
18
|
-
# list
|
19
|
-
[9, 18] in ./gcd.rb
|
20
|
-
9
|
21
|
-
10 return nil if a <= 0
|
22
|
-
11
|
23
|
-
12 if a == 1 or b-a == 0
|
24
|
-
13 return a
|
25
|
-
14 end
|
26
|
-
15 gcd(b-a, a)
|
27
|
-
16 end
|
28
|
-
17
|
29
|
-
18 gcd(3,5)
|
30
|
-
# list
|
31
|
-
[9, 18] in ./gcd.rb
|
32
|
-
9
|
33
|
-
10 return nil if a <= 0
|
34
|
-
11
|
35
|
-
12 if a == 1 or b-a == 0
|
36
|
-
13 return a
|
37
|
-
14 end
|
38
|
-
15 gcd(b-a, a)
|
39
|
-
16 end
|
40
|
-
17
|
41
|
-
18 gcd(3,5)
|
42
|
-
# list
|
43
|
-
[9, 18] in ./gcd.rb
|
44
|
-
9
|
45
|
-
10 return nil if a <= 0
|
46
|
-
11
|
47
|
-
12 if a == 1 or b-a == 0
|
48
|
-
13 return a
|
49
|
-
14 end
|
50
|
-
15 gcd(b-a, a)
|
51
|
-
16 end
|
52
|
-
17
|
53
|
-
18 gcd(3,5)
|
54
|
-
# list -
|
55
|
-
[-1, 8] in ./gcd.rb
|
56
|
-
1 #!/usr/bin/env ruby
|
57
|
-
2
|
58
|
-
3 # GCD. We assume positive numbers
|
59
|
-
=> 4 def gcd(a, b)
|
60
|
-
5 # Make: a <= b
|
61
|
-
6 if a > b
|
62
|
-
7 a, b = [b, a]
|
63
|
-
8 end
|
64
|
-
# list -
|
65
|
-
[-1, 8] in ./gcd.rb
|
66
|
-
1 #!/usr/bin/env ruby
|
67
|
-
2
|
68
|
-
3 # GCD. We assume positive numbers
|
69
|
-
=> 4 def gcd(a, b)
|
70
|
-
5 # Make: a <= b
|
71
|
-
6 if a > b
|
72
|
-
7 a, b = [b, a]
|
73
|
-
8 end
|
74
|
-
# list -
|
75
|
-
[-1, 8] in ./gcd.rb
|
76
|
-
1 #!/usr/bin/env ruby
|
77
|
-
2
|
78
|
-
3 # GCD. We assume positive numbers
|
79
|
-
=> 4 def gcd(a, b)
|
80
|
-
5 # Make: a <= b
|
81
|
-
6 if a > b
|
82
|
-
7 a, b = [b, a]
|
83
|
-
8 end
|
84
|
-
# list -
|
85
|
-
[-1, 8] in ./gcd.rb
|
86
|
-
1 #!/usr/bin/env ruby
|
87
|
-
2
|
88
|
-
3 # GCD. We assume positive numbers
|
89
|
-
=> 4 def gcd(a, b)
|
90
|
-
5 # Make: a <= b
|
91
|
-
6 if a > b
|
92
|
-
7 a, b = [b, a]
|
93
|
-
8 end
|
94
|
-
# list 1
|
95
|
-
[-4, 5] in ./gcd.rb
|
96
|
-
1 #!/usr/bin/env ruby
|
97
|
-
2
|
98
|
-
3 # GCD. We assume positive numbers
|
99
|
-
=> 4 def gcd(a, b)
|
100
|
-
5 # Make: a <= b
|
101
|
-
# list 20
|
102
|
-
[15, 24] in ./gcd.rb
|
103
|
-
15 gcd(b-a, a)
|
104
|
-
16 end
|
105
|
-
17
|
106
|
-
18 gcd(3,5)
|
107
|
-
# set listsize 5
|
108
|
-
Number of source lines to list by default is 5.
|
109
|
-
# list 5
|
110
|
-
[3, 7] in ./gcd.rb
|
111
|
-
3 # GCD. We assume positive numbers
|
112
|
-
=> 4 def gcd(a, b)
|
113
|
-
5 # Make: a <= b
|
114
|
-
6 if a > b
|
115
|
-
7 a, b = [b, a]
|
116
|
-
# list =
|
117
|
-
[2, 6] in ./gcd.rb
|
118
|
-
2
|
119
|
-
3 # GCD. We assume positive numbers
|
120
|
-
=> 4 def gcd(a, b)
|
121
|
-
5 # Make: a <= b
|
122
|
-
6 if a > b
|
123
|
-
# list 3-4
|
124
|
-
[3, 4] in ./gcd.rb
|
125
|
-
3 # GCD. We assume positive numbers
|
126
|
-
=> 4 def gcd(a, b)
|
127
|
-
#
|