ruby-debug 0.9.3 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +1 -0
- data/CHANGES +41 -0
- data/ChangeLog +0 -0
- data/README +27 -13
- data/Rakefile +220 -0
- data/bin/rdebug +116 -42
- data/cli/ruby-debug.rb +33 -3
- data/cli/ruby-debug/command.rb +49 -12
- data/cli/ruby-debug/commands/breakpoints.rb +47 -64
- data/cli/ruby-debug/commands/control.rb +41 -13
- data/cli/ruby-debug/commands/display.rb +35 -18
- data/cli/ruby-debug/commands/enable.rb +159 -0
- data/cli/ruby-debug/commands/eval.rb +78 -4
- data/cli/ruby-debug/commands/frame.rb +67 -42
- data/cli/ruby-debug/commands/help.rb +21 -17
- data/cli/ruby-debug/commands/info.rb +210 -0
- data/cli/ruby-debug/commands/irb.rb +9 -1
- data/cli/ruby-debug/commands/list.rb +11 -8
- data/cli/ruby-debug/commands/method.rb +12 -23
- data/cli/ruby-debug/commands/script.rb +14 -9
- data/cli/ruby-debug/commands/settings.rb +174 -39
- data/cli/ruby-debug/commands/show.rb +193 -0
- data/cli/ruby-debug/commands/stepping.rb +15 -10
- data/cli/ruby-debug/commands/threads.rb +55 -56
- data/cli/ruby-debug/commands/variables.rb +27 -27
- data/cli/ruby-debug/helper.rb +134 -0
- data/cli/ruby-debug/interface.rb +46 -15
- data/cli/ruby-debug/processor.rb +156 -25
- data/doc/rdebug.1 +236 -0
- data/runner.sh +7 -0
- data/test/breakpoints.cmd +43 -0
- data/test/breakpoints.right +94 -0
- data/test/display.cmd +18 -0
- data/test/display.right +37 -0
- data/test/frame.cmd +21 -0
- data/test/frame.right +45 -0
- data/test/gcd.rb +18 -0
- data/test/help.cmd +12 -0
- data/test/help.right +4 -0
- data/test/helper.rb +87 -0
- data/test/info-var-bug.rb +45 -0
- data/test/info-var.cmd +23 -0
- data/test/info-var.right +47 -0
- data/test/info.cmd +12 -0
- data/test/info.right +35 -0
- data/test/quit.cmd +9 -0
- data/test/quit.right +22 -0
- data/test/setshow.cmd +44 -0
- data/test/setshow.right +73 -0
- data/test/stepping.cmd +17 -0
- data/test/stepping.right +40 -0
- data/test/tdebug.rb +196 -0
- data/test/test-breakpoints.rb +28 -0
- data/test/test-columnize.rb +46 -0
- data/test/test-display.rb +26 -0
- data/test/test-frame.rb +27 -0
- data/test/test-help.rb +44 -0
- data/test/test-info-var.rb +33 -0
- data/test/test-info.rb +28 -0
- data/test/test-quit.rb +28 -0
- data/test/test-ruby-debug-base.rb +76 -0
- data/test/test-setshow.rb +24 -0
- data/test/test-stepping.rb +26 -0
- metadata +63 -22
data/test/test-info.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "test/unit"
|
3
|
+
require "fileutils"
|
4
|
+
|
5
|
+
# require "rubygems"
|
6
|
+
# require "ruby-debug"
|
7
|
+
# Debugger.start
|
8
|
+
|
9
|
+
SRC_DIR = File.expand_path(File.dirname(__FILE__)) + "/" unless
|
10
|
+
defined?(SRC_DIR)
|
11
|
+
|
12
|
+
require File.join(SRC_DIR, "helper.rb")
|
13
|
+
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
# Test info commands
|
17
|
+
class TestInfo < Test::Unit::TestCase
|
18
|
+
require 'stringio'
|
19
|
+
|
20
|
+
# Test commands in stepping.rb
|
21
|
+
def test_basic
|
22
|
+
Dir.chdir(SRC_DIR) do
|
23
|
+
assert_equal(true,
|
24
|
+
run_debugger("info",
|
25
|
+
"--script info.cmd -- gcd.rb 3 5"))
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/test/test-quit.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "test/unit"
|
3
|
+
require "fileutils"
|
4
|
+
|
5
|
+
# require "rubygems"
|
6
|
+
# require "ruby-debug"
|
7
|
+
# Debugger.start
|
8
|
+
|
9
|
+
SRC_DIR = File.expand_path(File.dirname(__FILE__)) + "/" unless
|
10
|
+
defined?(SRC_DIR)
|
11
|
+
|
12
|
+
require File.join(SRC_DIR, "helper.rb")
|
13
|
+
|
14
|
+
include TestHelper
|
15
|
+
|
16
|
+
# Test frame commands
|
17
|
+
class TestQuit < Test::Unit::TestCase
|
18
|
+
require 'stringio'
|
19
|
+
|
20
|
+
# Test commands in stepping.rb
|
21
|
+
def test_basic
|
22
|
+
Dir.chdir(SRC_DIR) do
|
23
|
+
assert_equal(true,
|
24
|
+
run_debugger("quit",
|
25
|
+
"--script quit.cmd --no-quit -- gcd.rb 3 5"))
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "test/unit"
|
3
|
+
|
4
|
+
$: << File.expand_path(File.dirname(__FILE__)) + '/../ext'
|
5
|
+
$: << File.expand_path(File.dirname(__FILE__)) + '/../lib'
|
6
|
+
require "ruby_debug"
|
7
|
+
|
8
|
+
# Test of C extension ruby_debug.so
|
9
|
+
class TestRubyDebug < Test::Unit::TestCase
|
10
|
+
include Debugger
|
11
|
+
|
12
|
+
# test current_context
|
13
|
+
def test_current_context
|
14
|
+
assert_equal(false, Debugger.started?,
|
15
|
+
"debugger should not initially be started.")
|
16
|
+
Debugger.start
|
17
|
+
assert(Debugger.started?,
|
18
|
+
"debugger should now be started.")
|
19
|
+
assert_equal(19, Debugger.current_context.frame_line)
|
20
|
+
assert_equal(nil, Debugger.current_context.frame_args_info,
|
21
|
+
"no frame args info.")
|
22
|
+
assert_equal(Debugger.current_context.frame_file,
|
23
|
+
Debugger.current_context.frame_file(0))
|
24
|
+
assert_equal("test-ruby-debug-base.rb",
|
25
|
+
File.basename(Debugger.current_context.frame_file))
|
26
|
+
assert_raises(ArgumentError) {Debugger.current_context.frame_file(1, 2)}
|
27
|
+
assert_raises(ArgumentError) {Debugger.current_context.frame_file(10)}
|
28
|
+
assert_equal(1, Debugger.current_context.stack_size)
|
29
|
+
assert_equal(TestRubyDebug, Debugger.current_context.frame_class)
|
30
|
+
assert_equal(false, Debugger.current_context.dead?, "Not dead yet!")
|
31
|
+
Debugger.stop
|
32
|
+
assert_equal(false, Debugger.started?,
|
33
|
+
"Debugger should no longer be started.")
|
34
|
+
end
|
35
|
+
|
36
|
+
# Test initial variables and setting/getting state.
|
37
|
+
def test_debugger_base
|
38
|
+
assert_equal(false, Debugger.started?,
|
39
|
+
"Debugger should not initially be started.")
|
40
|
+
Debugger.start
|
41
|
+
assert(Debugger.started?,
|
42
|
+
"Debugger should now be started.")
|
43
|
+
assert_equal(false, Debugger.debug,
|
44
|
+
"Debug variable should not be set.")
|
45
|
+
assert_equal(false, Debugger.post_mortem?,
|
46
|
+
"Post mortem debugging should not be set.")
|
47
|
+
a = Debugger.contexts
|
48
|
+
assert_equal(1, a.size,
|
49
|
+
"There should only be one context.")
|
50
|
+
assert_equal(Array, a.class,
|
51
|
+
"Context should be an array.")
|
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
|
+
Debugger.stop
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "test/unit"
|
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
|
8
|
+
|
9
|
+
require File.join(SRC_DIR, "helper.rb")
|
10
|
+
include TestHelper
|
11
|
+
|
12
|
+
# Test of C extension ruby_debug.so
|
13
|
+
class TestSetShow < Test::Unit::TestCase
|
14
|
+
require 'stringio'
|
15
|
+
|
16
|
+
# Test initial variables and setting/getting state.
|
17
|
+
def test_basic
|
18
|
+
Dir.chdir(SRC_DIR) do
|
19
|
+
assert_equal(true,
|
20
|
+
run_debugger("setshow",
|
21
|
+
"--script setshow.cmd -- gcd.rb 3 5"))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "test/unit"
|
3
|
+
require "fileutils"
|
4
|
+
|
5
|
+
# require "rubygems"
|
6
|
+
# require "ruby-debug" ; Debugger.start
|
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
|
13
|
+
|
14
|
+
# Test that linetracing does something.
|
15
|
+
class TestStepping < Test::Unit::TestCase
|
16
|
+
require 'stringio'
|
17
|
+
|
18
|
+
# Test commands in stepping.rb
|
19
|
+
def test_basic
|
20
|
+
Dir.chdir(SRC_DIR) do
|
21
|
+
assert_equal(true,
|
22
|
+
run_debugger("stepping",
|
23
|
+
"--script stepping.cmd -- gcd.rb 3 5"))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
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.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.10.0
|
7
|
+
date: 2007-12-25 00:00:00 -05:00
|
8
8
|
summary: Command line interface (CLI) for ruby-debug-base
|
9
9
|
require_paths:
|
10
10
|
- cli
|
@@ -29,35 +29,76 @@ post_install_message:
|
|
29
29
|
authors:
|
30
30
|
- Kent Sibilev
|
31
31
|
files:
|
32
|
-
- README
|
33
|
-
- LICENSE
|
34
|
-
- CHANGES
|
35
32
|
- AUTHORS
|
36
|
-
-
|
33
|
+
- CHANGES
|
34
|
+
- LICENSE
|
35
|
+
- README
|
36
|
+
- Rakefile
|
37
|
+
- cli/ruby-debug.rb
|
37
38
|
- cli/ruby-debug
|
39
|
+
- cli/ruby-debug/processor.rb
|
40
|
+
- cli/ruby-debug/helper.rb
|
38
41
|
- cli/ruby-debug/command.rb
|
42
|
+
- cli/ruby-debug/debugger.rb
|
43
|
+
- cli/ruby-debug/interface.rb
|
39
44
|
- cli/ruby-debug/commands
|
40
|
-
- cli/ruby-debug/commands/breakpoints.rb
|
41
|
-
- cli/ruby-debug/commands/catchpoint.rb
|
42
|
-
- cli/ruby-debug/commands/control.rb
|
43
|
-
- cli/ruby-debug/commands/display.rb
|
44
|
-
- cli/ruby-debug/commands/eval.rb
|
45
|
-
- cli/ruby-debug/commands/frame.rb
|
46
45
|
- cli/ruby-debug/commands/help.rb
|
47
46
|
- cli/ruby-debug/commands/irb.rb
|
48
|
-
- cli/ruby-debug/commands/list.rb
|
49
|
-
- cli/ruby-debug/commands/method.rb
|
50
47
|
- cli/ruby-debug/commands/script.rb
|
51
|
-
- cli/ruby-debug/commands/
|
48
|
+
- cli/ruby-debug/commands/list.rb
|
49
|
+
- cli/ruby-debug/commands/control.rb
|
50
|
+
- cli/ruby-debug/commands/display.rb
|
51
|
+
- cli/ruby-debug/commands/eval.rb
|
52
52
|
- cli/ruby-debug/commands/stepping.rb
|
53
53
|
- cli/ruby-debug/commands/threads.rb
|
54
|
+
- cli/ruby-debug/commands/frame.rb
|
55
|
+
- cli/ruby-debug/commands/catchpoint.rb
|
56
|
+
- cli/ruby-debug/commands/variables.rb
|
57
|
+
- cli/ruby-debug/commands/info.rb
|
58
|
+
- cli/ruby-debug/commands/method.rb
|
54
59
|
- cli/ruby-debug/commands/tmate.rb
|
60
|
+
- cli/ruby-debug/commands/settings.rb
|
61
|
+
- cli/ruby-debug/commands/breakpoints.rb
|
62
|
+
- cli/ruby-debug/commands/show.rb
|
55
63
|
- cli/ruby-debug/commands/trace.rb
|
56
|
-
- cli/ruby-debug/commands/
|
57
|
-
-
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
64
|
+
- cli/ruby-debug/commands/enable.rb
|
65
|
+
- ChangeLog
|
66
|
+
- bin/rdebug
|
67
|
+
- doc/rdebug.1
|
68
|
+
- test/breakpoints.cmd
|
69
|
+
- test/info.cmd
|
70
|
+
- test/help.cmd
|
71
|
+
- test/quit.cmd
|
72
|
+
- test/display.cmd
|
73
|
+
- test/info-var.cmd
|
74
|
+
- test/stepping.cmd
|
75
|
+
- test/frame.cmd
|
76
|
+
- test/setshow.cmd
|
77
|
+
- test/stepping.right
|
78
|
+
- test/info.right
|
79
|
+
- test/setshow.right
|
80
|
+
- test/info-var.right
|
81
|
+
- test/help.right
|
82
|
+
- test/quit.right
|
83
|
+
- test/frame.right
|
84
|
+
- test/breakpoints.right
|
85
|
+
- test/display.right
|
86
|
+
- test/gcd.rb
|
87
|
+
- test/helper.rb
|
88
|
+
- test/info-var-bug.rb
|
89
|
+
- test/tdebug.rb
|
90
|
+
- runner.sh
|
91
|
+
- test/test-help.rb
|
92
|
+
- test/test-stepping.rb
|
93
|
+
- test/test-quit.rb
|
94
|
+
- test/test-display.rb
|
95
|
+
- test/test-info.rb
|
96
|
+
- test/test-frame.rb
|
97
|
+
- test/test-columnize.rb
|
98
|
+
- test/test-info-var.rb
|
99
|
+
- test/test-ruby-debug-base.rb
|
100
|
+
- test/test-breakpoints.rb
|
101
|
+
- test/test-setshow.rb
|
61
102
|
test_files: []
|
62
103
|
|
63
104
|
rdoc_options: []
|
@@ -78,5 +119,5 @@ dependencies:
|
|
78
119
|
requirements:
|
79
120
|
- - "="
|
80
121
|
- !ruby/object:Gem::Version
|
81
|
-
version: 0.
|
122
|
+
version: 0.10.0
|
82
123
|
version:
|