ruby-debug-base 0.10.5.rc1 → 0.10.5.rc2
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/Rakefile +34 -239
- data/lib/ruby-debug-base/version.rb +1 -1
- metadata +75 -88
- data/test/base/base.rb +0 -77
- data/test/base/binding.rb +0 -22
- data/test/base/catchpoint.rb +0 -19
- data/test/base/load.rb +0 -44
- data/test/base/reload_bug.rb +0 -8
data/Rakefile
CHANGED
@@ -7,82 +7,33 @@ require 'rake/testtask'
|
|
7
7
|
require 'rake/extensiontask'
|
8
8
|
require 'rake/javaextensiontask'
|
9
9
|
|
10
|
-
|
10
|
+
lib = File.expand_path('../lib', __FILE__)
|
11
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
11
12
|
require "ruby-debug-base/version"
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
'README',
|
22
|
-
'Rakefile',
|
23
|
-
]
|
24
|
-
|
25
|
-
CLI_TEST_FILE_LIST = FileList['test/cli/commands/unit/*.rb',
|
26
|
-
'test/cli/commands/*_test.rb',
|
27
|
-
'test/cli/**/*_test.rb',
|
28
|
-
'test/test-*.rb']
|
29
|
-
CLI_FILES = COMMON_FILES + FileList[
|
30
|
-
"cli/**/*",
|
31
|
-
'ChangeLog',
|
32
|
-
'bin/*',
|
33
|
-
'doc/rdebug.1',
|
34
|
-
'test/rdebug-save.1',
|
35
|
-
'test/**/data/*.cmd',
|
36
|
-
'test/**/data/*.right',
|
37
|
-
'test/**/example/*.rb',
|
38
|
-
'test/config.yaml',
|
39
|
-
'test/**/*.rb',
|
40
|
-
'rdbg.rb',
|
41
|
-
CLI_TEST_FILE_LIST
|
42
|
-
]
|
43
|
-
|
44
|
-
BASE_TEST_FILE_LIST = FileList['test/base/*.rb']
|
45
|
-
|
46
|
-
BASE_FILES = COMMON_FILES + FileList[
|
47
|
-
'ext/breakpoint.c',
|
48
|
-
'ext/extconf.rb',
|
49
|
-
'ext/ruby_debug.c',
|
50
|
-
'ext/ruby_debug.h',
|
51
|
-
'ext/win32/*',
|
52
|
-
'lib/ruby-debug-base.rb',
|
53
|
-
'lib/ruby-debug-base/version.rb',
|
54
|
-
BASE_TEST_FILE_LIST,
|
55
|
-
]
|
56
|
-
|
57
|
-
ext = File.join(ROOT_DIR, 'ext')
|
58
|
-
|
59
|
-
desc "Test everything."
|
60
|
-
Rake::TestTask.new(:test) do |t|
|
61
|
-
t.libs += %W(#{ROOT_DIR}/lib #{ROOT_DIR}/cli)
|
62
|
-
t.libs << ext if File.exist?(ext)
|
63
|
-
t.test_files = CLI_TEST_FILE_LIST
|
64
|
-
t.options = '--verbose' if $VERBOSE
|
65
|
-
t.ruby_opts << "--debug" if defined?(JRUBY_VERSION)
|
66
|
-
end
|
67
|
-
|
68
|
-
task :test => :test_base if File.exist?(ext)
|
69
|
-
|
70
|
-
desc "Test ruby-debug-base."
|
71
|
-
Rake::TestTask.new(:test_base) do |t|
|
72
|
-
t.libs += ['./ext', './lib']
|
73
|
-
t.test_files = FileList[BASE_TEST_FILE_LIST]
|
74
|
-
t.options = '--verbose' if $VERBOSE
|
75
|
-
t.ruby_opts << "--debug" if defined?(JRUBY_VERSION)
|
76
|
-
end
|
14
|
+
namespace :test do
|
15
|
+
desc "Test ruby-debug-base"
|
16
|
+
Rake::TestTask.new(:base => :compile) do |t|
|
17
|
+
t.libs += %w(./ext ./lib)
|
18
|
+
t.test_files = FileList['test/base/*.rb']
|
19
|
+
t.options = '--verbose' if $VERBOSE
|
20
|
+
t.ruby_opts << "--debug" if defined?(JRUBY_VERSION)
|
21
|
+
end
|
77
22
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
23
|
+
desc "Test ruby-debug"
|
24
|
+
Rake::TestTask.new(:cli => :compile) do |t|
|
25
|
+
t.libs += %W(./lib ./cli ./ext)
|
26
|
+
t.test_files = FileList['test/cli/commands/unit/*.rb',
|
27
|
+
'test/cli/commands/*_test.rb',
|
28
|
+
'test/cli/**/*_test.rb',
|
29
|
+
'test/test-*.rb']
|
30
|
+
t.options = '--verbose' if $VERBOSE
|
31
|
+
t.ruby_opts << "--debug" if defined?(JRUBY_VERSION)
|
32
|
+
end
|
82
33
|
end
|
83
34
|
|
84
|
-
desc "Test everything
|
85
|
-
task :
|
35
|
+
desc "Test everything"
|
36
|
+
task :test => %w(test:base test:cli)
|
86
37
|
|
87
38
|
desc "Create a GNU-style ChangeLog via svn2cl"
|
88
39
|
task :ChangeLog do
|
@@ -91,123 +42,24 @@ task :ChangeLog do
|
|
91
42
|
system('git log --pretty --numstat --summary lib | git2cl > lib/ChangeLog')
|
92
43
|
end
|
93
44
|
|
94
|
-
|
95
|
-
|
96
|
-
spec.name = "ruby-debug-base"
|
97
|
-
|
98
|
-
spec.homepage = "http://rubyforge.org/projects/ruby-debug/"
|
99
|
-
spec.summary = "Fast Ruby debugger - core component"
|
100
|
-
spec.description = <<-EOF
|
101
|
-
ruby-debug is a fast implementation of the standard Ruby debugger debug.rb.
|
102
|
-
It is implemented by utilizing a new Ruby C API hook. The core component
|
103
|
-
provides support that front-ends can build on. It provides breakpoint
|
104
|
-
handling, bindings for stack frames among other things.
|
105
|
-
EOF
|
106
|
-
|
107
|
-
spec.version = Debugger::VERSION
|
45
|
+
base_spec = Gem::Specification.load("ruby-debug-base.gemspec")
|
46
|
+
cli_spec = Gem::Specification.load("ruby-debug.gemspec")
|
108
47
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
spec.date = Time.now
|
118
|
-
spec.rubyforge_project = 'ruby-debug'
|
119
|
-
spec.add_dependency('linecache', '>= 0.3')
|
120
|
-
spec.add_development_dependency('rake-compiler')
|
121
|
-
|
122
|
-
spec.test_files = FileList[BASE_TEST_FILE_LIST]
|
123
|
-
|
124
|
-
# rdoc
|
125
|
-
spec.has_rdoc = true
|
126
|
-
spec.extra_rdoc_files = ['README', 'ext/ruby_debug.c']
|
127
|
-
end
|
128
|
-
|
129
|
-
cli_spec = Gem::Specification.new do |spec|
|
130
|
-
spec.name = "ruby-debug"
|
131
|
-
|
132
|
-
spec.homepage = "http://rubyforge.org/projects/ruby-debug/"
|
133
|
-
spec.summary = "Command line interface (CLI) for ruby-debug-base"
|
134
|
-
spec.description = <<-EOF
|
135
|
-
A generic command line interface for ruby-debug.
|
136
|
-
EOF
|
137
|
-
|
138
|
-
spec.version = Debugger::VERSION
|
139
|
-
|
140
|
-
spec.author = "Kent Sibilev"
|
141
|
-
spec.email = "ksibilev@yahoo.com"
|
142
|
-
spec.platform = Gem::Platform::RUBY
|
143
|
-
spec.require_path = "cli"
|
144
|
-
spec.bindir = "bin"
|
145
|
-
spec.executables = ["rdebug"]
|
146
|
-
spec.files = CLI_FILES.to_a
|
147
|
-
|
148
|
-
spec.required_ruby_version = '>= 1.8.2'
|
149
|
-
spec.date = Time.now
|
150
|
-
spec.rubyforge_project = 'ruby-debug'
|
151
|
-
spec.add_dependency('columnize', '>= 0.1')
|
152
|
-
spec.add_dependency('ruby-debug-base', "~> #{Debugger::VERSION}.0")
|
153
|
-
|
154
|
-
# FIXME: work out operational logistics for this
|
155
|
-
# spec.test_files = FileList[CLI_TEST_FILE_LIST]
|
156
|
-
|
157
|
-
# rdoc
|
158
|
-
spec.has_rdoc = true
|
159
|
-
spec.extra_rdoc_files = ['README']
|
160
|
-
end
|
161
|
-
|
162
|
-
# Rake task to build the default package
|
163
|
-
Gem::PackageTask.new(base_spec) do |pkg|
|
164
|
-
pkg.need_tar = true
|
165
|
-
end
|
166
|
-
Gem::PackageTask.new(cli_spec) do |pkg|
|
167
|
-
pkg.need_tar = true
|
48
|
+
if defined?(JRUBY_VERSION)
|
49
|
+
Rake::JavaExtensionTask.new('ruby_debug', base_spec) do |t|
|
50
|
+
t.ext_dir = "src"
|
51
|
+
end
|
52
|
+
else
|
53
|
+
Rake::ExtensionTask.new('ruby_debug', base_spec) do |t|
|
54
|
+
t.ext_dir = "ext"
|
55
|
+
end
|
168
56
|
end
|
169
57
|
|
170
|
-
|
171
|
-
|
172
|
-
end
|
58
|
+
Gem::PackageTask.new(base_spec) {}
|
59
|
+
Gem::PackageTask.new(cli_spec) {}
|
173
60
|
|
174
61
|
task :default => :test
|
175
62
|
|
176
|
-
# Windows specification
|
177
|
-
win_spec = base_spec.clone
|
178
|
-
win_spec.extensions = []
|
179
|
-
## win_spec.platform = Gem::Platform::WIN32 # deprecated
|
180
|
-
win_spec.platform = 'mswin32'
|
181
|
-
win_spec.files += ["lib/#{SO_NAME}"]
|
182
|
-
|
183
|
-
desc "Create Windows Gem"
|
184
|
-
task :win32_gem do
|
185
|
-
# Copy the win32 extension the top level directory
|
186
|
-
current_dir = File.expand_path(File.dirname(__FILE__))
|
187
|
-
source = File.join(current_dir, "ext", "win32", SO_NAME)
|
188
|
-
target = File.join(current_dir, "lib", SO_NAME)
|
189
|
-
cp(source, target)
|
190
|
-
|
191
|
-
# Create the gem, then move it to pkg.
|
192
|
-
Gem::Builder.new(win_spec).build
|
193
|
-
gem_file = "#{win_spec.name}-#{win_spec.version}-#{win_spec.platform}.gem"
|
194
|
-
mv(gem_file, "pkg/#{gem_file}")
|
195
|
-
|
196
|
-
# Remove win extension from top level directory.
|
197
|
-
rm(target)
|
198
|
-
end
|
199
|
-
|
200
|
-
desc "Publish ruby-debug to RubyForge."
|
201
|
-
task :publish do
|
202
|
-
require 'rake/contrib/sshpublisher'
|
203
|
-
|
204
|
-
# Get ruby-debug path.
|
205
|
-
ruby_debug_path = File.expand_path(File.dirname(__FILE__))
|
206
|
-
|
207
|
-
Rake::SshDirPublisher.new("kent@rubyforge.org",
|
208
|
-
"/var/www/gforge-projects/ruby-debug", ruby_debug_path)
|
209
|
-
end
|
210
|
-
|
211
63
|
desc "Remove built files"
|
212
64
|
task :clean do
|
213
65
|
cd "ext" do
|
@@ -221,7 +73,6 @@ task :clean do
|
|
221
73
|
rm 'lib/ruby_debug.jar' if File.exists?("lib/ruby_debug.jar")
|
222
74
|
end
|
223
75
|
|
224
|
-
# --------- RDoc Documentation ------
|
225
76
|
desc "Generate rdoc documentation"
|
226
77
|
RDoc::Task.new("rdoc") do |rdoc|
|
227
78
|
rdoc.rdoc_dir = 'doc/rdoc'
|
@@ -238,59 +89,3 @@ RDoc::Task.new("rdoc") do |rdoc|
|
|
238
89
|
'README',
|
239
90
|
'LICENSE')
|
240
91
|
end
|
241
|
-
|
242
|
-
desc "Publish the release files to RubyForge."
|
243
|
-
task :rubyforge_upload do
|
244
|
-
`rubyforge login`
|
245
|
-
release_command = "rubyforge add_release #{PKG_NAME} #{PKG_NAME} '#{PKG_NAME}-#{PKG_VERSION}' pkg/#{PKG_NAME}-#{PKG_VERSION}.gem"
|
246
|
-
puts release_command
|
247
|
-
system(release_command)
|
248
|
-
end
|
249
|
-
|
250
|
-
PKG_NAME = 'ruby-debug'
|
251
|
-
desc "Publish the release files to RubyForge."
|
252
|
-
task :rubyforge_upload do
|
253
|
-
`rubyforge login`
|
254
|
-
for pkg_name in ['ruby-debug', 'ruby-debug-base'] do
|
255
|
-
pkg_file_name = "#{pkg_name}-#{pkg_version}"
|
256
|
-
release_command = "rubyforge add_release ruby-debug #{pkg_name} '#{pkg_file_name}' pkg/#{pkg_file_name}.gem"
|
257
|
-
puts release_command
|
258
|
-
system(release_command)
|
259
|
-
end
|
260
|
-
end
|
261
|
-
|
262
|
-
def install_gem(spec, *opts)
|
263
|
-
args = ['gem', 'install', "pkg/#{spec.name}-#{spec.version}.gem"] + opts
|
264
|
-
args.unshift 'sudo' unless 0 == Process.uid || ENV['rvm_path']
|
265
|
-
system(*args)
|
266
|
-
end
|
267
|
-
|
268
|
-
desc 'Install locally'
|
269
|
-
task :install => :package do
|
270
|
-
Dir.chdir(File::dirname(__FILE__)) do
|
271
|
-
# ri and rdoc take lots of time
|
272
|
-
install_gem(base_spec, '--no-ri', '--no-rdoc')
|
273
|
-
install_gem(cli_spec, '--no-ri', '--no-rdoc')
|
274
|
-
end
|
275
|
-
end
|
276
|
-
|
277
|
-
task :install_full => :package do
|
278
|
-
Dir.chdir(File::dirname(__FILE__)) do
|
279
|
-
install_gem(base_spec)
|
280
|
-
install_gem(cli_spec)
|
281
|
-
end
|
282
|
-
end
|
283
|
-
|
284
|
-
namespace :jruby do
|
285
|
-
jruby_spec = base_spec.clone
|
286
|
-
jruby_spec.platform = "java"
|
287
|
-
jruby_spec.files = jruby_spec.files.reject {|f| f =~ /^ext/ }
|
288
|
-
jruby_spec.files += ['lib/ruby_debug.jar']
|
289
|
-
jruby_spec.extensions = []
|
290
|
-
|
291
|
-
Gem::PackageTask.new(jruby_spec) {}
|
292
|
-
|
293
|
-
Rake::JavaExtensionTask.new('ruby_debug') do |t|
|
294
|
-
t.ext_dir = "src"
|
295
|
-
end
|
296
|
-
end
|
metadata
CHANGED
@@ -1,126 +1,113 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-debug-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 15424159
|
5
4
|
prerelease: 7
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 10
|
9
|
-
- 5
|
10
|
-
- rc
|
11
|
-
- 1
|
12
|
-
version: 0.10.5.rc1
|
5
|
+
version: 0.10.5.rc2
|
13
6
|
platform: ruby
|
14
7
|
authors:
|
15
|
-
- Kent Sibilev
|
8
|
+
- Kent Sibilev
|
16
9
|
autorequire:
|
17
10
|
bindir: bin
|
18
11
|
cert_chain: []
|
19
12
|
|
20
|
-
date:
|
21
|
-
default_executable:
|
13
|
+
date: 2012-07-19 00:00:00 Z
|
22
14
|
dependencies:
|
23
|
-
- !ruby/object:Gem::Dependency
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: linecache
|
17
|
+
prerelease: false
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ~>
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0.46"
|
24
|
+
type: :runtime
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rake
|
28
|
+
prerelease: false
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "0"
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id002
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rdoc
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: "0"
|
46
|
+
type: :development
|
47
|
+
version_requirements: *id003
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rake-compiler
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ~>
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 0.8.1
|
57
|
+
type: :development
|
58
|
+
version_requirements: *id004
|
52
59
|
description: |
|
53
60
|
ruby-debug is a fast implementation of the standard Ruby debugger debug.rb.
|
54
|
-
It is implemented by utilizing a new Ruby C API hook. The core component
|
55
|
-
provides support that front-ends can build on. It provides breakpoint
|
61
|
+
It is implemented by utilizing a new Ruby C API hook. The core component
|
62
|
+
provides support that front-ends can build on. It provides breakpoint
|
56
63
|
handling, bindings for stack frames among other things.
|
57
64
|
|
58
65
|
email: ksibilev@yahoo.com
|
59
66
|
executables: []
|
60
67
|
|
61
68
|
extensions:
|
62
|
-
- ext/extconf.rb
|
69
|
+
- ext/extconf.rb
|
63
70
|
extra_rdoc_files:
|
64
|
-
- README
|
65
|
-
- ext/ruby_debug.c
|
71
|
+
- README
|
72
|
+
- ext/ruby_debug.c
|
66
73
|
files:
|
67
|
-
- AUTHORS
|
68
|
-
- CHANGES
|
69
|
-
- LICENSE
|
70
|
-
- README
|
71
|
-
- Rakefile
|
72
|
-
- ext/breakpoint.c
|
73
|
-
- ext/extconf.rb
|
74
|
-
- ext/ruby_debug.c
|
75
|
-
- ext/ruby_debug.h
|
76
|
-
- lib/ruby-debug-base.rb
|
77
|
-
- lib/ruby-debug-base/version.rb
|
78
|
-
|
79
|
-
- test/base/binding.rb
|
80
|
-
- test/base/catchpoint.rb
|
81
|
-
- test/base/load.rb
|
82
|
-
- test/base/reload_bug.rb
|
83
|
-
has_rdoc: true
|
84
|
-
homepage: http://rubyforge.org/projects/ruby-debug/
|
74
|
+
- AUTHORS
|
75
|
+
- CHANGES
|
76
|
+
- LICENSE
|
77
|
+
- README
|
78
|
+
- Rakefile
|
79
|
+
- ext/breakpoint.c
|
80
|
+
- ext/extconf.rb
|
81
|
+
- ext/ruby_debug.c
|
82
|
+
- ext/ruby_debug.h
|
83
|
+
- lib/ruby-debug-base.rb
|
84
|
+
- lib/ruby-debug-base/version.rb
|
85
|
+
homepage: https://github.com/ruby-debug/
|
85
86
|
licenses: []
|
86
87
|
|
87
88
|
post_install_message:
|
88
89
|
rdoc_options: []
|
89
90
|
|
90
91
|
require_paths:
|
91
|
-
- lib
|
92
|
+
- lib
|
92
93
|
required_ruby_version: !ruby/object:Gem::Requirement
|
93
94
|
none: false
|
94
95
|
requirements:
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
segments:
|
99
|
-
- 1
|
100
|
-
- 8
|
101
|
-
- 2
|
102
|
-
version: 1.8.2
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: "0"
|
103
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
100
|
none: false
|
105
101
|
requirements:
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
segments:
|
110
|
-
- 1
|
111
|
-
- 3
|
112
|
-
- 1
|
113
|
-
version: 1.3.1
|
102
|
+
- - ">"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: 1.3.1
|
114
105
|
requirements: []
|
115
106
|
|
116
|
-
rubyforge_project:
|
117
|
-
rubygems_version: 1.
|
107
|
+
rubyforge_project:
|
108
|
+
rubygems_version: 1.8.24
|
118
109
|
signing_key:
|
119
110
|
specification_version: 3
|
120
111
|
summary: Fast Ruby debugger - core component
|
121
|
-
test_files:
|
122
|
-
|
123
|
-
- test/base/binding.rb
|
124
|
-
- test/base/catchpoint.rb
|
125
|
-
- test/base/load.rb
|
126
|
-
- test/base/reload_bug.rb
|
112
|
+
test_files: []
|
113
|
+
|
data/test/base/base.rb
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require File.expand_path("../../helper", __FILE__)
|
3
|
-
|
4
|
-
# Some tests of Debugger module in C extension ruby_debug
|
5
|
-
class TestRubyDebug < Test::Unit::TestCase
|
6
|
-
def test_version
|
7
|
-
assert(defined?(Debugger::VERSION))
|
8
|
-
end
|
9
|
-
|
10
|
-
# test current_context
|
11
|
-
def test_current_context
|
12
|
-
assert_equal(false, Debugger.started?,
|
13
|
-
'debugger should not initially be started.')
|
14
|
-
Debugger.start_
|
15
|
-
assert(Debugger.started?,
|
16
|
-
'debugger should now be started.')
|
17
|
-
assert_equal(__LINE__, Debugger.current_context.frame_line)
|
18
|
-
assert_equal(nil, Debugger.current_context.frame_args_info,
|
19
|
-
'no frame args info.')
|
20
|
-
assert_equal(Debugger.current_context.frame_file,
|
21
|
-
Debugger.current_context.frame_file(0))
|
22
|
-
assert_equal(File.basename(__FILE__),
|
23
|
-
File.basename(Debugger.current_context.frame_file))
|
24
|
-
assert_raises(ArgumentError) {Debugger.current_context.frame_file(1, 2)}
|
25
|
-
assert_raises(ArgumentError) {Debugger.current_context.frame_file(10)}
|
26
|
-
assert_equal(1, Debugger.current_context.stack_size)
|
27
|
-
assert_equal(TestRubyDebug, Debugger.current_context.frame_class)
|
28
|
-
assert_equal(false, Debugger.current_context.dead?, 'Not dead yet!')
|
29
|
-
ensure
|
30
|
-
Debugger.stop
|
31
|
-
assert_equal(false, Debugger.started?,
|
32
|
-
'Debugger should no longer be started.')
|
33
|
-
end
|
34
|
-
|
35
|
-
# Test initial variables and setting/getting state.
|
36
|
-
def test_debugger_base
|
37
|
-
assert_equal(false, Debugger.started?,
|
38
|
-
'Debugger should not initially be started.')
|
39
|
-
Debugger.start_
|
40
|
-
assert(Debugger.started?,
|
41
|
-
'Debugger should now be started.')
|
42
|
-
assert_equal(false, Debugger.debug,
|
43
|
-
'Debug variable should not be set.')
|
44
|
-
assert_equal(false, Debugger.post_mortem?,
|
45
|
-
'Post mortem debugging should not be set.')
|
46
|
-
a = Debugger.contexts
|
47
|
-
assert_equal(1, a.size,
|
48
|
-
'There should only be one context.')
|
49
|
-
assert_equal(Array, a.class,
|
50
|
-
'Context should be an array.')
|
51
|
-
ensure
|
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
|
-
ensure
|
74
|
-
Debugger.stop
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
data/test/base/binding.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require File.expand_path("../../helper", __FILE__)
|
3
|
-
|
4
|
-
# Test binding_n command
|
5
|
-
class TestBinding < Test::Unit::TestCase
|
6
|
-
def test_basic
|
7
|
-
def inside_fn
|
8
|
-
s = 'some other string'
|
9
|
-
b2 = Kernel::binding_n(1)
|
10
|
-
y2 = eval('s', b2)
|
11
|
-
assert_equal('this is a test', y2)
|
12
|
-
end
|
13
|
-
s = 'this is a test'
|
14
|
-
Debugger.start
|
15
|
-
b = Kernel::binding_n(0)
|
16
|
-
y = eval('s', b)
|
17
|
-
assert_equal(s, y)
|
18
|
-
inside_fn
|
19
|
-
ensure
|
20
|
-
Debugger.stop
|
21
|
-
end
|
22
|
-
end
|
data/test/base/catchpoint.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require File.expand_path("../../helper", __FILE__)
|
3
|
-
|
4
|
-
# Test catchpoint in C ruby_debug extension.
|
5
|
-
|
6
|
-
class TestRubyDebugCatchpoint < Test::Unit::TestCase
|
7
|
-
def test_catchpoints
|
8
|
-
assert_raise(RuntimeError) {Debugger.catchpoints}
|
9
|
-
Debugger.start_
|
10
|
-
assert_equal({}, Debugger.catchpoints)
|
11
|
-
Debugger.add_catchpoint('ZeroDivisionError')
|
12
|
-
assert_equal({'ZeroDivisionError' => 0}, Debugger.catchpoints)
|
13
|
-
Debugger.add_catchpoint('RuntimeError')
|
14
|
-
assert_equal(['RuntimeError', 'ZeroDivisionError'],
|
15
|
-
Debugger.catchpoints.keys.sort)
|
16
|
-
ensure
|
17
|
-
Debugger.stop
|
18
|
-
end
|
19
|
-
end
|
data/test/base/load.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require File.expand_path("../../helper", __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
|