ruby-debug 0.10.5.rc1 → 0.10.5.rc2

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.
Files changed (166) hide show
  1. data/ChangeLog +54 -0
  2. data/Rakefile +34 -239
  3. metadata +15 -182
  4. data/test/base/base.rb +0 -77
  5. data/test/base/binding.rb +0 -22
  6. data/test/base/catchpoint.rb +0 -19
  7. data/test/base/load.rb +0 -44
  8. data/test/base/reload_bug.rb +0 -8
  9. data/test/cli/commands/catchpoint_test.rb +0 -24
  10. data/test/cli/commands/unit/regexp.rb +0 -36
  11. data/test/config.yaml +0 -8
  12. data/test/data/annotate.cmd +0 -29
  13. data/test/data/annotate.right +0 -139
  14. data/test/data/at-exit.cmd +0 -4
  15. data/test/data/at-exit.right +0 -12
  16. data/test/data/break_bad.cmd +0 -16
  17. data/test/data/break_bad.right +0 -26
  18. data/test/data/break_loop_bug.cmd +0 -5
  19. data/test/data/break_loop_bug.right +0 -15
  20. data/test/data/break_tracelines.cmd +0 -9
  21. data/test/data/break_tracelines.right +0 -17
  22. data/test/data/breakpoints-basename.cmd +0 -2
  23. data/test/data/breakpoints-basename.right +0 -10
  24. data/test/data/breakpoints.cmd +0 -37
  25. data/test/data/breakpoints.right +0 -96
  26. data/test/data/brkpt-class-bug.cmd +0 -9
  27. data/test/data/brkpt-class-bug.right +0 -18
  28. data/test/data/catch.cmd +0 -18
  29. data/test/data/catch.right +0 -41
  30. data/test/data/condition.cmd +0 -29
  31. data/test/data/condition.right +0 -67
  32. data/test/data/continue_bad.cmd +0 -4
  33. data/test/data/continue_bad.right +0 -9
  34. data/test/data/ctrl.cmd +0 -23
  35. data/test/data/ctrl.right +0 -70
  36. data/test/data/display.cmd +0 -24
  37. data/test/data/display.right +0 -44
  38. data/test/data/dollar-0.right +0 -3
  39. data/test/data/dollar-0a.right +0 -3
  40. data/test/data/dollar-0b.right +0 -3
  41. data/test/data/edit.cmd +0 -12
  42. data/test/data/edit.right +0 -19
  43. data/test/data/emacs_basic.cmd +0 -10
  44. data/test/data/emacs_basic.right +0 -24
  45. data/test/data/enable.cmd +0 -20
  46. data/test/data/enable.right +0 -36
  47. data/test/data/except-bug1.cmd +0 -7
  48. data/test/data/except-bug1.right +0 -13
  49. data/test/data/file-with-space.cmd +0 -7
  50. data/test/data/file-with-space.right +0 -9
  51. data/test/data/finish.cmd +0 -16
  52. data/test/data/finish.right +0 -31
  53. data/test/data/frame.cmd +0 -29
  54. data/test/data/frame.right +0 -62
  55. data/test/data/help.cmd +0 -20
  56. data/test/data/help.right +0 -21
  57. data/test/data/history.right +0 -7
  58. data/test/data/info-file-break.cmd +0 -4
  59. data/test/data/info-file-break.right +0 -11
  60. data/test/data/info-thread.cmd +0 -13
  61. data/test/data/info-thread.right +0 -37
  62. data/test/data/info-var-bug2.cmd +0 -5
  63. data/test/data/info-var-bug2.right +0 -10
  64. data/test/data/info-var.cmd +0 -23
  65. data/test/data/info-var.right +0 -52
  66. data/test/data/info.cmd +0 -21
  67. data/test/data/info.right +0 -80
  68. data/test/data/linetrace-jruby.right +0 -23
  69. data/test/data/linetrace.cmd +0 -6
  70. data/test/data/linetrace.right +0 -32
  71. data/test/data/linetracep.cmd +0 -7
  72. data/test/data/linetracep.right +0 -25
  73. data/test/data/list.cmd +0 -19
  74. data/test/data/list.right +0 -127
  75. data/test/data/method.cmd +0 -10
  76. data/test/data/method.right +0 -21
  77. data/test/data/methodsig.cmd +0 -10
  78. data/test/data/methodsig.right +0 -20
  79. data/test/data/noquit.right +0 -1
  80. data/test/data/output.cmd +0 -6
  81. data/test/data/output.right +0 -31
  82. data/test/data/pm-bug.cmd +0 -7
  83. data/test/data/pm-bug.right +0 -12
  84. data/test/data/post-mortem-next.cmd +0 -8
  85. data/test/data/post-mortem-next.right +0 -14
  86. data/test/data/post-mortem-osx.right +0 -32
  87. data/test/data/post-mortem.cmd +0 -13
  88. data/test/data/post-mortem.right +0 -32
  89. data/test/data/quit.cmd +0 -6
  90. data/test/data/quit.right +0 -9
  91. data/test/data/raise-jruby.right +0 -26
  92. data/test/data/raise.cmd +0 -11
  93. data/test/data/raise.right +0 -26
  94. data/test/data/save.cmd +0 -34
  95. data/test/data/save.right +0 -61
  96. data/test/data/setshow.cmd +0 -46
  97. data/test/data/setshow.right +0 -80
  98. data/test/data/source.cmd +0 -5
  99. data/test/data/source.right +0 -15
  100. data/test/data/stepping.cmd +0 -21
  101. data/test/data/stepping.right +0 -50
  102. data/test/data/test-init-cygwin.right +0 -7
  103. data/test/data/test-init-osx.right +0 -4
  104. data/test/data/test-init.right +0 -5
  105. data/test/data/trace-jruby.right +0 -14
  106. data/test/data/trace.right +0 -23
  107. data/test/example/a/example.rb +0 -1
  108. data/test/example/at-exit.rb +0 -3
  109. data/test/example/b/example.rb +0 -1
  110. data/test/example/bp_loop_issue.rb +0 -3
  111. data/test/example/breakpoints-basename.rb +0 -2
  112. data/test/example/brkpt-class-bug.rb +0 -8
  113. data/test/example/classes.rb +0 -11
  114. data/test/example/dollar-0.rb +0 -6
  115. data/test/example/except-bug1.rb +0 -4
  116. data/test/example/file with space.rb +0 -1
  117. data/test/example/gcd.rb +0 -18
  118. data/test/example/info-var-bug.rb +0 -47
  119. data/test/example/info-var-bug2.rb +0 -2
  120. data/test/example/null.rb +0 -1
  121. data/test/example/output.rb +0 -2
  122. data/test/example/pm-bug.rb +0 -3
  123. data/test/example/pm.rb +0 -11
  124. data/test/example/raise.rb +0 -3
  125. data/test/gcd-dbg-nox.rb +0 -31
  126. data/test/gcd-dbg.rb +0 -30
  127. data/test/helper.rb +0 -167
  128. data/test/pm-base.rb +0 -22
  129. data/test/rdebug-save.1 +0 -7
  130. data/test/tdebug.rb +0 -252
  131. data/test/test-annotate.rb +0 -13
  132. data/test/test-at-exit.rb +0 -13
  133. data/test/test-break-bad.rb +0 -25
  134. data/test/test-breakpoints.rb +0 -24
  135. data/test/test-brkpt-class-bug.rb +0 -13
  136. data/test/test-catch.rb +0 -13
  137. data/test/test-condition.rb +0 -13
  138. data/test/test-ctrl.rb +0 -55
  139. data/test/test-display.rb +0 -14
  140. data/test/test-dollar-0.rb +0 -33
  141. data/test/test-edit.rb +0 -14
  142. data/test/test-emacs-basic.rb +0 -13
  143. data/test/test-enable.rb +0 -13
  144. data/test/test-except-bug1.rb +0 -16
  145. data/test/test-file-with-space.rb +0 -18
  146. data/test/test-finish.rb +0 -22
  147. data/test/test-frame.rb +0 -28
  148. data/test/test-help.rb +0 -60
  149. data/test/test-hist.rb +0 -64
  150. data/test/test-info-thread.rb +0 -24
  151. data/test/test-info-var.rb +0 -30
  152. data/test/test-info.rb +0 -27
  153. data/test/test-init.rb +0 -49
  154. data/test/test-list.rb +0 -14
  155. data/test/test-method.rb +0 -20
  156. data/test/test-output.rb +0 -13
  157. data/test/test-pm.rb +0 -37
  158. data/test/test-quit.rb +0 -13
  159. data/test/test-raise.rb +0 -13
  160. data/test/test-save.rb +0 -22
  161. data/test/test-setshow.rb +0 -13
  162. data/test/test-source.rb +0 -13
  163. data/test/test-stepping.rb +0 -14
  164. data/test/test-trace.rb +0 -40
  165. data/test/thread1.rb +0 -26
  166. data/test/trunc-call.rb +0 -31
data/test/base/base.rb DELETED
@@ -1,77 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../../helper", __FILE__)
3
-
4
- # Some tests of Debugger module in C extension ruby_debug
5
- class TestRubyDebug < Test::Unit::TestCase
6
- def test_version
7
- assert(defined?(Debugger::VERSION))
8
- end
9
-
10
- # test current_context
11
- def test_current_context
12
- assert_equal(false, Debugger.started?,
13
- 'debugger should not initially be started.')
14
- Debugger.start_
15
- assert(Debugger.started?,
16
- 'debugger should now be started.')
17
- assert_equal(__LINE__, Debugger.current_context.frame_line)
18
- assert_equal(nil, Debugger.current_context.frame_args_info,
19
- 'no frame args info.')
20
- assert_equal(Debugger.current_context.frame_file,
21
- Debugger.current_context.frame_file(0))
22
- assert_equal(File.basename(__FILE__),
23
- File.basename(Debugger.current_context.frame_file))
24
- assert_raises(ArgumentError) {Debugger.current_context.frame_file(1, 2)}
25
- assert_raises(ArgumentError) {Debugger.current_context.frame_file(10)}
26
- assert_equal(1, Debugger.current_context.stack_size)
27
- assert_equal(TestRubyDebug, Debugger.current_context.frame_class)
28
- assert_equal(false, Debugger.current_context.dead?, 'Not dead yet!')
29
- ensure
30
- Debugger.stop
31
- assert_equal(false, Debugger.started?,
32
- 'Debugger should no longer be started.')
33
- end
34
-
35
- # Test initial variables and setting/getting state.
36
- def test_debugger_base
37
- assert_equal(false, Debugger.started?,
38
- 'Debugger should not initially be started.')
39
- Debugger.start_
40
- assert(Debugger.started?,
41
- 'Debugger should now be started.')
42
- assert_equal(false, Debugger.debug,
43
- 'Debug variable should not be set.')
44
- assert_equal(false, Debugger.post_mortem?,
45
- 'Post mortem debugging should not be set.')
46
- a = Debugger.contexts
47
- assert_equal(1, a.size,
48
- 'There should only be one context.')
49
- assert_equal(Array, a.class,
50
- 'Context should be an array.')
51
- ensure
52
- Debugger.stop
53
- assert_equal(false, Debugger.started?,
54
- 'debugger should no longer be started.')
55
- end
56
-
57
- # Test breakpoint handling
58
- def test_breakpoints
59
- Debugger.start_
60
- assert_equal(0, Debugger.breakpoints.size,
61
- 'There should not be any breakpoints set.')
62
- brk = Debugger.add_breakpoint(__FILE__, 1)
63
- assert_equal(Debugger::Breakpoint, brk.class,
64
- 'Breakpoint should have been set and returned.')
65
- assert_equal(1, Debugger.breakpoints.size,
66
- 'There should now be one breakpoint set.')
67
- Debugger.remove_breakpoint(0)
68
- assert_equal(1, Debugger.breakpoints.size,
69
- 'There should still be one breakpoint set.')
70
- Debugger.remove_breakpoint(1)
71
- assert_equal(0, Debugger.breakpoints.size,
72
- 'There should no longer be any breakpoints set.')
73
- ensure
74
- Debugger.stop
75
- end
76
- end
77
-
data/test/base/binding.rb DELETED
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../../helper", __FILE__)
3
-
4
- # Test binding_n command
5
- class TestBinding < Test::Unit::TestCase
6
- def test_basic
7
- def inside_fn
8
- s = 'some other string'
9
- b2 = Kernel::binding_n(1)
10
- y2 = eval('s', b2)
11
- assert_equal('this is a test', y2)
12
- end
13
- s = 'this is a test'
14
- Debugger.start
15
- b = Kernel::binding_n(0)
16
- y = eval('s', b)
17
- assert_equal(s, y)
18
- inside_fn
19
- ensure
20
- Debugger.stop
21
- end
22
- end
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../../helper", __FILE__)
3
-
4
- # Test catchpoint in C ruby_debug extension.
5
-
6
- class TestRubyDebugCatchpoint < Test::Unit::TestCase
7
- def test_catchpoints
8
- assert_raise(RuntimeError) {Debugger.catchpoints}
9
- Debugger.start_
10
- assert_equal({}, Debugger.catchpoints)
11
- Debugger.add_catchpoint('ZeroDivisionError')
12
- assert_equal({'ZeroDivisionError' => 0}, Debugger.catchpoints)
13
- Debugger.add_catchpoint('RuntimeError')
14
- assert_equal(['RuntimeError', 'ZeroDivisionError'],
15
- Debugger.catchpoints.keys.sort)
16
- ensure
17
- Debugger.stop
18
- end
19
- end
data/test/base/load.rb DELETED
@@ -1,44 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../../helper", __FILE__)
3
-
4
- # Test of Debugger.debug_load in C extension ruby_debug.so
5
- class TestDebugLoad < Test::Unit::TestCase
6
- class << self
7
- def at_line(file, line)
8
- @@at_line = [File.basename(file), line]
9
- end
10
- end
11
-
12
- class Debugger::Context
13
- def at_line(file, line)
14
- TestDebugLoad::at_line(file, line)
15
- end
16
- end
17
-
18
- def test_debug_load
19
- src_dir = File.dirname(__FILE__)
20
- prog_script = File.join(src_dir, '..', 'example', 'gcd.rb')
21
-
22
- # Without stopping
23
- bt = Debugger.debug_load(prog_script, false)
24
- assert_equal(nil, bt)
25
- assert(Debugger.started?)
26
- Debugger.stop
27
-
28
- # With stopping
29
- bt = Debugger.debug_load(prog_script, true)
30
- assert_equal(nil, bt)
31
- assert_equal(['gcd.rb', 4], @@at_line)
32
- assert(Debugger.started?)
33
- Debugger.stop
34
-
35
- # Test that we get a proper backtrace on a script that raises 'abc'
36
- prog_script = File.join(src_dir, '..', 'example', 'raise.rb')
37
- bt = Debugger.debug_load(prog_script, false)
38
- assert_equal('abc', bt.to_s)
39
- assert(Debugger.started?)
40
- Debugger.stop
41
- ensure
42
- Debugger.stop if Debugger.started?
43
- end
44
- end
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../../helper", __FILE__)
3
-
4
- class TestReloadBug < Test::Unit::TestCase
5
- def test_reload_bug
6
- assert_equal({}, Debugger::source_reload)
7
- end
8
- end
@@ -1,24 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../../../helper", __FILE__)
3
-
4
- class TestCatchCommand < Test::Unit::TestCase
5
- class MockState
6
- attr_accessor :message
7
- def context; end
8
- def confirm(msg); true end
9
- def print(*args)
10
- @message = *args
11
- end
12
- end
13
-
14
- # regression test for bug #20156
15
- def test_catch_does_not_blow_up
16
- state = MockState.new
17
- catch_cmd = Debugger::CatchCommand.new(state)
18
- assert(catch_cmd.match('catch off'))
19
- catch(:debug_error) do
20
- catch_cmd.execute
21
- end
22
- assert_equal(nil, state.message)
23
- end
24
- end
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../../../../helper", __FILE__)
3
-
4
- class TestCommandREs < Test::Unit::TestCase
5
- include Debugger
6
-
7
- def test_quit
8
- c = QuitCommand.new(nil)
9
- assert c.regexp.match('quit')
10
- assert c.regexp.match('q')
11
- assert c.regexp.match('quit!')
12
- assert c.regexp.match('q!')
13
- assert c.regexp.match('quit unconditionally')
14
- assert c.regexp.match('exit')
15
- assert c.regexp.match('exit!')
16
- end
17
-
18
- def test_up
19
- c = UpCommand.new(nil)
20
- assert c.regexp.match('up')
21
- assert c.regexp.match('up 2')
22
- assert c.regexp.match('up 2+5')
23
- assert c.regexp.match('u')
24
- assert c.regexp.match('u 2')
25
- assert_equal nil, c.regexp.match('ufoo')
26
- end
27
-
28
- def test_down
29
- c = DownCommand.new(nil)
30
- assert c.regexp.match('down')
31
- assert c.regexp.match('down 2')
32
- assert_equal(nil, c.regexp.match('d 2'))
33
- assert_equal(nil, c.regexp.match('d'))
34
- assert_equal(nil, c.regexp.match('dow'))
35
- end
36
- end
data/test/config.yaml DELETED
@@ -1,8 +0,0 @@
1
- # Do not commit personal changes here back to the repository. Create
2
- # config.private.yaml which, if exists, is preferred to this one.
3
-
4
- # either should be on the $PATH or use full path
5
- ruby: ruby
6
-
7
- # possibility to specify interpreter parameters
8
- #ruby_params: -w
@@ -1,29 +0,0 @@
1
- # ********************************************************
2
- # This tests annotations
3
- # ********************************************************
4
- set debuggertesting on
5
- set callstyle last
6
- set different off
7
- set annotate 3
8
- # Get into gcd
9
- step 2
10
- # "break" should trigger break annotation
11
- break 10
12
- # "delete" should trigger break annotation
13
- delete 1
14
- # p should not trigger a breakpoint annotation
15
- p a
16
- # "up" should trigger annotations
17
- up
18
- # "b" should trigger like "break"
19
- b 12
20
- # "display" should trigger display annotation
21
- display 1+2
22
- # undisplay should trigger display annotation
23
- undisplay 1
24
- step+
25
- # Test error annotations
26
- up 10
27
- frame 100
28
- break bogus:5
29
- quit!
@@ -1,139 +0,0 @@
1
- gcd.rb:4
2
- def gcd(a, b)
3
- # # ********************************************************
4
- # # This tests annotations
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 different off
11
- different-line stepping is off.
12
- # set annotate 3
13
- Annotation level is 3
14
- # # Get into gcd
15
- # step 2
16
- starting
17
- stopped
18
- breakpoints
19
- No breakpoints.
20
- 
21
- stack
22
- --> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6
23
- #1 at line gcd.rb:18
24
- 
25
- variables
26
- a = 3
27
- b = 5
28
- self = main
29
- 
30
- source gcd.rb:6
31
- if a > b
32
- # # "break" should trigger break annotation
33
- # break 10
34
- Breakpoint 1 file gcd.rb, line 10
35
- breakpoints
36
- Num Enb What
37
- 1 y at gcd.rb:10
38
- 
39
- # # "delete" should trigger break annotation
40
- # delete 1
41
- breakpoints
42
- No breakpoints.
43
- 
44
- # # p should not trigger a breakpoint annotation
45
- # p a
46
- 3
47
- # # "up" should trigger annotations
48
- # up
49
- #1 at line gcd.rb:18
50
- stack
51
- #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:6
52
- --> #1 at line gcd.rb:18
53
- 
54
- variables
55
- self = main
56
- 
57
- # # "b" should trigger like "break"
58
- # b 12
59
- Breakpoint 2 file gcd.rb, line 12
60
- breakpoints
61
- Num Enb What
62
- 2 y at gcd.rb:12
63
- 
64
- # # "display" should trigger display annotation
65
- # display 1+2
66
- 1: 1+2 = 3
67
- display
68
- 1: 1+2 = 3
69
- 
70
- # # undisplay should trigger display annotation
71
- # undisplay 1
72
- display
73
- 
74
- # step+
75
- display
76
- 
77
- starting
78
- stopped
79
- breakpoints
80
- Num Enb What
81
- 2 y at gcd.rb:12
82
- 
83
- display
84
- 
85
- stack
86
- --> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:10
87
- #1 at line gcd.rb:18
88
- 
89
- variables
90
- a = 3
91
- b = 5
92
- self = main
93
- 
94
- source gcd.rb:10
95
- return nil if a <= 0
96
- # # Test error annotations
97
- # up 10
98
- error-begin
99
- Adjusting would put us beyond the oldest (initial) frame.
100
- 
101
- display
102
- 
103
- stack
104
- --> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:10
105
- #1 at line gcd.rb:18
106
- 
107
- variables
108
- a = 3
109
- b = 5
110
- self = main
111
- 
112
- # frame 100
113
- error-begin
114
- Adjusting would put us beyond the oldest (initial) frame.
115
- 
116
- display
117
- 
118
- stack
119
- --> #0 Object.gcd(a#Fixnum, b#Fixnum) at line gcd.rb:10
120
- #1 at line gcd.rb:18
121
- 
122
- variables
123
- a = 3
124
- b = 5
125
- self = main
126
- 
127
- # break bogus:5
128
- error-begin
129
- No source file named bogus
130
- 
131
- Breakpoint 3 file bogus, line 5
132
- breakpoints
133
- Num Enb What
134
- 2 y at gcd.rb:12
135
- 3 y at bogus:5
136
- 
137
- display
138
- 
139
- # quit!
@@ -1,4 +0,0 @@
1
- set debuggertesting on
2
- break 2
3
- c
4
- c
@@ -1,12 +0,0 @@
1
- at-exit.rb:1
2
- at_exit do
3
- # set debuggertesting on
4
- Currently testing the debugger is on.
5
- # break 2
6
- Breakpoint 1 file at-exit.rb, line 2
7
- # c
8
- Breakpoint 1 at at-exit.rb:2
9
- at-exit.rb:2
10
- puts "Hello world!"
11
- # c
12
- Hello world!
@@ -1,16 +0,0 @@
1
- # ********************************************************
2
- # This tests mostly invalid breakpoints.
3
- # We have some valid ones too.
4
- # ********************************************************
5
- set debuggertesting on
6
- set callstyle last
7
- set autoeval off
8
- set basename on
9
- # There aren't 100 lines in gcd.rb.
10
- break 100
11
- break example/gcd.rb:100
12
- # This line is okay
13
- break example/gcd.rb:4
14
- # No class Foo.
15
- break Foo.bar
16
- q