ruby-debug 0.10.4 → 0.10.5.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 +5 -0
- data/CHANGES +17 -0
- data/ChangeLog +6086 -3711
- data/README +39 -0
- data/Rakefile +67 -82
- data/cli/ruby-debug/commands/breakpoints.rb +4 -2
- data/cli/ruby-debug/commands/edit.rb +3 -2
- data/cli/ruby-debug/commands/info.rb +5 -4
- data/cli/ruby-debug/commands/irb.rb +7 -8
- data/cli/ruby-debug/commands/list.rb +1 -1
- data/cli/ruby-debug/commands/set.rb +7 -1
- data/cli/ruby-debug/commands/show.rb +8 -3
- data/cli/ruby-debug/processor.rb +10 -4
- data/doc/rdebug.1 +1 -1
- data/rdbg.rb +1 -1
- data/test/base/base.rb +7 -4
- data/test/base/binding.rb +3 -12
- data/test/base/catchpoint.rb +2 -9
- data/test/base/load.rb +18 -14
- data/test/base/reload_bug.rb +2 -2
- data/test/cli/commands/catchpoint_test.rb +1 -13
- data/test/cli/commands/unit/regexp.rb +2 -8
- data/test/data/annotate.cmd +2 -2
- data/test/data/annotate.right +8 -8
- data/test/data/at-exit.cmd +4 -0
- data/test/data/at-exit.right +12 -0
- data/test/data/break_bad.cmd +3 -5
- data/test/data/break_bad.right +4 -6
- data/test/data/break_tracelines.cmd +9 -0
- data/test/data/break_tracelines.right +17 -0
- data/test/data/breakpoints-basename.cmd +2 -0
- data/test/data/breakpoints-basename.right +10 -0
- data/test/data/breakpoints.cmd +0 -1
- data/test/data/breakpoints.right +1 -3
- data/test/data/catch.cmd +1 -0
- data/test/data/catch.right +2 -0
- data/test/data/continue_bad.cmd +4 -0
- data/test/data/continue_bad.right +9 -0
- data/test/data/ctrl.right +2 -1
- data/test/data/dollar-0.right +3 -2
- data/test/data/dollar-0a.right +1 -0
- data/test/data/dollar-0b.right +1 -0
- data/test/data/edit.cmd +1 -1
- data/test/data/edit.right +4 -4
- data/test/data/emacs_basic.cmd +1 -34
- data/test/data/emacs_basic.right +10 -92
- data/test/data/frame.cmd +0 -3
- data/test/data/frame.right +0 -4
- data/test/data/info-file-break.cmd +4 -0
- data/test/data/info-file-break.right +11 -0
- data/test/data/info-thread.right +4 -4
- data/test/data/info-var-bug2.right +2 -2
- data/test/data/info.cmd +0 -1
- data/test/data/info.right +1 -5
- data/test/data/linetrace-jruby.right +23 -0
- data/test/data/list.right +13 -13
- data/test/data/output.right +4 -4
- data/test/data/post-mortem-osx.right +5 -4
- data/test/data/quit.right +9 -0
- data/test/data/raise-jruby.right +26 -0
- data/test/data/raise.right +1 -1
- data/test/data/save.cmd +1 -0
- data/test/data/save.right +4 -2
- data/test/data/stepping.cmd +2 -2
- data/test/data/stepping.right +4 -4
- data/test/data/test-init.right +2 -2
- data/test/data/trace-jruby.right +14 -0
- data/test/example/a/example.rb +1 -0
- data/test/example/at-exit.rb +3 -0
- data/test/example/b/example.rb +1 -0
- data/test/{bp_loop_issue.rb → example/bp_loop_issue.rb} +0 -0
- data/test/example/breakpoints-basename.rb +2 -0
- data/test/{brkpt-class-bug.rb → example/brkpt-class-bug.rb} +0 -0
- data/test/{classes.rb → example/classes.rb} +0 -0
- data/test/{dollar-0.rb → example/dollar-0.rb} +1 -0
- data/test/{except-bug1.rb → example/except-bug1.rb} +0 -0
- data/test/file with space.rb b/data/test/example/file with → space.rb +0 -0
- data/test/{gcd.rb → example/gcd.rb} +0 -0
- data/test/{info-var-bug.rb → example/info-var-bug.rb} +0 -0
- data/test/{info-var-bug2.rb → example/info-var-bug2.rb} +0 -0
- data/test/{null.rb → example/null.rb} +0 -0
- data/test/{output.rb → example/output.rb} +0 -0
- data/test/{pm-bug.rb → example/pm-bug.rb} +0 -0
- data/test/{pm.rb → example/pm.rb} +0 -0
- data/test/{raise.rb → example/raise.rb} +0 -0
- data/test/helper.rb +52 -34
- data/test/rdebug-save.1 +2 -2
- data/test/test-annotate.rb +4 -16
- data/test/test-at-exit.rb +13 -0
- data/test/test-break-bad.rb +14 -25
- data/test/test-breakpoints.rb +13 -14
- data/test/test-brkpt-class-bug.rb +3 -16
- data/test/test-catch.rb +3 -15
- data/test/test-condition.rb +3 -15
- data/test/test-display.rb +3 -15
- data/test/test-dollar-0.rb +23 -35
- data/test/test-edit.rb +4 -16
- data/test/test-emacs-basic.rb +4 -17
- data/test/test-enable.rb +3 -15
- data/test/test-except-bug1.rb +6 -21
- data/test/test-file-with-space.rb +3 -15
- data/test/test-finish.rb +11 -23
- data/test/test-frame.rb +14 -20
- data/test/test-hist.rb +6 -10
- data/test/test-info-thread.rb +13 -21
- data/test/test-info-var.rb +20 -37
- data/test/test-info.rb +16 -15
- data/test/test-list.rb +3 -14
- data/test/test-method.rb +9 -23
- data/test/test-output.rb +3 -16
- data/test/test-pm.rb +16 -38
- data/test/test-quit.rb +3 -20
- data/test/test-raise.rb +3 -15
- data/test/test-save.rb +12 -21
- data/test/test-setshow.rb +3 -15
- data/test/test-source.rb +3 -15
- data/test/test-stepping.rb +3 -15
- data/test/test-trace.rb +22 -45
- metadata +199 -159
- data/VERSION +0 -3
- data/cli/ruby-debug/commands/continue.RB +0 -48
- data/cli/ruby-debug/commands/disassemble.RB +0 -38
- data/cli/ruby-debug/commands/raise.RB +0 -41
- data/cli/ruby-debug/commands/source.RB +0 -44
- data/cli/ruby-debug/processor.RB +0 -484
- data/runner.sh +0 -7
- data/test/except-bug2.rb +0 -7
- data/test/scope-test.rb +0 -8
- data/test/tvar.rb +0 -3
data/test/test-breakpoints.rb
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
3
|
-
|
|
4
|
-
# begin require 'rubygems' rescue LoadError end
|
|
5
|
-
# require 'ruby-debug'; Debugger.start
|
|
2
|
+
require File.expand_path("../helper", __FILE__)
|
|
6
3
|
|
|
7
4
|
# Test breakpoint commands
|
|
8
5
|
class TestBreakpoints < Test::Unit::TestCase
|
|
9
|
-
|
|
10
|
-
@@SRC_DIR = File.dirname(__FILE__) unless
|
|
11
|
-
defined?(@@SRC_DIR)
|
|
12
|
-
|
|
13
|
-
require File.join(@@SRC_DIR, 'helper')
|
|
14
6
|
include TestHelper
|
|
15
7
|
|
|
16
8
|
def test_basic
|
|
17
9
|
testname='breakpoints'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
script = File.join('data', testname + '.cmd')
|
|
11
|
+
assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def test_breakpoint_in_files_with_same_basename
|
|
15
|
+
filter = proc do |got_lines, correct_lines|
|
|
16
|
+
got_lines.each {|s| s.gsub!(/[^\s]*\/example\/(a|b)\/example.rb/, 'example/\1/example.rb') }
|
|
23
17
|
end
|
|
18
|
+
|
|
19
|
+
testname='breakpoints-basename'
|
|
20
|
+
script = File.join('data', testname + '.cmd')
|
|
21
|
+
assert(run_debugger(testname, "--script #{script} -- ./example/#{testname}.rb",
|
|
22
|
+
:filter => filter))
|
|
24
23
|
end
|
|
25
24
|
end
|
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
3
|
-
|
|
4
|
-
# begin require 'rubygems' rescue LoadError end
|
|
5
|
-
# require 'ruby-debug'; Debugger.start
|
|
2
|
+
require File.expand_path("../helper", __FILE__)
|
|
6
3
|
|
|
7
4
|
# Test (mostly) invalid breakpoint commands
|
|
8
5
|
class TestBrkptClassBug < Test::Unit::TestCase
|
|
9
|
-
|
|
10
|
-
@@SRC_DIR = File.dirname(__FILE__) unless
|
|
11
|
-
defined?(@@SRC_DIR)
|
|
12
|
-
|
|
13
|
-
require File.join(@@SRC_DIR, 'helper')
|
|
14
6
|
include TestHelper
|
|
15
7
|
|
|
16
8
|
def test_basic
|
|
17
9
|
testname='brkpt-class-bug'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
assert_equal(true,
|
|
21
|
-
run_debugger(testname,
|
|
22
|
-
"--script #{script} -- brkpt-class-bug.rb"))
|
|
23
|
-
end
|
|
10
|
+
script = File.join('data', testname + '.cmd')
|
|
11
|
+
assert(run_debugger(testname, "--script #{script} -- ./example/brkpt-class-bug.rb"))
|
|
24
12
|
end
|
|
25
|
-
|
|
26
13
|
end
|
data/test/test-catch.rb
CHANGED
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
3
|
-
|
|
4
|
-
# begin require 'rubygems' rescue LoadError end
|
|
5
|
-
# require 'ruby-debug'; Debugger.start
|
|
2
|
+
require File.expand_path("../helper", __FILE__)
|
|
6
3
|
|
|
7
4
|
# Test condition command
|
|
8
5
|
class TestCatch < Test::Unit::TestCase
|
|
9
|
-
|
|
10
|
-
@@SRC_DIR = File.dirname(__FILE__) unless
|
|
11
|
-
defined?(@@SRC_DIR)
|
|
12
|
-
|
|
13
|
-
require File.join(@@SRC_DIR, 'helper')
|
|
14
6
|
include TestHelper
|
|
15
7
|
|
|
16
8
|
def test_basic
|
|
17
9
|
testname='catch'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
assert_equal(true,
|
|
21
|
-
run_debugger(testname,
|
|
22
|
-
"--script #{script} -- pm.rb"))
|
|
23
|
-
end
|
|
10
|
+
script = File.join('data', testname + '.cmd')
|
|
11
|
+
assert(run_debugger(testname, "--script #{script} -- ./example/pm.rb"))
|
|
24
12
|
end
|
|
25
13
|
end
|
data/test/test-condition.rb
CHANGED
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
3
|
-
|
|
4
|
-
# begin require 'rubygems' rescue LoadError end
|
|
5
|
-
# require 'ruby-debug'; Debugger.start
|
|
2
|
+
require File.expand_path("../helper", __FILE__)
|
|
6
3
|
|
|
7
4
|
# Test condition command
|
|
8
5
|
class TestCondition < Test::Unit::TestCase
|
|
9
|
-
|
|
10
|
-
@@SRC_DIR = File.dirname(__FILE__) unless
|
|
11
|
-
defined?(@@SRC_DIR)
|
|
12
|
-
|
|
13
|
-
require File.join(@@SRC_DIR, 'helper')
|
|
14
6
|
include TestHelper
|
|
15
7
|
|
|
16
8
|
def test_basic
|
|
17
9
|
testname='condition'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
assert_equal(true,
|
|
21
|
-
run_debugger(testname,
|
|
22
|
-
"--script #{script} -- gcd.rb 3 5"))
|
|
23
|
-
end
|
|
10
|
+
script = File.join('data', testname + '.cmd')
|
|
11
|
+
assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
|
|
24
12
|
end
|
|
25
13
|
end
|
data/test/test-display.rb
CHANGED
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
3
|
-
|
|
4
|
-
# begin require 'rubygems' rescue LoadError end
|
|
5
|
-
# require 'ruby-debug'; Debugger.start
|
|
2
|
+
require File.expand_path("../helper", __FILE__)
|
|
6
3
|
|
|
7
4
|
# Test Display commands
|
|
8
5
|
class TestDisplay < Test::Unit::TestCase
|
|
9
|
-
|
|
10
|
-
@@SRC_DIR = File.dirname(__FILE__) unless
|
|
11
|
-
defined?(@@SRC_DIR)
|
|
12
|
-
|
|
13
|
-
require File.join(@@SRC_DIR, 'helper')
|
|
14
6
|
include TestHelper
|
|
15
7
|
|
|
16
8
|
# Test commands in display.rb
|
|
17
9
|
def test_basic
|
|
18
10
|
testname='display'
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
assert_equal(true,
|
|
22
|
-
run_debugger(testname,
|
|
23
|
-
"--script #{script} -- gcd.rb 3 5"))
|
|
24
|
-
end
|
|
11
|
+
script = File.join('data', testname + '.cmd')
|
|
12
|
+
assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
|
|
25
13
|
end
|
|
26
14
|
end
|
data/test/test-dollar-0.rb
CHANGED
|
@@ -1,45 +1,33 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
3
|
-
|
|
4
|
-
# begin require 'rubygems' rescue LoadError end
|
|
5
|
-
# require 'ruby-debug'; Debugger.start
|
|
2
|
+
require File.expand_path("../helper", __FILE__)
|
|
6
3
|
|
|
7
4
|
# Test --no-stop and $0 setting.
|
|
8
5
|
class TestDollar0 < Test::Unit::TestCase
|
|
9
|
-
|
|
10
|
-
@@SRC_DIR = File.dirname(__FILE__) unless
|
|
11
|
-
defined?(@@SRC_DIR)
|
|
12
|
-
|
|
13
|
-
require File.join(@@SRC_DIR, 'helper')
|
|
14
6
|
include TestHelper
|
|
15
7
|
|
|
16
8
|
def test_basic
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
home_save = ENV['HOME']
|
|
10
|
+
ENV['HOME'] = '.'
|
|
11
|
+
filter = Proc.new{|got_lines, correct_lines|
|
|
12
|
+
[got_lines, correct_lines].flatten.each do |s|
|
|
13
|
+
s.gsub!(/.*dollar-0.rb$/, 'dollar-0.rb')
|
|
14
|
+
end
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
assert(run_debugger('dollar-0', '-nx --no-stop ./example/dollar-0.rb',
|
|
18
|
+
:filter => filter,
|
|
19
|
+
:runner => '../bin/rdebug'))
|
|
26
20
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
run_debugger('dollar-0b',
|
|
39
|
-
'-nx --no-stop ' +
|
|
40
|
-
File.join('..', 'test', 'dollar-0.rb'),
|
|
41
|
-
nil, filter, false, '../bin/rdebug'))
|
|
42
|
-
ENV['HOME'] = home_save
|
|
43
|
-
end
|
|
21
|
+
# Ruby's __FILE__ seems to prepend ./ when no directory was added.
|
|
22
|
+
assert(run_debugger('dollar-0a', '-nx --no-stop ./example/dollar-0.rb',
|
|
23
|
+
:filter => filter,
|
|
24
|
+
:runner => '../bin/rdebug'))
|
|
25
|
+
|
|
26
|
+
# Ruby's __FILE__ seems to prepend ./ when no directory was added.
|
|
27
|
+
assert(run_debugger('dollar-0b', '-nx --no-stop ' + File.join(%w(example dollar-0.rb)),
|
|
28
|
+
:filter => filter,
|
|
29
|
+
:runner => '../bin/rdebug'))
|
|
30
|
+
ensure
|
|
31
|
+
ENV['HOME'] = home_save
|
|
44
32
|
end
|
|
45
33
|
end
|
data/test/test-edit.rb
CHANGED
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
3
|
-
|
|
4
|
-
# begin require 'rubygems' rescue LoadError end
|
|
5
|
-
# require 'ruby-debug'; Debugger.start
|
|
2
|
+
require File.expand_path("../helper", __FILE__)
|
|
6
3
|
|
|
7
4
|
# Test 'edit' command handling.
|
|
8
5
|
class TestEdit < Test::Unit::TestCase
|
|
9
|
-
|
|
10
|
-
@@SRC_DIR = File.dirname(__FILE__) unless
|
|
11
|
-
defined?(@@SRC_DIR)
|
|
12
|
-
|
|
13
|
-
require File.join(@@SRC_DIR, 'helper')
|
|
14
6
|
include TestHelper
|
|
15
7
|
|
|
16
8
|
def test_basic
|
|
17
9
|
testname='edit'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
assert_equal(true,
|
|
22
|
-
run_debugger(testname,
|
|
23
|
-
"--script #{script} -- gcd.rb 3 5"))
|
|
24
|
-
end
|
|
10
|
+
script = File.join('data', testname + '.cmd')
|
|
11
|
+
ENV['EDITOR']='echo FAKE-EDITOR '
|
|
12
|
+
assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
|
|
25
13
|
end
|
|
26
14
|
end
|
data/test/test-emacs-basic.rb
CHANGED
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
3
|
-
|
|
4
|
-
# require 'rubygems'
|
|
5
|
-
# require 'ruby-debug'; Debugger.start(:post_mortem => true)
|
|
2
|
+
require File.expand_path("../helper", __FILE__)
|
|
6
3
|
|
|
7
4
|
# Test the --emacs-basic option.
|
|
8
5
|
class TestEmacsBasic < Test::Unit::TestCase
|
|
9
|
-
|
|
10
|
-
@@SRC_DIR = File.dirname(__FILE__) unless
|
|
11
|
-
defined?(@@SRC_DIR)
|
|
12
|
-
|
|
13
|
-
require File.join(@@SRC_DIR, 'helper.rb')
|
|
14
|
-
|
|
15
6
|
include TestHelper
|
|
16
|
-
|
|
7
|
+
|
|
17
8
|
def test_basic
|
|
18
9
|
testname='emacs_basic'
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
assert_equal(true,
|
|
22
|
-
run_debugger(testname,
|
|
23
|
-
"--emacs-basic --script #{script} -- gcd.rb 3 5"))
|
|
24
|
-
end
|
|
10
|
+
script = File.join('data', testname + '.cmd')
|
|
11
|
+
assert(run_debugger(testname, "--emacs-basic --script #{script} -- ./example/gcd.rb 3 5"))
|
|
25
12
|
end
|
|
26
13
|
end
|
data/test/test-enable.rb
CHANGED
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
3
|
-
|
|
4
|
-
# begin require 'rubygems' rescue LoadError end
|
|
5
|
-
# require 'ruby-debug'; Debugger.start
|
|
2
|
+
require File.expand_path("../helper", __FILE__)
|
|
6
3
|
|
|
7
4
|
# Test enable and disable commands
|
|
8
5
|
class TestEnable < Test::Unit::TestCase
|
|
9
|
-
|
|
10
|
-
@@SRC_DIR = File.dirname(__FILE__) unless
|
|
11
|
-
defined?(@@SRC_DIR)
|
|
12
|
-
|
|
13
|
-
require File.join(@@SRC_DIR, 'helper')
|
|
14
6
|
include TestHelper
|
|
15
7
|
|
|
16
8
|
def test_basic
|
|
17
9
|
testname='enable'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
assert_equal(true,
|
|
21
|
-
run_debugger(testname,
|
|
22
|
-
"--script #{script} -- gcd.rb 3 5"))
|
|
23
|
-
end
|
|
10
|
+
script = File.join('data', testname + '.cmd')
|
|
11
|
+
assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
|
|
24
12
|
end
|
|
25
13
|
end
|
data/test/test-except-bug1.rb
CHANGED
|
@@ -1,31 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
3
|
-
require 'rbconfig'
|
|
4
|
-
|
|
5
|
-
# begin require 'rubygems' rescue LoadError end
|
|
6
|
-
# require 'ruby-debug'; Debugger.start
|
|
2
|
+
require File.expand_path("../helper", __FILE__)
|
|
7
3
|
|
|
8
4
|
# Bug in Post-mortem command was not being able to show
|
|
9
5
|
# variables on stack when stack stopped in a FIXNUM from 1/0.
|
|
10
6
|
class TestExceptBug1 < Test::Unit::TestCase
|
|
11
|
-
|
|
12
|
-
@@SRC_DIR = File.dirname(__FILE__) unless
|
|
13
|
-
defined?(@@SRC_DIR)
|
|
14
|
-
|
|
15
|
-
require File.join(@@SRC_DIR, 'helper')
|
|
16
7
|
include TestHelper
|
|
17
8
|
|
|
18
9
|
# Test post-mortem handling
|
|
19
10
|
def test_pm_except_bug
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
assert_equal(true,
|
|
25
|
-
run_debugger(testname,
|
|
26
|
-
"--script #{script} --post-mortem " +
|
|
27
|
-
"#{testname}.rb"))
|
|
28
|
-
end
|
|
11
|
+
ENV['COLUMNS'] = '80'
|
|
12
|
+
testname='except-bug1'
|
|
13
|
+
script = File.join('data', testname + '.cmd')
|
|
14
|
+
assert(run_debugger(testname, "--script #{script} --post-mortem ./example/#{testname}.rb"))
|
|
29
15
|
end
|
|
30
|
-
|
|
31
|
-
end
|
|
16
|
+
end unless defined?(JRUBY_VERSION) # post-mortem not yet supported on JRuby
|
|
@@ -1,30 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
3
|
-
|
|
4
|
-
# begin require 'rubygems' rescue LoadError end
|
|
5
|
-
# require 'ruby-debug'; Debugger.start
|
|
2
|
+
require File.expand_path("../helper", __FILE__)
|
|
6
3
|
|
|
7
4
|
# Test Running a program wiht an embedded space
|
|
8
5
|
class TestFileWithSpace < Test::Unit::TestCase
|
|
9
|
-
|
|
10
|
-
@@SRC_DIR = File.dirname(__FILE__) unless
|
|
11
|
-
defined?(@@SRC_DIR)
|
|
12
|
-
|
|
13
|
-
require File.join(@@SRC_DIR, 'helper')
|
|
14
6
|
include TestHelper
|
|
15
7
|
|
|
16
8
|
def test_basic
|
|
17
9
|
testname='file-with-space'
|
|
18
|
-
|
|
19
|
-
script = File.join('data', testname + '.cmd')
|
|
10
|
+
script = File.join('data', testname + '.cmd')
|
|
20
11
|
# filter = Proc.new{|got_lines, correct_lines|
|
|
21
12
|
# [got_lines[0], correct_lines[0]].each do |s|
|
|
22
13
|
# s.sub!(/tdebug.rb:\d+/, 'rdebug:999')
|
|
23
14
|
# end
|
|
24
15
|
# }
|
|
25
|
-
|
|
26
|
-
run_debugger(testname,
|
|
27
|
-
"--script #{script} -- 'file with space.rb'"))
|
|
28
|
-
end
|
|
16
|
+
assert(run_debugger(testname, "--script #{script} -- './example/file with space.rb'"))
|
|
29
17
|
end
|
|
30
18
|
end
|
data/test/test-finish.rb
CHANGED
|
@@ -1,34 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
3
|
-
|
|
4
|
-
# require 'rubygems'
|
|
5
|
-
# require 'ruby-debug'; Debugger.start
|
|
2
|
+
require File.expand_path("../helper", __FILE__)
|
|
6
3
|
|
|
7
4
|
# Test finish command
|
|
8
5
|
class TestFinish < Test::Unit::TestCase
|
|
9
|
-
|
|
10
|
-
@@src_dir = File.dirname(__FILE__) unless
|
|
11
|
-
defined?(@@src_dir)
|
|
12
|
-
|
|
13
|
-
require File.join(@@src_dir, 'helper')
|
|
14
6
|
include TestHelper
|
|
15
7
|
|
|
16
8
|
def test_basic
|
|
17
|
-
testname='finish'
|
|
18
9
|
# Ruby 1.8.6 and earlier have a trace-line number bug for return
|
|
19
10
|
# 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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"--script #{script} -- gcd.rb 3 5",
|
|
31
|
-
nil, nil))
|
|
32
|
-
end
|
|
11
|
+
# filter = Proc.new{|got_lines, correct_lines|
|
|
12
|
+
# [got_lines[31], got_lines[34]].flatten.each do |s|
|
|
13
|
+
# s.sub!(/gcd.rb:\d+/, 'gcd.rb:13')
|
|
14
|
+
# end
|
|
15
|
+
# got_lines[32] = 'return a'
|
|
16
|
+
# }
|
|
17
|
+
|
|
18
|
+
testname = 'finish'
|
|
19
|
+
script = File.join('data', testname + '.cmd')
|
|
20
|
+
assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
|
|
33
21
|
end
|
|
34
22
|
end
|
data/test/test-frame.rb
CHANGED
|
@@ -1,34 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
require
|
|
3
|
-
|
|
4
|
-
# require 'rubygems'
|
|
5
|
-
# require 'ruby-debug'; Debugger.start(:post_mortem => true)
|
|
2
|
+
require File.expand_path("../helper", __FILE__)
|
|
6
3
|
|
|
7
4
|
# Test frame commands
|
|
8
5
|
class TestFrame < Test::Unit::TestCase
|
|
9
|
-
|
|
10
|
-
@@SRC_DIR = File.dirname(__FILE__) unless
|
|
11
|
-
defined?(@@SRC_DIR)
|
|
12
|
-
|
|
13
|
-
require File.join(@@SRC_DIR, 'helper')
|
|
14
6
|
include TestHelper
|
|
15
7
|
|
|
16
8
|
# Test commands in frame.rb
|
|
17
9
|
def test_basic
|
|
18
10
|
testname='frame'
|
|
19
|
-
|
|
20
|
-
#
|
|
11
|
+
script = File.join('data', testname + '.cmd')
|
|
12
|
+
assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5"))
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def test_bad_continue
|
|
16
|
+
# Remove absolute paths in output.
|
|
21
17
|
filter = Proc.new{|got_lines, correct_lines|
|
|
22
|
-
[got_lines
|
|
18
|
+
[got_lines, correct_lines].flatten.each do |s|
|
|
23
19
|
s.sub!(/in file ".*gcd.rb/, 'in file "gcd.rb')
|
|
24
20
|
end
|
|
25
21
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
end
|
|
33
|
-
end
|
|
22
|
+
|
|
23
|
+
testname='continue_bad'
|
|
24
|
+
script = File.join('data', testname + '.cmd')
|
|
25
|
+
assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5",
|
|
26
|
+
:filter => filter))
|
|
27
|
+
end unless defined?(JRUBY_VERSION) # JRuby doesn't yet support tracelines
|
|
34
28
|
end
|