ruby-debug 0.10.5.rc1 → 0.10.5.rc2

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,24 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test simple thread commands
5
- class TestInfoThread < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname='info-thread'
10
- filter = Proc.new{|got_lines, correct_lines|
11
- [got_lines, correct_lines].each do |a|
12
- a.each do |s|
13
- s.gsub!(/Thread:0x[0-9a-f]+/, 'Thread:0x12345678')
14
- end
15
- end
16
- got_lines.each do |s|
17
- s.gsub!(/run>[ \t]+.*gcd.rb:4/, "run> gcd.rb:4")
18
- end
19
- }
20
- script = File.join('data', testname + '.cmd')
21
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5",
22
- :filter => filter))
23
- end
24
- end
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test info variables command
5
- class TestInfoVar < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_info_variables
9
- filter = Proc.new{|got_lines, correct_lines|
10
- [got_lines[13-1], correct_lines[13-1]].each do |s|
11
- s.sub!(/Mine:0x[0-9,a-f]+/, 'Mine:')
12
- end
13
- [got_lines, correct_lines].each do |a|
14
- a.each do |s|
15
- s.sub!(/Lousy_inspect:0x[0-9,a-f]+/, 'Lousy_inspect:')
16
- s.sub!(/UnsuspectingClass:0x[0-9,a-f]+/, 'UnsuspectingClass:')
17
- end
18
- end
19
- }
20
-
21
- testname='info-var'
22
- script = File.join('data', testname + '.cmd')
23
- assert(run_debugger(testname, "--script #{script} -- ./example/info-var-bug.rb",
24
- :filter => filter))
25
-
26
- testname='info-var-bug2'
27
- script = File.join('data', testname + '.cmd')
28
- assert(run_debugger(testname, "--script #{script} -- ./example/info-var-bug2.rb"))
29
- end
30
- end
data/test/test-info.rb DELETED
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test info commands
5
- class TestInfo < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- # Test commands in info.rb
9
- def test_basic
10
- testname='info'
11
- filter = Proc.new{|got_lines, correct_lines|
12
- got_lines.each do |s|
13
- s.gsub!(/Line 4 of ".*gcd.rb"/, 'Line 4 of "gcd.rb"')
14
- end
15
- }
16
-
17
- script = File.join('data', testname + '.cmd')
18
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5",
19
- :filter => filter))
20
- end
21
-
22
- def test_file_break
23
- testname='info-file-break'
24
- script = File.join('data', testname + '.cmd')
25
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
26
- end unless defined?(JRUBY_VERSION) # JRuby doesn't yet support tracelines
27
- end
data/test/test-init.rb DELETED
@@ -1,49 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'test/unit'
3
- require 'rbconfig'
4
-
5
- ROOT_DIR=File.dirname(__FILE__)
6
- require File.join(ROOT_DIR, 'helper.rb')
7
-
8
- # begin require 'rubygems' rescue LoadError end
9
- # require 'ruby-debug'; Debugger.start
10
-
11
- # Test Debugger.init and setting up ruby-debug variables
12
- class TestDebuggerInit < Test::Unit::TestCase
13
- @@SRC_DIR = File.dirname(__FILE__) unless
14
- defined?(@@SRC_DIR)
15
- def test_basic
16
- unless File.exist?(File.join(ROOT_DIR, 'ext'))
17
- puts "Skipping test #{__FILE__}"
18
- return
19
- end
20
- debugger_output = 'test-init.out'
21
- Dir.chdir(@@SRC_DIR) do
22
- old_emacs = ENV['EMACS']
23
- old_columns = ENV['COLUMNS']
24
- ENV['EMACS'] = nil
25
- ENV['COLUMNS'] = '120'
26
- ruby = "#{TestHelper.load_ruby} #{TestHelper.load_params}"
27
- IO.popen("#{ruby} ./gcd-dbg.rb 5 >#{debugger_output}", 'w') do |pipe|
28
- pipe.puts 'p Debugger::PROG_SCRIPT'
29
- pipe.puts 'show args'
30
- pipe.puts 'quit unconditionally'
31
- end
32
- lines = File.open(debugger_output).readlines
33
- ENV['EMACS'] = old_emacs
34
- ENV['COLUMNS'] = old_columns
35
-
36
- right_file = case Config::CONFIG['host_os']
37
- when /^darwin/
38
- 'test-init-osx.right'
39
- when /^cygwin/
40
- 'test-init-cygwin.right'
41
- else
42
- 'test-init.right'
43
- end
44
- expected = File.open(File.join('data', right_file)).readlines
45
- assert_equal(expected, lines)
46
- File.delete(debugger_output) if expected == lines
47
- end
48
- end
49
- end
data/test/test-list.rb DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test List commands
5
- class TestList < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- # Test commands in list.rb
9
- def test_basic
10
- testname='list'
11
- script = File.join('data', testname + '.cmd')
12
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
13
- end
14
- end
data/test/test-method.rb DELETED
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- class TestMethod < Test::Unit::TestCase
5
- include TestHelper
6
-
7
- def test_basic
8
- testname='method'
9
- script = File.join('data', testname + '.cmd')
10
- assert(run_debugger(testname, "--script #{script} -- ./example/classes.rb"))
11
- begin
12
- require 'methodsig'
13
- testname='methodsig'
14
- script = File.join('data', testname + '.cmd')
15
- assert(run_debugger(testname, "--script #{script} -- ./example/classes.rb"))
16
- rescue LoadError
17
- puts "Skipping method sig test"
18
- end
19
- end
20
- end
data/test/test-output.rb DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test 'starting' annotation.
5
- class TestStartingAnnotate < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname='output'
10
- script = File.join('data', testname + '.cmd')
11
- assert(run_debugger(testname, "-A 3 --script #{script} -- ./example/output.rb"))
12
- end
13
- end
data/test/test-pm.rb DELETED
@@ -1,37 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test Post-mortem command
5
- class TestPM < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- # Test post-mortem handling
9
- def test_basic
10
- # filter = Proc.new{|got_lines, correct_lines|
11
- # [got_lines[0], correct_lines[0]].each do |s|
12
- # s.sub!(/tdebug.rb:\d+/, 'rdebug:999')
13
- # end
14
- # }
15
- ENV['COLUMNS'] = '80'
16
- testname='post-mortem'
17
- script = File.join('data', testname + '.cmd')
18
- testname += '-osx' if Config::CONFIG['host_os'] =~ /^darwin/
19
- assert(run_debugger(testname, "--script #{script} --post-mortem ./example/pm.rb"))
20
- end
21
-
22
- # Test post-mortem handling
23
- def test_pm_next
24
- ENV['COLUMNS'] = '80'
25
- testname='post-mortem-next'
26
- script = File.join('data', testname + '.cmd')
27
- assert(run_debugger(testname, "--script #{script} --post-mortem ./example/pm.rb"))
28
- end
29
-
30
- # Test Tracker #22118 post-mortem giving an error in show internal variables
31
- def test_pm_iv_bug
32
- ENV['COLUMNS'] = '80'
33
- testname='pm-bug'
34
- script = File.join('data', testname + '.cmd')
35
- assert(run_debugger(testname, "--script #{script} --post-mortem example/pm-bug.rb"))
36
- end
37
- end unless defined?(JRUBY_VERSION) # post-mortem not yet supported on JRuby
data/test/test-quit.rb DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test Quit command
5
- class TestQuit < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname='quit'
10
- script = File.join('data', testname + '.cmd')
11
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb"))
12
- end
13
- end
data/test/test-raise.rb DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test Debugger.load handles uncaught exceptions in the debugged program.
5
- class TestRaise < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname='raise'
10
- script = File.join('data', testname + '.cmd')
11
- assert(run_debugger(testname, "--script #{script} -- ./example/raise.rb"))
12
- end
13
- end
data/test/test-save.rb DELETED
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- class TestSave < Test::Unit::TestCase
5
- include TestHelper
6
-
7
- # Test initial variables and setting/getting state.
8
- def test_basic
9
- testname='save'
10
- filter = Proc.new{|got_lines, correct_lines|
11
- got_lines.each do |s|
12
- s.gsub!(/(\d+) file .*gcd.rb/, '\1 file gcd.rb')
13
- end
14
- got_lines.each do |s|
15
- s.gsub!(/break .*gcd.rb:10/, "break gcd.rb:10")
16
- end
17
- }
18
- script = File.join('data', testname + '.cmd')
19
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5",
20
- :filter => filter))
21
- end
22
- end
data/test/test-setshow.rb DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- class TestSetShow < Test::Unit::TestCase
5
- include TestHelper
6
-
7
- # Test initial variables and setting/getting state.
8
- def test_basic
9
- testname='setshow'
10
- script = File.join('data', testname + '.cmd')
11
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
12
- end
13
- end
data/test/test-source.rb DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test 'source' command handling.
5
- class TestSource < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- def test_basic
9
- testname='source'
10
- script = File.join('data', testname + '.cmd')
11
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
12
- end
13
- end
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- # Test that linetracing does something.
5
- class TestStepping < Test::Unit::TestCase
6
- include TestHelper
7
-
8
- # Test commands in stepping.rb
9
- def test_basic
10
- testname='stepping'
11
- script = File.join('data', testname + '.cmd')
12
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
13
- end
14
- end
data/test/test-trace.rb DELETED
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path("../helper", __FILE__)
3
-
4
- class TestTrace < Test::Unit::TestCase
5
- include TestHelper
6
-
7
- def test_trace_option
8
- filter = Proc.new{|got_lines, correct_lines|
9
- got_lines.collect!{|l| l =~ /gcd\.rb:/? l : nil}.compact!
10
- got_lines.each do |s|
11
- s.gsub!(/:.*gcd.rb:/, ':gcd.rb:')
12
- end
13
- }
14
-
15
- assert(run_debugger("trace", "-nx --trace ./example/gcd.rb 3 5",
16
- :filter => filter))
17
- end
18
-
19
- def test_linetrace_command
20
- filter = Proc.new{|got_lines, correct_lines|
21
- got_lines.reject! {|l| l =~ /:(rdbg|linecache)\.rb:/ }
22
- }
23
-
24
- testname = 'linetrace'
25
- script = File.join('data', testname + '.cmd')
26
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5",
27
- :filter => filter))
28
- end
29
-
30
- def test_linetrace_plus_command
31
- filter = Proc.new{|got_lines, correct_lines|
32
- got_lines.reject! {|l| l =~ /:(rdbg|linecache)\.rb:/ }
33
- }
34
-
35
- testname = 'linetracep'
36
- script = File.join('data', testname + '.cmd')
37
- assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5",
38
- :filter => filter))
39
- end
40
- end
data/test/thread1.rb DELETED
@@ -1,26 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # Adapted from Programming Ruby 2nd Ed. p. 138
3
- require 'rubygems'
4
-
5
- unless defined?(Debugger)
6
- puts "This program has to be called from the debugger"
7
- exit 1
8
- end
9
-
10
- def fn(count, i)
11
- sleep(rand(0.1))
12
- if 4 == i
13
- debugger
14
- end
15
- Thread.current['mycount'] = count
16
- end
17
-
18
- count = 0
19
- threads = []
20
- 5.times do |i|
21
- threads[i] = Thread.new do
22
- fn(count, i)
23
- count += 1
24
- end
25
- end
26
- threads.each {|t| t.join }
data/test/trunc-call.rb DELETED
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This program is used to test that 'restart' works when we didn't call
3
- # the debugger initially.
4
-
5
- TOP_SRC_DIR = File.join(File.expand_path(File.dirname(__FILE__), "..")) unless
6
- defined?(TOP_SRC_DIR)
7
-
8
- $:.unshift File.join(TOP_SRC_DIR, "ext")
9
- $:.unshift File.join(TOP_SRC_DIR, "lib")
10
- $:.unshift File.join(TOP_SRC_DIR, "cli")
11
- require 'ruby-debug'
12
-
13
- # GCD. We assume positive numbers
14
- def gcd(a, b)
15
- # Make: a <= b
16
- if a > b
17
- a, b = [b, a]
18
- end
19
- if a==3
20
- Debugger.debugger
21
- end
22
-
23
- return nil if a <= 0
24
-
25
- if a == 1 or b-a == 0
26
- return a
27
- end
28
- return gcd(b-a, a)
29
- end
30
-
31
- gcd(13,8)