debugger 1.0.0.rc1
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/AUTHORS +10 -0
- data/CHANGES +334 -0
- data/ChangeLog +5655 -0
- data/INSTALL.SVN +154 -0
- data/LICENSE +23 -0
- data/Makefile.am +14 -0
- data/OLD_README +122 -0
- data/README.md +10 -0
- data/Rakefile +266 -0
- data/autogen.sh +4 -0
- data/bin/rdebug +398 -0
- data/cli/ruby-debug.rb +173 -0
- data/cli/ruby-debug/command.rb +228 -0
- data/cli/ruby-debug/commands/breakpoints.rb +153 -0
- data/cli/ruby-debug/commands/catchpoint.rb +55 -0
- data/cli/ruby-debug/commands/condition.rb +49 -0
- data/cli/ruby-debug/commands/continue.rb +38 -0
- data/cli/ruby-debug/commands/control.rb +107 -0
- data/cli/ruby-debug/commands/display.rb +120 -0
- data/cli/ruby-debug/commands/edit.rb +48 -0
- data/cli/ruby-debug/commands/enable.rb +202 -0
- data/cli/ruby-debug/commands/eval.rb +176 -0
- data/cli/ruby-debug/commands/finish.rb +42 -0
- data/cli/ruby-debug/commands/frame.rb +301 -0
- data/cli/ruby-debug/commands/help.rb +56 -0
- data/cli/ruby-debug/commands/info.rb +467 -0
- data/cli/ruby-debug/commands/irb.rb +123 -0
- data/cli/ruby-debug/commands/jump.rb +66 -0
- data/cli/ruby-debug/commands/kill.rb +51 -0
- data/cli/ruby-debug/commands/list.rb +94 -0
- data/cli/ruby-debug/commands/method.rb +84 -0
- data/cli/ruby-debug/commands/quit.rb +39 -0
- data/cli/ruby-debug/commands/reload.rb +40 -0
- data/cli/ruby-debug/commands/save.rb +90 -0
- data/cli/ruby-debug/commands/set.rb +221 -0
- data/cli/ruby-debug/commands/show.rb +247 -0
- data/cli/ruby-debug/commands/skip.rb +35 -0
- data/cli/ruby-debug/commands/source.rb +36 -0
- data/cli/ruby-debug/commands/stepping.rb +81 -0
- data/cli/ruby-debug/commands/threads.rb +189 -0
- data/cli/ruby-debug/commands/tmate.rb +36 -0
- data/cli/ruby-debug/commands/trace.rb +57 -0
- data/cli/ruby-debug/commands/variables.rb +199 -0
- data/cli/ruby-debug/debugger.rb +5 -0
- data/cli/ruby-debug/helper.rb +69 -0
- data/cli/ruby-debug/interface.rb +232 -0
- data/cli/ruby-debug/processor.rb +474 -0
- data/configure.ac +12 -0
- data/debugger.gemspec +24 -0
- data/doc/.cvsignore +42 -0
- data/doc/Makefile.am +63 -0
- data/doc/emacs-notes.txt +38 -0
- data/doc/hanoi.rb +35 -0
- data/doc/primes.rb +28 -0
- data/doc/rdebug-emacs.texi +1030 -0
- data/doc/rdebug.1 +241 -0
- data/doc/ruby-debug.texi +3791 -0
- data/doc/test-tri2.rb +18 -0
- data/doc/tri3.rb +8 -0
- data/doc/triangle.rb +12 -0
- data/emacs/Makefile.am +130 -0
- data/emacs/rdebug-annotate.el +385 -0
- data/emacs/rdebug-breaks.el +407 -0
- data/emacs/rdebug-cmd.el +92 -0
- data/emacs/rdebug-core.el +502 -0
- data/emacs/rdebug-dbg.el +62 -0
- data/emacs/rdebug-error.el +79 -0
- data/emacs/rdebug-fns.el +111 -0
- data/emacs/rdebug-frames.el +230 -0
- data/emacs/rdebug-gud.el +242 -0
- data/emacs/rdebug-help.el +104 -0
- data/emacs/rdebug-info.el +83 -0
- data/emacs/rdebug-layouts.el +180 -0
- data/emacs/rdebug-locring.el +118 -0
- data/emacs/rdebug-output.el +106 -0
- data/emacs/rdebug-regexp.el +118 -0
- data/emacs/rdebug-secondary.el +260 -0
- data/emacs/rdebug-shortkey.el +175 -0
- data/emacs/rdebug-source.el +568 -0
- data/emacs/rdebug-track.el +392 -0
- data/emacs/rdebug-varbuf.el +150 -0
- data/emacs/rdebug-vars.el +125 -0
- data/emacs/rdebug-watch.el +132 -0
- data/emacs/rdebug.el +326 -0
- data/emacs/test/elk-test.el +242 -0
- data/emacs/test/test-annotate.el +103 -0
- data/emacs/test/test-cmd.el +116 -0
- data/emacs/test/test-core.el +104 -0
- data/emacs/test/test-fns.el +65 -0
- data/emacs/test/test-frames.el +62 -0
- data/emacs/test/test-gud.el +35 -0
- data/emacs/test/test-indent.el +58 -0
- data/emacs/test/test-regexp.el +144 -0
- data/emacs/test/test-shortkey.el +61 -0
- data/ext/ruby_debug/breakpoint.c +586 -0
- data/ext/ruby_debug/extconf.rb +49 -0
- data/ext/ruby_debug/ruby_debug.c +2624 -0
- data/ext/ruby_debug/ruby_debug.h +148 -0
- data/lib/ChangeLog +1065 -0
- data/lib/debugger.rb +7 -0
- data/lib/debugger/version.rb +3 -0
- data/lib/ruby-debug-base.rb +304 -0
- data/rdbg.rb +33 -0
- data/runner.sh +7 -0
- data/svn2cl_usermap +3 -0
- data/test/.cvsignore +1 -0
- data/test/base/base.rb +74 -0
- data/test/base/binding.rb +31 -0
- data/test/base/catchpoint.rb +26 -0
- data/test/base/load.rb +40 -0
- data/test/bp_loop_issue.rb +3 -0
- data/test/classes.rb +11 -0
- data/test/cli/commands/catchpoint_test.rb +36 -0
- data/test/cli/commands/unit/regexp.rb +42 -0
- data/test/config.yaml +8 -0
- data/test/data/annotate.cmd +29 -0
- data/test/data/annotate.right +139 -0
- data/test/data/break_bad.cmd +18 -0
- data/test/data/break_bad.right +28 -0
- data/test/data/break_loop_bug.cmd +5 -0
- data/test/data/break_loop_bug.right +15 -0
- data/test/data/breakpoints.cmd +38 -0
- data/test/data/breakpoints.right +98 -0
- data/test/data/catch.cmd +20 -0
- data/test/data/catch.right +49 -0
- data/test/data/catch2.cmd +19 -0
- data/test/data/catch2.right +65 -0
- data/test/data/catch3.cmd +11 -0
- data/test/data/catch3.right +37 -0
- data/test/data/condition.cmd +28 -0
- data/test/data/condition.right +65 -0
- data/test/data/ctrl.cmd +23 -0
- data/test/data/ctrl.right +70 -0
- data/test/data/display.cmd +24 -0
- data/test/data/display.right +44 -0
- data/test/data/dollar-0.right +2 -0
- data/test/data/dollar-0a.right +2 -0
- data/test/data/dollar-0b.right +2 -0
- data/test/data/edit.cmd +12 -0
- data/test/data/edit.right +19 -0
- data/test/data/emacs_basic.cmd +43 -0
- data/test/data/emacs_basic.right +106 -0
- data/test/data/enable.cmd +20 -0
- data/test/data/enable.right +36 -0
- data/test/data/finish.cmd +16 -0
- data/test/data/finish.right +31 -0
- data/test/data/frame.cmd +26 -0
- data/test/data/frame.right +55 -0
- data/test/data/help.cmd +20 -0
- data/test/data/help.right +21 -0
- data/test/data/history.right +7 -0
- data/test/data/info-thread.cmd +13 -0
- data/test/data/info-thread.right +37 -0
- data/test/data/info-var-bug2.cmd +5 -0
- data/test/data/info-var-bug2.right +10 -0
- data/test/data/info-var.cmd +23 -0
- data/test/data/info-var.right +52 -0
- data/test/data/info.cmd +21 -0
- data/test/data/info.right +65 -0
- data/test/data/jump.cmd +16 -0
- data/test/data/jump.right +56 -0
- data/test/data/jump2.cmd +16 -0
- data/test/data/jump2.right +44 -0
- data/test/data/linetrace.cmd +6 -0
- data/test/data/linetrace.right +23 -0
- data/test/data/list.cmd +19 -0
- data/test/data/list.right +127 -0
- data/test/data/method.cmd +10 -0
- data/test/data/method.right +21 -0
- data/test/data/methodsig.cmd +10 -0
- data/test/data/methodsig.right +20 -0
- data/test/data/next.cmd +22 -0
- data/test/data/next.right +61 -0
- data/test/data/noquit.right +1 -0
- data/test/data/output.cmd +6 -0
- data/test/data/output.right +31 -0
- data/test/data/pm-bug.cmd +7 -0
- data/test/data/pm-bug.right +12 -0
- data/test/data/post-mortem-next.cmd +8 -0
- data/test/data/post-mortem-next.right +14 -0
- data/test/data/post-mortem-osx.right +31 -0
- data/test/data/post-mortem.cmd +13 -0
- data/test/data/post-mortem.right +32 -0
- data/test/data/quit.cmd +6 -0
- data/test/data/quit.right +0 -0
- data/test/data/raise.cmd +11 -0
- data/test/data/raise.right +23 -0
- data/test/data/save.cmd +34 -0
- data/test/data/save.right +59 -0
- data/test/data/scope-var.cmd +42 -0
- data/test/data/scope-var.right +587 -0
- data/test/data/setshow.cmd +56 -0
- data/test/data/setshow.right +98 -0
- data/test/data/source.cmd +5 -0
- data/test/data/source.right +15 -0
- data/test/data/stepping.cmd +21 -0
- data/test/data/stepping.right +50 -0
- data/test/data/test-init-cygwin.right +7 -0
- data/test/data/test-init-osx.right +4 -0
- data/test/data/test-init.right +5 -0
- data/test/data/trace.right +14 -0
- data/test/dollar-0.rb +5 -0
- data/test/gcd-dbg-nox.rb +31 -0
- data/test/gcd-dbg.rb +30 -0
- data/test/gcd.rb +18 -0
- data/test/helper.rb +144 -0
- data/test/info-var-bug.rb +47 -0
- data/test/info-var-bug2.rb +2 -0
- data/test/jump.rb +14 -0
- data/test/jump2.rb +27 -0
- data/test/next.rb +18 -0
- data/test/null.rb +1 -0
- data/test/output.rb +2 -0
- data/test/pm-base.rb +22 -0
- data/test/pm-bug.rb +3 -0
- data/test/pm-catch.rb +12 -0
- data/test/pm-catch2.rb +27 -0
- data/test/pm-catch3.rb +47 -0
- data/test/pm.rb +11 -0
- data/test/raise.rb +3 -0
- data/test/rdebug-save.1 +7 -0
- data/test/runall +12 -0
- data/test/scope-var.rb +29 -0
- data/test/tdebug.rb +248 -0
- data/test/test-annotate.rb +25 -0
- data/test/test-break-bad.rb +37 -0
- data/test/test-breakpoints.rb +25 -0
- data/test/test-catch.rb +25 -0
- data/test/test-catch2.rb +25 -0
- data/test/test-catch3.rb +25 -0
- data/test/test-condition.rb +25 -0
- data/test/test-ctrl.rb +55 -0
- data/test/test-display.rb +26 -0
- data/test/test-dollar-0.rb +40 -0
- data/test/test-edit.rb +26 -0
- data/test/test-emacs-basic.rb +26 -0
- data/test/test-enable.rb +25 -0
- data/test/test-finish.rb +34 -0
- data/test/test-frame.rb +34 -0
- data/test/test-help.rb +60 -0
- data/test/test-hist.rb +68 -0
- data/test/test-info-thread.rb +32 -0
- data/test/test-info-var.rb +47 -0
- data/test/test-info.rb +26 -0
- data/test/test-init.rb +44 -0
- data/test/test-jump.rb +35 -0
- data/test/test-list.rb +25 -0
- data/test/test-method.rb +34 -0
- data/test/test-next.rb +25 -0
- data/test/test-output.rb +26 -0
- data/test/test-quit.rb +30 -0
- data/test/test-raise.rb +25 -0
- data/test/test-save.rb +31 -0
- data/test/test-scope-var.rb +25 -0
- data/test/test-setshow.rb +25 -0
- data/test/test-source.rb +25 -0
- data/test/test-stepping.rb +26 -0
- data/test/test-trace.rb +47 -0
- data/test/thread1.rb +26 -0
- data/test/trunc-call.rb +31 -0
- metadata +364 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
# begin require 'rubygems' rescue LoadError end
|
6
|
+
# require 'ruby-debug'; Debugger.start
|
7
|
+
|
8
|
+
# Test annotate handling.
|
9
|
+
class TestAnnotate < Test::Unit::TestCase
|
10
|
+
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
def test_basic
|
17
|
+
testname='annotate'
|
18
|
+
Dir.chdir(@@SRC_DIR) do
|
19
|
+
script = File.join('data', testname + '.cmd')
|
20
|
+
assert_equal(true,
|
21
|
+
run_debugger(testname,
|
22
|
+
"--script #{script} -- ./gcd.rb 3 5"))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# begin require 'rubygems' rescue LoadError end
|
5
|
+
# require 'ruby-debug'; Debugger.start
|
6
|
+
|
7
|
+
# Test (mostly) invalid breakpoint commands
|
8
|
+
class TestBadBreak < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
def test_basic
|
17
|
+
testname='break_bad'
|
18
|
+
Dir.chdir(@@SRC_DIR) do
|
19
|
+
script = File.join('data', testname + '.cmd')
|
20
|
+
assert_equal(true,
|
21
|
+
run_debugger(testname,
|
22
|
+
"--script #{script} -- ./gcd.rb 3 5"))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_break_loop
|
27
|
+
testname='break_loop_bug'
|
28
|
+
Dir.chdir(@@SRC_DIR) do
|
29
|
+
script = File.join('data', testname + '.cmd')
|
30
|
+
# FIXME: Issue #1
|
31
|
+
# assert_equal(true,
|
32
|
+
# run_debugger(testname,
|
33
|
+
# "--script #{script} -- ./bp_loop_issue.rb"))
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# begin require 'rubygems' rescue LoadError end
|
5
|
+
# require 'ruby-debug'; Debugger.start
|
6
|
+
|
7
|
+
# Test breakpoint commands
|
8
|
+
class TestBreakpoints < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
def test_basic
|
17
|
+
testname='breakpoints'
|
18
|
+
Dir.chdir(@@SRC_DIR) do
|
19
|
+
script = File.join('data', testname + '.cmd')
|
20
|
+
assert_equal(true,
|
21
|
+
run_debugger(testname,
|
22
|
+
"--script #{script} -- ./gcd.rb 3 5"))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/test/test-catch.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# begin require 'rubygems' rescue LoadError end
|
5
|
+
# require 'ruby-debug'; Debugger.start
|
6
|
+
|
7
|
+
# Test exception catching
|
8
|
+
class TestExceptionCatch < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
def test_basic
|
17
|
+
testname='catch'
|
18
|
+
Dir.chdir(@@SRC_DIR) do
|
19
|
+
script = File.join('data', testname + '.cmd')
|
20
|
+
assert_equal(true,
|
21
|
+
run_debugger(testname,
|
22
|
+
"--script #{script} -- ./pm-catch.rb"))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/test/test-catch2.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# begin require 'rubygems' rescue LoadError end
|
5
|
+
# require 'ruby-debug'; Debugger.start
|
6
|
+
|
7
|
+
# Test exception catching
|
8
|
+
class TestExceptionCatch2 < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
def test_basic
|
17
|
+
testname='catch2'
|
18
|
+
Dir.chdir(@@SRC_DIR) do
|
19
|
+
script = File.join('data', testname + '.cmd')
|
20
|
+
assert_equal(true,
|
21
|
+
run_debugger(testname,
|
22
|
+
"--script #{script} -- ./pm-catch2.rb"))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/test/test-catch3.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# begin require 'rubygems' rescue LoadError end
|
5
|
+
# require 'ruby-debug'; Debugger.start
|
6
|
+
|
7
|
+
# Test exception catching
|
8
|
+
class TestExceptionCatch3 < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
def test_basic
|
17
|
+
testname='catch3'
|
18
|
+
Dir.chdir(@@SRC_DIR) do
|
19
|
+
script = File.join('data', testname + '.cmd')
|
20
|
+
assert_equal(true,
|
21
|
+
run_debugger(testname,
|
22
|
+
"--script #{script} -- ./pm-catch3.rb"))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# begin require 'rubygems' rescue LoadError end
|
5
|
+
# require 'ruby-debug'; Debugger.start
|
6
|
+
|
7
|
+
# Test condition command
|
8
|
+
class TestConditionCommand < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
def test_basic
|
17
|
+
testname='condition'
|
18
|
+
Dir.chdir(@@SRC_DIR) do
|
19
|
+
script = File.join('data', testname + '.cmd')
|
20
|
+
assert_equal(true,
|
21
|
+
run_debugger(testname,
|
22
|
+
"--script #{script} -- ./gcd.rb 3 5"))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/test/test-ctrl.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# begin require 'rubygems' rescue LoadError end
|
4
|
+
# require 'ruby-debug' ; Debugger.start
|
5
|
+
|
6
|
+
require 'test/unit'
|
7
|
+
SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
8
|
+
defined?(SRC_DIR)
|
9
|
+
%w(ext lib cli).each do |dir|
|
10
|
+
$: << File.join(SRC_DIR, '..', dir)
|
11
|
+
end
|
12
|
+
require 'ruby_debug'
|
13
|
+
require File.join(SRC_DIR, '..', 'cli', 'ruby-debug')
|
14
|
+
|
15
|
+
# Test Local Control Interface
|
16
|
+
class TestCtrl < Test::Unit::TestCase
|
17
|
+
|
18
|
+
def cheap_diff(got_lines, correct_lines, outfile)
|
19
|
+
if correct_lines.size != got_lines.size
|
20
|
+
puts "Size difference #{correct_lines.size} vs. #{got_lines.size}"
|
21
|
+
File.open(outfile, 'w') {|f| f.puts got_lines}
|
22
|
+
return false
|
23
|
+
end
|
24
|
+
correct_lines.each_with_index do |line, i|
|
25
|
+
correct_lines[i].chomp!
|
26
|
+
if got_lines[i] != correct_lines[i]
|
27
|
+
puts "difference found at line #{i+1}"
|
28
|
+
puts "got : #{got_lines[i]}"
|
29
|
+
puts "need: #{correct_lines[i]}"
|
30
|
+
File.open(outfile, 'w') {|f| f.puts got_lines}
|
31
|
+
return false
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
require 'stringio'
|
37
|
+
|
38
|
+
# Test initial variables and setting/getting state.
|
39
|
+
def test_ctrl
|
40
|
+
ENV['COLUMNS'] = '80'
|
41
|
+
ENV['EMACS'] = nil
|
42
|
+
testbase = 'ctrl'
|
43
|
+
out = StringIO.new('', 'w')
|
44
|
+
Dir.chdir(SRC_DIR) do
|
45
|
+
script = File.join('data', "#{testbase}.cmd")
|
46
|
+
interface = Debugger::ScriptInterface.new(script, out)
|
47
|
+
processor = Debugger::ControlCommandProcessor.new(interface)
|
48
|
+
processor.process_commands
|
49
|
+
got_lines = out.string.split("\n")
|
50
|
+
right_file = File.join('data', "#{testbase}.right")
|
51
|
+
correct_lines = File.readlines(right_file)
|
52
|
+
assert cheap_diff(got_lines, correct_lines, "#{testbase}.out")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# begin require 'rubygems' rescue LoadError end
|
5
|
+
# require 'ruby-debug'; Debugger.start
|
6
|
+
|
7
|
+
# Test Display commands
|
8
|
+
class TestDisplay < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
# Test commands in display.rb
|
17
|
+
def test_basic
|
18
|
+
testname='display'
|
19
|
+
Dir.chdir(@@SRC_DIR) do
|
20
|
+
script = File.join('data', testname + '.cmd')
|
21
|
+
assert_equal(true,
|
22
|
+
run_debugger(testname,
|
23
|
+
"--script #{script} -- ./gcd.rb 3 5"))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# begin require 'rubygems' rescue LoadError end
|
5
|
+
# require 'ruby-debug'; Debugger.start
|
6
|
+
|
7
|
+
# Test --no-stop and $0 setting.
|
8
|
+
class TestDollar0 < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
def test_basic
|
17
|
+
testname='breakpoints'
|
18
|
+
Dir.chdir(@@SRC_DIR) do
|
19
|
+
home_save = ENV['HOME']
|
20
|
+
ENV['HOME'] = '.'
|
21
|
+
filter = Proc.new{|got_lines, correct_lines|
|
22
|
+
[got_lines, correct_lines].flatten.each do |s|
|
23
|
+
s.gsub!(/.*dollar-0.rb$/, 'dollar-0.rb')
|
24
|
+
end
|
25
|
+
}
|
26
|
+
|
27
|
+
assert_equal(true,
|
28
|
+
run_debugger('dollar-0',
|
29
|
+
'-nx --no-stop ./dollar-0.rb',
|
30
|
+
nil, filter, false, '../bin/rdebug'))
|
31
|
+
# Ruby's __FILE__ seems to prepend ./ when no directory was added.
|
32
|
+
assert_equal(true,
|
33
|
+
run_debugger('dollar-0b',
|
34
|
+
'-nx --no-stop ' +
|
35
|
+
File.join('..', 'test', 'dollar-0.rb'),
|
36
|
+
nil, filter, false, '../bin/rdebug'))
|
37
|
+
ENV['HOME'] = home_save
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/test/test-edit.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# begin require 'rubygems' rescue LoadError end
|
5
|
+
# require 'ruby-debug'; Debugger.start
|
6
|
+
|
7
|
+
# Test 'edit' command handling.
|
8
|
+
class TestEdit < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
def test_basic
|
17
|
+
testname='edit'
|
18
|
+
Dir.chdir(@@SRC_DIR) do
|
19
|
+
script = File.join('data', testname + '.cmd')
|
20
|
+
ENV['EDITOR']='echo FAKE-EDITOR '
|
21
|
+
assert_equal(true,
|
22
|
+
run_debugger(testname,
|
23
|
+
"--script #{script} -- ./gcd.rb 3 5"))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# require 'rubygems'
|
5
|
+
# require 'ruby-debug'; Debugger.start(:post_mortem => true)
|
6
|
+
|
7
|
+
# Test the --emacs-basic option.
|
8
|
+
class TestEmacsBasic < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper.rb')
|
14
|
+
|
15
|
+
include TestHelper
|
16
|
+
|
17
|
+
def test_basic
|
18
|
+
testname='emacs_basic'
|
19
|
+
Dir.chdir(@@SRC_DIR) do
|
20
|
+
script = File.join('data', testname + '.cmd')
|
21
|
+
assert_equal(true,
|
22
|
+
run_debugger(testname,
|
23
|
+
"--emacs-basic --script #{script} -- ./gcd.rb 3 5"))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/test/test-enable.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# begin require 'rubygems' rescue LoadError end
|
5
|
+
# require 'ruby-debug'; Debugger.start
|
6
|
+
|
7
|
+
# Test enable and disable commands
|
8
|
+
class TestEnable < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
def test_basic
|
17
|
+
testname='enable'
|
18
|
+
Dir.chdir(@@SRC_DIR) do
|
19
|
+
script = File.join('data', testname + '.cmd')
|
20
|
+
assert_equal(true,
|
21
|
+
run_debugger(testname,
|
22
|
+
"--script #{script} -- ./gcd.rb 3 5"))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/test/test-finish.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# require 'rubygems'
|
5
|
+
# require 'ruby-debug'; Debugger.start
|
6
|
+
|
7
|
+
# Test finish command
|
8
|
+
class TestFinish < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@src_dir = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
+
defined?(@@src_dir)
|
12
|
+
|
13
|
+
require File.join(@@src_dir, 'helper')
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
def test_basic
|
17
|
+
testname='finish'
|
18
|
+
# Ruby 1.8.6 and earlier have a trace-line number bug for return
|
19
|
+
# statements.
|
20
|
+
# filter = Proc.new{|got_lines, correct_lines|
|
21
|
+
# [got_lines[31], got_lines[34]].flatten.each do |s|
|
22
|
+
# s.sub!(/gcd.rb:\d+/, 'gcd.rb:13')
|
23
|
+
# end
|
24
|
+
# got_lines[32] = 'return a'
|
25
|
+
# }
|
26
|
+
Dir.chdir(@@src_dir) do
|
27
|
+
script = File.join('data', testname + '.cmd')
|
28
|
+
assert_equal(true,
|
29
|
+
run_debugger(testname,
|
30
|
+
"--script #{script} -- ./gcd.rb 3 5",
|
31
|
+
nil, nil))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/test/test-frame.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
# require 'rubygems'
|
5
|
+
# require 'ruby-debug'; Debugger.start(:post_mortem => true)
|
6
|
+
|
7
|
+
# Test frame commands
|
8
|
+
class TestFrame < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
# Test commands in frame.rb
|
17
|
+
def test_basic
|
18
|
+
testname='frame'
|
19
|
+
# Ruby 1.8.6 and earlier have a trace-line number bug for return
|
20
|
+
# statements.
|
21
|
+
filter = Proc.new{|got_lines, correct_lines|
|
22
|
+
[got_lines[11], correct_lines[11]].flatten.each do |s|
|
23
|
+
s.sub!(/in file ".*gcd.rb/, 'in file "gcd.rb')
|
24
|
+
end
|
25
|
+
}
|
26
|
+
Dir.chdir(@@SRC_DIR) do
|
27
|
+
script = File.join('data', testname + '.cmd')
|
28
|
+
assert_equal(true,
|
29
|
+
run_debugger(testname,
|
30
|
+
"--script #{script} -- ./gcd.rb 3 5",
|
31
|
+
nil, filter))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|