ruby-debug 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +94 -2
- data/ChangeLog +5225 -0
- data/README +30 -1
- data/Rakefile +55 -24
- data/bin/rdebug +249 -128
- data/cli/ruby-debug/command.rb +30 -3
- data/cli/ruby-debug/commands/breakpoints.rb +54 -24
- data/cli/ruby-debug/commands/catchpoint.rb +13 -12
- data/cli/ruby-debug/commands/condition.rb +49 -0
- data/cli/ruby-debug/commands/continue.rb +32 -0
- data/cli/ruby-debug/commands/control.rb +19 -43
- data/cli/ruby-debug/commands/disassemble.RB +38 -0
- data/cli/ruby-debug/commands/display.rb +1 -1
- data/cli/ruby-debug/commands/edit.rb +48 -0
- data/cli/ruby-debug/commands/enable.rb +78 -35
- data/cli/ruby-debug/commands/eval.rb +6 -5
- data/cli/ruby-debug/commands/finish.rb +42 -0
- data/cli/ruby-debug/commands/frame.rb +64 -33
- data/cli/ruby-debug/commands/help.rb +19 -15
- data/cli/ruby-debug/commands/info.rb +295 -36
- data/cli/ruby-debug/commands/irb.rb +3 -1
- data/cli/ruby-debug/commands/list.rb +27 -50
- data/cli/ruby-debug/commands/quit.rb +38 -0
- data/cli/ruby-debug/commands/reload.rb +40 -0
- data/cli/ruby-debug/commands/save.rb +80 -0
- data/cli/ruby-debug/commands/{settings.rb → set.rb} +50 -12
- data/cli/ruby-debug/commands/show.rb +83 -27
- data/cli/ruby-debug/commands/source.rb +36 -0
- data/cli/ruby-debug/commands/stepping.rb +36 -72
- data/cli/ruby-debug/commands/threads.rb +32 -23
- data/cli/ruby-debug/commands/variables.rb +34 -4
- data/cli/ruby-debug/helper.rb +10 -75
- data/cli/ruby-debug/interface.rb +72 -9
- data/cli/ruby-debug/processor.rb +203 -100
- data/doc/rdebug.1 +7 -2
- data/rdbg.rb +33 -0
- data/test/{test-ruby-debug-base.rb → base/base.rb} +27 -29
- data/test/base/binding.rb +31 -0
- data/test/base/catchpoint.rb +26 -0
- data/test/base/load.rb +40 -0
- data/test/data/annotate.cmd +29 -0
- data/test/data/annotate.right +137 -0
- data/test/data/break_bad.cmd +18 -0
- data/test/data/break_bad.right +28 -0
- data/test/data/breakpoints.cmd +38 -0
- data/test/data/breakpoints.right +98 -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 +69 -0
- data/test/{display.cmd → data/display.cmd} +7 -1
- data/test/{display.right → data/display.right} +13 -6
- 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/{breakpoints.cmd → data/emacs_basic.cmd} +0 -0
- data/test/{breakpoints.right → data/emacs_basic.right} +24 -12
- 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 +43 -0
- data/test/{frame.cmd → data/frame.cmd} +2 -0
- data/test/{frame.right → data/frame.right} +8 -2
- data/test/{help.cmd → data/help.cmd} +8 -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/{info-var.cmd → data/info-var.cmd} +3 -3
- data/test/{info-var.right → data/info-var.right} +20 -15
- data/test/{info.cmd → data/info.cmd} +10 -1
- data/test/data/info.right +65 -0
- data/test/data/linetrace.cmd +6 -0
- data/test/data/linetrace.right +32 -0
- data/test/data/linetracep.cmd +7 -0
- data/test/data/linetracep.right +25 -0
- data/test/data/list.cmd +19 -0
- data/test/data/list.right +127 -0
- data/test/data/noquit.right +1 -0
- data/test/data/output.cmd +6 -0
- data/test/data/output.right +41 -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 +31 -0
- data/test/{quit.cmd → data/quit.cmd} +2 -5
- data/test/data/quit.right +9 -0
- data/test/data/raise.cmd +11 -0
- data/test/data/raise.right +26 -0
- data/test/{setshow.cmd → data/setshow.cmd} +0 -1
- data/test/{setshow.right → data/setshow.right} +0 -1
- data/test/data/source.cmd +5 -0
- data/test/data/source.right +15 -0
- data/test/{stepping.cmd → data/stepping.cmd} +6 -2
- data/test/{stepping.right → data/stepping.right} +13 -3
- 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 +23 -0
- data/test/dollar-0.rb +5 -0
- data/test/except-bug2.rb +7 -0
- data/test/gcd-dbg-nox.rb +31 -0
- data/test/gcd-dbg.rb +30 -0
- data/test/helper.rb +44 -14
- data/test/info-var-bug.rb +2 -0
- data/test/info-var-bug2.rb +2 -0
- data/test/null.rb +1 -0
- data/test/output.rb +2 -0
- data/test/pm-base.rb +22 -0
- data/test/pm.rb +11 -0
- data/test/raise.rb +3 -0
- data/test/tdebug.rb +88 -40
- data/test/test-annotate.rb +25 -0
- data/test/test-break-bad.rb +25 -0
- data/test/test-breakpoints.rb +14 -17
- data/test/test-condition.rb +25 -0
- data/test/test-ctrl.rb +54 -0
- data/test/test-display.rb +15 -15
- data/test/test-dollar-0.rb +39 -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 +15 -16
- data/test/test-help.rb +34 -18
- data/test/test-hist.rb +68 -0
- data/test/test-info-thread.rb +32 -0
- data/test/test-info-var.rb +28 -14
- data/test/test-info.rb +15 -17
- data/test/test-init.rb +41 -0
- data/test/test-list.rb +25 -0
- data/test/test-output.rb +26 -0
- data/test/test-pm.rb +46 -0
- data/test/test-quit.rb +19 -17
- data/test/test-raise.rb +25 -0
- data/test/test-setshow.rb +14 -13
- data/test/test-source.rb +25 -0
- data/test/test-stepping.rb +14 -14
- data/test/test-trace.rb +63 -0
- data/test/thread1.rb +26 -0
- metadata +125 -31
- data/cli/ruby-debug/commands/script.rb +0 -64
- data/runner.sh +0 -7
- data/test/help.right +0 -4
- data/test/info.right +0 -35
- data/test/quit.right +0 -22
- data/test/test-columnize.rb +0 -46
data/test/test-init.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
require 'rbconfig'
|
4
|
+
|
5
|
+
# begin require 'rubygems' rescue LoadError end
|
6
|
+
# require 'ruby-debug'; Debugger.start
|
7
|
+
|
8
|
+
# Test Debugger.init and setting up ruby-debug variables
|
9
|
+
class TestDebuggerInit < Test::Unit::TestCase
|
10
|
+
@@SRC_DIR = File.dirname(__FILE__) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
def test_basic
|
13
|
+
debugger_output = 'test-init.out'
|
14
|
+
Dir.chdir(@@SRC_DIR) do
|
15
|
+
old_emacs = ENV['EMACS']
|
16
|
+
old_columns = ENV['COLUMNS']
|
17
|
+
ENV['EMACS'] = nil
|
18
|
+
ENV['COLUMNS'] = '120'
|
19
|
+
IO.popen("./gcd-dbg.rb 5 >#{debugger_output}", 'w') do |pipe|
|
20
|
+
pipe.puts 'p Debugger::PROG_SCRIPT'
|
21
|
+
pipe.puts 'show args'
|
22
|
+
pipe.puts 'quit unconditionally'
|
23
|
+
end
|
24
|
+
lines = File.open(debugger_output).readlines
|
25
|
+
ENV['EMACS'] = old_emacs
|
26
|
+
ENV['COLUMNS'] = old_columns
|
27
|
+
|
28
|
+
right_file = case Config::CONFIG['host_os']
|
29
|
+
when /^darwin/
|
30
|
+
'test-init-osx.right'
|
31
|
+
when /^cygwin/
|
32
|
+
'test-init-cygwin.right'
|
33
|
+
else
|
34
|
+
'test-init.right'
|
35
|
+
end
|
36
|
+
expected = File.open(File.join('data', right_file)).readlines
|
37
|
+
assert_equal(expected, lines)
|
38
|
+
File.delete(debugger_output) if expected == lines
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/test/test-list.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 List commands
|
8
|
+
class TestList < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@src_dir = File.dirname(__FILE__)
|
11
|
+
|
12
|
+
require File.join(@@src_dir, 'helper')
|
13
|
+
include TestHelper
|
14
|
+
|
15
|
+
# Test commands in list.rb
|
16
|
+
def test_basic
|
17
|
+
testname='list'
|
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-output.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 'starting' annotation.
|
8
|
+
class TestStartingAnnotate < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@SRC_DIR = 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='output'
|
18
|
+
Dir.chdir(@@SRC_DIR) do
|
19
|
+
script = File.join('data', testname + '.cmd')
|
20
|
+
assert_equal(true,
|
21
|
+
run_debugger(testname,
|
22
|
+
"-A 3 --script #{script} -- output.rb",
|
23
|
+
nil, nil, true))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/test/test-pm.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'test/unit'
|
3
|
+
require 'rbconfig'
|
4
|
+
|
5
|
+
# begin require 'rubygems' rescue LoadError end
|
6
|
+
# require 'ruby-debug'; Debugger.start
|
7
|
+
|
8
|
+
# Test Post-mortem command
|
9
|
+
class TestPM < Test::Unit::TestCase
|
10
|
+
|
11
|
+
@@SRC_DIR = File.dirname(__FILE__) unless
|
12
|
+
defined?(@@SRC_DIR)
|
13
|
+
|
14
|
+
require File.join(@@SRC_DIR, 'helper')
|
15
|
+
include TestHelper
|
16
|
+
|
17
|
+
# Test post-mortem handling
|
18
|
+
def test_basic
|
19
|
+
Dir.chdir(@@SRC_DIR) do
|
20
|
+
# filter = Proc.new{|got_lines, correct_lines|
|
21
|
+
# [got_lines[0], correct_lines[0]].each do |s|
|
22
|
+
# s.sub!(/tdebug.rb:\d+/, 'rdebug:999')
|
23
|
+
# end
|
24
|
+
# }
|
25
|
+
ENV['COLUMNS'] = '80'
|
26
|
+
testname='post-mortem'
|
27
|
+
script = File.join('data', testname + '.cmd')
|
28
|
+
testname += '-osx' if Config::CONFIG['host_os'] =~ /^darwin/
|
29
|
+
assert_equal(true,
|
30
|
+
run_debugger(testname,
|
31
|
+
"--script #{script} --post-mortem pm.rb"))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Test post-mortem handling
|
36
|
+
def test_pm_next
|
37
|
+
Dir.chdir(@@SRC_DIR) do
|
38
|
+
ENV['COLUMNS'] = '80'
|
39
|
+
testname='post-mortem-next'
|
40
|
+
script = File.join('data', testname + '.cmd')
|
41
|
+
assert_equal(true,
|
42
|
+
run_debugger(testname,
|
43
|
+
"--script #{script} --post-mortem pm.rb"))
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/test/test-quit.rb
CHANGED
@@ -1,28 +1,30 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require
|
3
|
-
require "fileutils"
|
2
|
+
require 'test/unit'
|
4
3
|
|
5
|
-
# require
|
6
|
-
# require
|
7
|
-
# Debugger.start
|
4
|
+
# begin require 'rubygems' rescue LoadError end
|
5
|
+
# require 'ruby-debug'; Debugger.start
|
8
6
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
require File.join(SRC_DIR, "helper.rb")
|
7
|
+
# Test Quit command
|
8
|
+
class TestQuit < Test::Unit::TestCase
|
13
9
|
|
14
|
-
|
10
|
+
@@SRC_DIR = File.dirname(__FILE__) unless
|
11
|
+
defined?(@@SRC_DIR)
|
15
12
|
|
16
|
-
|
17
|
-
|
18
|
-
require 'stringio'
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
19
15
|
|
20
|
-
# Test commands in stepping.rb
|
21
16
|
def test_basic
|
22
|
-
|
17
|
+
testname='quit'
|
18
|
+
Dir.chdir(@@SRC_DIR) do
|
19
|
+
script = File.join('data', testname + '.cmd')
|
20
|
+
# filter = Proc.new{|got_lines, correct_lines|
|
21
|
+
# [got_lines[0], correct_lines[0]].each do |s|
|
22
|
+
# s.sub!(/tdebug.rb:\d+/, 'rdebug:999')
|
23
|
+
# end
|
24
|
+
# }
|
23
25
|
assert_equal(true,
|
24
|
-
run_debugger(
|
25
|
-
"--script
|
26
|
+
run_debugger(testname,
|
27
|
+
"--script #{script} -- null.rb"))
|
26
28
|
end
|
27
29
|
end
|
28
30
|
end
|
data/test/test-raise.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 Debugger.load handles uncaught exceptions in the debugged program.
|
8
|
+
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
|
+
include TestHelper
|
15
|
+
|
16
|
+
def test_basic
|
17
|
+
testname='raise'
|
18
|
+
Dir.chdir(@@SRC_DIR) do
|
19
|
+
script = File.join('data', testname + '.cmd')
|
20
|
+
assert_equal(true,
|
21
|
+
run_debugger(testname,
|
22
|
+
"--script #{script} -- raise.rb"))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/test/test-setshow.rb
CHANGED
@@ -1,24 +1,25 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require
|
3
|
-
SRC_DIR = File.expand_path(File.dirname(__FILE__)) + "/" unless
|
4
|
-
defined?(SRC_DIR)
|
5
|
-
%w(ext lib cli).each do |dir|
|
6
|
-
$: << SRC_DIR + "../#{dir}"
|
7
|
-
end
|
2
|
+
require 'test/unit'
|
8
3
|
|
9
|
-
require
|
10
|
-
|
4
|
+
# begin require 'rubygems' rescue LoadError end
|
5
|
+
# require 'ruby-debug'; Debugger.start
|
11
6
|
|
12
|
-
# Test of C extension ruby_debug.so
|
13
7
|
class TestSetShow < Test::Unit::TestCase
|
14
|
-
|
8
|
+
|
9
|
+
@@SRC_DIR = File.dirname(__FILE__) unless
|
10
|
+
defined?(@@SRC_DIR)
|
11
|
+
|
12
|
+
require File.join(@@SRC_DIR, 'helper')
|
13
|
+
include TestHelper
|
15
14
|
|
16
15
|
# Test initial variables and setting/getting state.
|
17
16
|
def test_basic
|
18
|
-
|
17
|
+
testname='setshow'
|
18
|
+
Dir.chdir(@@SRC_DIR) do
|
19
|
+
script = File.join('data', testname + '.cmd')
|
19
20
|
assert_equal(true,
|
20
|
-
run_debugger(
|
21
|
-
"--script
|
21
|
+
run_debugger(testname,
|
22
|
+
"--script #{script} -- gcd.rb 3 5"))
|
22
23
|
end
|
23
24
|
end
|
24
25
|
end
|
data/test/test-source.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 'source' command handling.
|
8
|
+
class TestSource < Test::Unit::TestCase
|
9
|
+
|
10
|
+
@@SRC_DIR = 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='source'
|
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-stepping.rb
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require
|
3
|
-
require "fileutils"
|
2
|
+
require 'test/unit'
|
4
3
|
|
5
|
-
# require
|
6
|
-
# require
|
7
|
-
|
8
|
-
SRC_DIR = File.expand_path(File.dirname(__FILE__)) + "/" unless
|
9
|
-
defined?(SRC_DIR)
|
10
|
-
|
11
|
-
require File.join(SRC_DIR, "helper.rb")
|
12
|
-
include TestHelper
|
4
|
+
# begin require 'rubygems' rescue LoadError end
|
5
|
+
# require 'ruby-debug'; Debugger.start
|
13
6
|
|
14
7
|
# Test that linetracing does something.
|
15
8
|
class TestStepping < Test::Unit::TestCase
|
16
|
-
|
9
|
+
|
10
|
+
@@SRC_DIR = File.dirname(__FILE__) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
17
15
|
|
18
16
|
# Test commands in stepping.rb
|
19
17
|
def test_basic
|
20
|
-
|
18
|
+
testname='stepping'
|
19
|
+
Dir.chdir(@@SRC_DIR) do
|
20
|
+
script = File.join('data', testname + '.cmd')
|
21
21
|
assert_equal(true,
|
22
|
-
run_debugger(
|
23
|
-
"--script
|
22
|
+
run_debugger(testname,
|
23
|
+
"--script #{script} -- gcd.rb 3 5"))
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
data/test/test-trace.rb
ADDED
@@ -0,0 +1,63 @@
|
|
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.dirname(__FILE__) unless
|
11
|
+
defined?(@@SRC_DIR)
|
12
|
+
|
13
|
+
require File.join(@@SRC_DIR, 'helper')
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
def test_trace_option
|
17
|
+
|
18
|
+
filter = Proc.new{|got_lines, correct_lines|
|
19
|
+
got_lines.collect!{|l| l =~ /:gcd\.rb:/? l : nil}.compact!
|
20
|
+
}
|
21
|
+
|
22
|
+
testname='trace'
|
23
|
+
Dir.chdir(@@SRC_DIR) do
|
24
|
+
assert_equal(true,
|
25
|
+
run_debugger(testname,
|
26
|
+
"-nx --trace gcd.rb 3 5", nil, filter))
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_linetrace_command
|
31
|
+
|
32
|
+
filter = Proc.new{|got_lines, correct_lines|
|
33
|
+
got_lines.collect!{|l| l !~ /:rdbg\.rb:/? l : nil}.compact!
|
34
|
+
}
|
35
|
+
|
36
|
+
testname='linetrace'
|
37
|
+
Dir.chdir(@@SRC_DIR) do
|
38
|
+
script = File.join('data', testname + '.cmd')
|
39
|
+
assert_equal(true,
|
40
|
+
run_debugger(testname,
|
41
|
+
"--script #{script} -- gcd.rb 3 5", nil,
|
42
|
+
filter))
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_linetrace_plus_command
|
48
|
+
|
49
|
+
filter = Proc.new{|got_lines, correct_lines|
|
50
|
+
got_lines.collect!{|l| l !~ /:rdbg\.rb:/? l : nil}.compact!
|
51
|
+
}
|
52
|
+
|
53
|
+
testname='linetracep'
|
54
|
+
Dir.chdir(@@SRC_DIR) do
|
55
|
+
script = File.join('data', testname + '.cmd')
|
56
|
+
assert_equal(true,
|
57
|
+
run_debugger(testname,
|
58
|
+
"--script #{script} -- gcd.rb 3 5", nil,
|
59
|
+
filter))
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/test/thread1.rb
ADDED
@@ -0,0 +1,26 @@
|
|
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 }
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ruby-debug
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.10.
|
7
|
-
date:
|
6
|
+
version: 0.10.1
|
7
|
+
date: 2008-04-10 00:00:00 -04:00
|
8
8
|
summary: Command line interface (CLI) for ruby-debug-base
|
9
9
|
require_paths:
|
10
10
|
- cli
|
@@ -12,7 +12,7 @@ email: ksibilev@yahoo.com
|
|
12
12
|
homepage: http://rubyforge.org/projects/ruby-debug/
|
13
13
|
rubyforge_project: ruby-debug
|
14
14
|
description: A generic command line interface for ruby-debug.
|
15
|
-
autorequire:
|
15
|
+
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
18
18
|
has_rdoc: true
|
@@ -43,62 +43,147 @@ files:
|
|
43
43
|
- cli/ruby-debug/interface.rb
|
44
44
|
- cli/ruby-debug/commands
|
45
45
|
- cli/ruby-debug/commands/help.rb
|
46
|
+
- cli/ruby-debug/commands/set.rb
|
47
|
+
- cli/ruby-debug/commands/condition.rb
|
46
48
|
- cli/ruby-debug/commands/irb.rb
|
47
|
-
- cli/ruby-debug/commands/
|
49
|
+
- cli/ruby-debug/commands/reload.rb
|
48
50
|
- cli/ruby-debug/commands/list.rb
|
49
51
|
- cli/ruby-debug/commands/control.rb
|
50
52
|
- cli/ruby-debug/commands/display.rb
|
51
53
|
- cli/ruby-debug/commands/eval.rb
|
54
|
+
- cli/ruby-debug/commands/finish.rb
|
52
55
|
- cli/ruby-debug/commands/stepping.rb
|
53
56
|
- cli/ruby-debug/commands/threads.rb
|
54
57
|
- cli/ruby-debug/commands/frame.rb
|
55
58
|
- cli/ruby-debug/commands/catchpoint.rb
|
59
|
+
- cli/ruby-debug/commands/continue.rb
|
60
|
+
- cli/ruby-debug/commands/save.rb
|
56
61
|
- cli/ruby-debug/commands/variables.rb
|
62
|
+
- cli/ruby-debug/commands/edit.rb
|
57
63
|
- cli/ruby-debug/commands/info.rb
|
58
64
|
- cli/ruby-debug/commands/method.rb
|
59
65
|
- cli/ruby-debug/commands/tmate.rb
|
60
|
-
- cli/ruby-debug/commands/
|
66
|
+
- cli/ruby-debug/commands/disassemble.RB
|
67
|
+
- cli/ruby-debug/commands/quit.rb
|
61
68
|
- cli/ruby-debug/commands/breakpoints.rb
|
62
69
|
- cli/ruby-debug/commands/show.rb
|
63
70
|
- cli/ruby-debug/commands/trace.rb
|
64
71
|
- cli/ruby-debug/commands/enable.rb
|
72
|
+
- cli/ruby-debug/commands/source.rb
|
65
73
|
- ChangeLog
|
66
74
|
- bin/rdebug
|
67
75
|
- doc/rdebug.1
|
68
|
-
- test/
|
69
|
-
- test/
|
70
|
-
- test/
|
71
|
-
- test/
|
72
|
-
- test/
|
73
|
-
- test/
|
74
|
-
- test/
|
75
|
-
- test/
|
76
|
-
- test/
|
77
|
-
- test/
|
78
|
-
- test/info.
|
79
|
-
- test/
|
80
|
-
- test/
|
81
|
-
- test/
|
82
|
-
- test/
|
83
|
-
- test/
|
84
|
-
- test/
|
85
|
-
- test/
|
86
|
-
- test/
|
87
|
-
- test/
|
88
|
-
- test/info-
|
89
|
-
- test/
|
90
|
-
-
|
76
|
+
- test/data/emacs_basic.cmd
|
77
|
+
- test/data/breakpoints.cmd
|
78
|
+
- test/data/info.cmd
|
79
|
+
- test/data/list.cmd
|
80
|
+
- test/data/help.cmd
|
81
|
+
- test/data/quit.cmd
|
82
|
+
- test/data/break_bad.cmd
|
83
|
+
- test/data/display.cmd
|
84
|
+
- test/data/linetrace.cmd
|
85
|
+
- test/data/info-var.cmd
|
86
|
+
- test/data/info-var-bug2.cmd
|
87
|
+
- test/data/output.cmd
|
88
|
+
- test/data/stepping.cmd
|
89
|
+
- test/data/ctrl.cmd
|
90
|
+
- test/data/raise.cmd
|
91
|
+
- test/data/edit.cmd
|
92
|
+
- test/data/condition.cmd
|
93
|
+
- test/data/frame.cmd
|
94
|
+
- test/data/source.cmd
|
95
|
+
- test/data/annotate.cmd
|
96
|
+
- test/data/info-thread.cmd
|
97
|
+
- test/data/finish.cmd
|
98
|
+
- test/data/enable.cmd
|
99
|
+
- test/data/setshow.cmd
|
100
|
+
- test/data/post-mortem-next.cmd
|
101
|
+
- test/data/post-mortem.cmd
|
102
|
+
- test/data/linetracep.cmd
|
103
|
+
- test/data/stepping.right
|
104
|
+
- test/data/post-mortem-next.right
|
105
|
+
- test/data/info.right
|
106
|
+
- test/data/emacs_basic.right
|
107
|
+
- test/data/ctrl.right
|
108
|
+
- test/data/dollar-0.right
|
109
|
+
- test/data/trace.right
|
110
|
+
- test/data/dollar-0a.right
|
111
|
+
- test/data/setshow.right
|
112
|
+
- test/data/linetracep.right
|
113
|
+
- test/data/test-init-cygwin.right
|
114
|
+
- test/data/raise.right
|
115
|
+
- test/data/info-var.right
|
116
|
+
- test/data/help.right
|
117
|
+
- test/data/quit.right
|
118
|
+
- test/data/frame.right
|
119
|
+
- test/data/edit.right
|
120
|
+
- test/data/info-var-bug2.right
|
121
|
+
- test/data/finish.right
|
122
|
+
- test/data/breakpoints.right
|
123
|
+
- test/data/test-init.right
|
124
|
+
- test/data/display.right
|
125
|
+
- test/data/post-mortem-osx.right
|
126
|
+
- test/data/info-thread.right
|
127
|
+
- test/data/enable.right
|
128
|
+
- test/data/break_bad.right
|
129
|
+
- test/data/test-init-osx.right
|
130
|
+
- test/data/list.right
|
131
|
+
- test/data/post-mortem.right
|
132
|
+
- test/data/output.right
|
133
|
+
- test/data/history.right
|
134
|
+
- test/data/noquit.right
|
135
|
+
- test/data/linetrace.right
|
136
|
+
- test/data/condition.right
|
137
|
+
- test/data/annotate.right
|
138
|
+
- test/data/source.right
|
139
|
+
- test/data/dollar-0b.right
|
91
140
|
- test/test-help.rb
|
141
|
+
- test/test-list.rb
|
92
142
|
- test/test-stepping.rb
|
143
|
+
- test/test-trace.rb
|
144
|
+
- test/test-break-bad.rb
|
93
145
|
- test/test-quit.rb
|
146
|
+
- test/test-hist.rb
|
147
|
+
- test/test-raise.rb
|
148
|
+
- test/test-edit.rb
|
149
|
+
- test/test-emacs-basic.rb
|
150
|
+
- test/base/load.rb
|
151
|
+
- test/base/binding.rb
|
152
|
+
- test/base/catchpoint.rb
|
153
|
+
- test/base/base.rb
|
154
|
+
- test/helper.rb
|
155
|
+
- test/pm-base.rb
|
156
|
+
- test/test-info-thread.rb
|
157
|
+
- test/test-dollar-0.rb
|
158
|
+
- test/tdebug.rb
|
159
|
+
- test/test-output.rb
|
160
|
+
- test/test-ctrl.rb
|
161
|
+
- test/except-bug2.rb
|
162
|
+
- test/thread1.rb
|
163
|
+
- test/gcd.rb
|
94
164
|
- test/test-display.rb
|
165
|
+
- test/test-init.rb
|
95
166
|
- test/test-info.rb
|
167
|
+
- test/test-enable.rb
|
168
|
+
- test/info-var-bug.rb
|
169
|
+
- test/pm.rb
|
96
170
|
- test/test-frame.rb
|
97
|
-
- test/test-
|
171
|
+
- test/test-annotate.rb
|
98
172
|
- test/test-info-var.rb
|
99
|
-
- test/test-
|
173
|
+
- test/test-condition.rb
|
174
|
+
- test/dollar-0.rb
|
175
|
+
- test/gcd-dbg.rb
|
176
|
+
- test/output.rb
|
177
|
+
- test/test-finish.rb
|
100
178
|
- test/test-breakpoints.rb
|
179
|
+
- test/raise.rb
|
180
|
+
- test/null.rb
|
101
181
|
- test/test-setshow.rb
|
182
|
+
- test/info-var-bug2.rb
|
183
|
+
- test/test-pm.rb
|
184
|
+
- test/gcd-dbg-nox.rb
|
185
|
+
- test/test-source.rb
|
186
|
+
- rdbg.rb
|
102
187
|
test_files: []
|
103
188
|
|
104
189
|
rdoc_options: []
|
@@ -112,6 +197,15 @@ extensions: []
|
|
112
197
|
requirements: []
|
113
198
|
|
114
199
|
dependencies:
|
200
|
+
- !ruby/object:Gem::Dependency
|
201
|
+
name: columnize
|
202
|
+
version_requirement:
|
203
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
204
|
+
requirements:
|
205
|
+
- - ">="
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: "0.1"
|
208
|
+
version:
|
115
209
|
- !ruby/object:Gem::Dependency
|
116
210
|
name: ruby-debug-base
|
117
211
|
version_requirement:
|
@@ -119,5 +213,5 @@ dependencies:
|
|
119
213
|
requirements:
|
120
214
|
- - "="
|
121
215
|
- !ruby/object:Gem::Version
|
122
|
-
version: 0.10.
|
216
|
+
version: 0.10.1
|
123
217
|
version:
|