debase 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/LICENSE +23 -0
- data/MIT_LICENSE +22 -0
- data/README +22 -0
- data/Rakefile +34 -0
- data/debase.gemspec +30 -0
- data/ext/breakpoint.c +233 -0
- data/ext/context.c +377 -0
- data/ext/debase_internals.c +427 -0
- data/ext/debase_internals.h +94 -0
- data/ext/extconf.rb +14 -0
- data/ext/locker.c +52 -0
- data/lib/debase.rb +57 -0
- data/lib/debase/context.rb +44 -0
- data/lib/debase/version.rb +3 -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/example/bp_loop_issue.rb +3 -0
- data/test/example/breakpoints-basename.rb +2 -0
- data/test/example/brkpt-class-bug.rb +8 -0
- data/test/example/classes.rb +11 -0
- data/test/example/dollar-0.rb +6 -0
- data/test/example/except-bug1.rb +4 -0
- data/test/example/file with space.rb +1 -0
- data/test/example/gcd.rb +18 -0
- data/test/example/info-var-bug.rb +47 -0
- data/test/example/info-var-bug2.rb +2 -0
- data/test/example/null.rb +1 -0
- data/test/example/output.rb +2 -0
- data/test/example/pm-bug.rb +3 -0
- data/test/example/pm.rb +11 -0
- data/test/example/raise.rb +3 -0
- data/test/helper.rb +2 -0
- data/test/test_base.rb +77 -0
- data/test/test_breakpoints.rb +14 -0
- data/test/test_catchpoint.rb +19 -0
- data/test/test_load.rb +44 -0
- data/test/test_reload_bug.rb +8 -0
- metadata +142 -0
data/test/test_load.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require File.expand_path("helper", File.dirname(__FILE__))
|
3
|
+
|
4
|
+
# Test of Debugger.debug_load in C extension ruby_debug.so
|
5
|
+
class TestDebugLoad < Test::Unit::TestCase
|
6
|
+
class << self
|
7
|
+
def at_line(file, line)
|
8
|
+
@@at_line = [File.basename(file), line]
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class Debugger::Context
|
13
|
+
def at_line(file, line)
|
14
|
+
TestDebugLoad::at_line(file, line)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_debug_load
|
19
|
+
src_dir = File.dirname(__FILE__)
|
20
|
+
prog_script = File.join(src_dir, 'example', 'gcd.rb')
|
21
|
+
|
22
|
+
# Without stopping
|
23
|
+
bt = Debugger.debug_load(prog_script, false)
|
24
|
+
assert_equal(nil, bt)
|
25
|
+
assert(Debugger.started?)
|
26
|
+
Debugger.stop
|
27
|
+
|
28
|
+
# With stopping
|
29
|
+
bt = Debugger.debug_load(prog_script, true)
|
30
|
+
assert_equal(nil, bt)
|
31
|
+
assert_equal(['gcd.rb', 4], @@at_line)
|
32
|
+
assert(Debugger.started?)
|
33
|
+
Debugger.stop
|
34
|
+
|
35
|
+
# Test that we get a proper backtrace on a script that raises 'abc'
|
36
|
+
prog_script = File.join(src_dir, 'example', 'raise.rb')
|
37
|
+
bt = Debugger.debug_load(prog_script, false)
|
38
|
+
assert_equal('abc', bt.to_s)
|
39
|
+
assert(Debugger.started?)
|
40
|
+
Debugger.stop
|
41
|
+
ensure
|
42
|
+
Debugger.stop if Debugger.started?
|
43
|
+
end
|
44
|
+
end
|
metadata
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: debase
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dennis Ushakov
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-02-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: test-unit
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: |2
|
42
|
+
debase is a fast implementation of the standard Ruby debugger debug.rb for Ruby 2.0.
|
43
|
+
It is implemented by utilizing a new Ruby TracePoint class. The core component
|
44
|
+
provides support that front-ends can build on. It provides breakpoint
|
45
|
+
handling, bindings for stack frames among other things.
|
46
|
+
email:
|
47
|
+
- dennis.ushakov@gmail.com
|
48
|
+
executables: []
|
49
|
+
extensions:
|
50
|
+
- ext/extconf.rb
|
51
|
+
extra_rdoc_files: []
|
52
|
+
files:
|
53
|
+
- .gitignore
|
54
|
+
- .travis.yml
|
55
|
+
- Gemfile
|
56
|
+
- LICENSE
|
57
|
+
- MIT_LICENSE
|
58
|
+
- README
|
59
|
+
- Rakefile
|
60
|
+
- debase.gemspec
|
61
|
+
- ext/breakpoint.c
|
62
|
+
- ext/context.c
|
63
|
+
- ext/debase_internals.c
|
64
|
+
- ext/debase_internals.h
|
65
|
+
- ext/extconf.rb
|
66
|
+
- ext/locker.c
|
67
|
+
- lib/debase.rb
|
68
|
+
- lib/debase/context.rb
|
69
|
+
- lib/debase/version.rb
|
70
|
+
- test/example/a/example.rb
|
71
|
+
- test/example/at-exit.rb
|
72
|
+
- test/example/b/example.rb
|
73
|
+
- test/example/bp_loop_issue.rb
|
74
|
+
- test/example/breakpoints-basename.rb
|
75
|
+
- test/example/brkpt-class-bug.rb
|
76
|
+
- test/example/classes.rb
|
77
|
+
- test/example/dollar-0.rb
|
78
|
+
- test/example/except-bug1.rb
|
79
|
+
- test/example/file with space.rb
|
80
|
+
- test/example/gcd.rb
|
81
|
+
- test/example/info-var-bug.rb
|
82
|
+
- test/example/info-var-bug2.rb
|
83
|
+
- test/example/null.rb
|
84
|
+
- test/example/output.rb
|
85
|
+
- test/example/pm-bug.rb
|
86
|
+
- test/example/pm.rb
|
87
|
+
- test/example/raise.rb
|
88
|
+
- test/helper.rb
|
89
|
+
- test/test_base.rb
|
90
|
+
- test/test_breakpoints.rb
|
91
|
+
- test/test_catchpoint.rb
|
92
|
+
- test/test_load.rb
|
93
|
+
- test/test_reload_bug.rb
|
94
|
+
homepage: ''
|
95
|
+
licenses: []
|
96
|
+
metadata: {}
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - '>='
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project: debase
|
113
|
+
rubygems_version: 2.0.0
|
114
|
+
signing_key:
|
115
|
+
specification_version: 4
|
116
|
+
summary: debase is a fast implementation of the standard Ruby debugger debug.rb for
|
117
|
+
Ruby 2.0
|
118
|
+
test_files:
|
119
|
+
- test/example/a/example.rb
|
120
|
+
- test/example/at-exit.rb
|
121
|
+
- test/example/b/example.rb
|
122
|
+
- test/example/bp_loop_issue.rb
|
123
|
+
- test/example/breakpoints-basename.rb
|
124
|
+
- test/example/brkpt-class-bug.rb
|
125
|
+
- test/example/classes.rb
|
126
|
+
- test/example/dollar-0.rb
|
127
|
+
- test/example/except-bug1.rb
|
128
|
+
- test/example/file with space.rb
|
129
|
+
- test/example/gcd.rb
|
130
|
+
- test/example/info-var-bug.rb
|
131
|
+
- test/example/info-var-bug2.rb
|
132
|
+
- test/example/null.rb
|
133
|
+
- test/example/output.rb
|
134
|
+
- test/example/pm-bug.rb
|
135
|
+
- test/example/pm.rb
|
136
|
+
- test/example/raise.rb
|
137
|
+
- test/helper.rb
|
138
|
+
- test/test_base.rb
|
139
|
+
- test/test_breakpoints.rb
|
140
|
+
- test/test_catchpoint.rb
|
141
|
+
- test/test_load.rb
|
142
|
+
- test/test_reload_bug.rb
|