ruby-debug-base 0.10.4-java → 0.10.5.rc1-java
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +7 -1
- data/CHANGES +366 -0
- data/LICENSE +23 -0
- data/README +115 -23
- data/Rakefile +249 -127
- data/ext/extconf.rb +23 -0
- data/ext/ruby_debug.c +2323 -0
- data/lib/ruby-debug-base/version.rb +3 -0
- data/lib/ruby-debug-base.rb +63 -32
- data/lib/ruby_debug.jar +0 -0
- data/test/base/base.rb +77 -0
- data/test/base/binding.rb +22 -0
- data/test/base/catchpoint.rb +19 -0
- data/test/base/load.rb +44 -0
- data/test/base/reload_bug.rb +8 -0
- metadata +60 -35
- data/ChangeLog +0 -864
- data/MIT-LICENSE +0 -21
- data/lib/linecache-ruby.rb +0 -12
- data/lib/linecache.rb +0 -408
- data/lib/tracelines.rb +0 -45
data/Rakefile
CHANGED
@@ -1,174 +1,296 @@
|
|
1
|
-
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# -*- Ruby -*-
|
2
3
|
require 'rubygems'
|
3
|
-
require '
|
4
|
-
require '
|
4
|
+
require 'rubygems/package_task'
|
5
|
+
require 'rdoc/task'
|
5
6
|
require 'rake/testtask'
|
6
|
-
require 'rake/
|
7
|
+
require 'rake/extensiontask'
|
8
|
+
require 'rake/javaextensiontask'
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
+
$:.push File.expand_path("../lib", __FILE__)
|
11
|
+
require "ruby-debug-base/version"
|
10
12
|
|
11
|
-
|
13
|
+
SO_NAME = "ruby_debug.so"
|
14
|
+
ROOT_DIR = File.dirname(__FILE__)
|
12
15
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
DIST_FILES = FileList[
|
16
|
+
# ------- Default Package ----------
|
17
|
+
COMMON_FILES = FileList[
|
17
18
|
'AUTHORS',
|
19
|
+
'CHANGES',
|
20
|
+
'LICENSE',
|
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/**/*",
|
18
31
|
'ChangeLog',
|
19
|
-
'
|
20
|
-
'
|
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/*',
|
21
52
|
'lib/ruby-debug-base.rb',
|
22
|
-
'lib/
|
23
|
-
|
24
|
-
'MIT-LICENSE',
|
25
|
-
'Rakefile',
|
26
|
-
'README'
|
53
|
+
'lib/ruby-debug-base/version.rb',
|
54
|
+
BASE_TEST_FILE_LIST,
|
27
55
|
]
|
28
56
|
|
29
|
-
|
30
|
-
test/base/base.rb
|
31
|
-
test/base/binding.rb
|
32
|
-
test/base/catchpoint.rb)
|
57
|
+
ext = File.join(ROOT_DIR, 'ext')
|
33
58
|
|
34
|
-
|
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
|
35
67
|
|
36
|
-
|
68
|
+
task :test => :test_base if File.exist?(ext)
|
37
69
|
|
38
70
|
desc "Test ruby-debug-base."
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
t.verbose = true
|
45
|
-
end
|
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)
|
46
76
|
end
|
47
77
|
|
48
|
-
|
49
|
-
task :
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
78
|
+
if defined?(JRUBY_VERSION)
|
79
|
+
task :test_base => 'jruby:compile:java'
|
80
|
+
else
|
81
|
+
task :test_base => :compile
|
82
|
+
end
|
83
|
+
|
84
|
+
desc "Test everything - same as test."
|
85
|
+
task :check => :test
|
86
|
+
|
87
|
+
desc "Create a GNU-style ChangeLog via svn2cl"
|
88
|
+
task :ChangeLog do
|
89
|
+
system('git log --pretty --numstat --summary | git2cl > ChangeLog')
|
90
|
+
system('git log --pretty --numstat --summary ext | git2cl > ext/ChangeLog')
|
91
|
+
system('git log --pretty --numstat --summary lib | git2cl > lib/ChangeLog')
|
57
92
|
end
|
58
93
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
# http://subversion.tigris.org/issues/show_bug.cgi?id=937
|
94
|
+
# Base GEM Specification
|
95
|
+
base_spec = Gem::Specification.new do |spec|
|
96
|
+
spec.name = "ruby-debug-base"
|
63
97
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
File.open(runner, 'w') {|f| f.write(text.gsub(/-ruby/ , '-jruby --debug'))}
|
72
|
-
File.chmod(0755, runner)
|
73
|
-
|
74
|
-
File.open('test/config.private.yaml', 'w') do |f|
|
75
|
-
f.write <<EOF
|
76
|
-
# either should be on the $PATH or use full path
|
77
|
-
ruby: jruby
|
78
|
-
|
79
|
-
# possibility to specify interpreter parameters
|
80
|
-
ruby_params: --debug
|
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.
|
81
105
|
EOF
|
82
|
-
end
|
83
106
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
107
|
+
spec.version = Debugger::VERSION
|
108
|
+
|
109
|
+
spec.author = "Kent Sibilev"
|
110
|
+
spec.email = "ksibilev@yahoo.com"
|
111
|
+
spec.platform = Gem::Platform::RUBY
|
112
|
+
spec.require_path = "lib"
|
113
|
+
spec.extensions = ["ext/extconf.rb"]
|
114
|
+
spec.files = BASE_FILES.to_a
|
115
|
+
|
116
|
+
spec.required_ruby_version = '>= 1.8.2'
|
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']
|
88
127
|
end
|
89
128
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
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']
|
94
160
|
end
|
95
161
|
|
96
|
-
|
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
|
168
|
+
end
|
97
169
|
|
98
|
-
|
99
|
-
|
100
|
-
s.summary = "Java implementation of Fast Ruby Debugger"
|
101
|
-
s.name = GEM_NAME
|
102
|
-
s.version = GEM_VERSION
|
103
|
-
s.require_path = 'lib'
|
104
|
-
s.files = DIST_FILES
|
105
|
-
s.description = <<-EOF
|
106
|
-
Java extension to make fast ruby debugger run on JRuby.
|
107
|
-
It is the same what ruby-debug-base is for native Ruby.
|
108
|
-
EOF
|
109
|
-
s.author = 'debug-commons team'
|
110
|
-
s.homepage = 'http://rubyforge.org/projects/debug-commons/'
|
111
|
-
s.has_rdoc = true
|
112
|
-
s.rubyforge_project = 'debug-commons'
|
170
|
+
Rake::ExtensionTask.new('ruby_debug', base_spec) do |t|
|
171
|
+
t.ext_dir = "ext"
|
113
172
|
end
|
114
173
|
|
115
|
-
|
174
|
+
task :default => :test
|
175
|
+
|
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}"]
|
116
182
|
|
117
|
-
desc "
|
118
|
-
task :
|
119
|
-
|
183
|
+
desc "Create Windows Gem"
|
184
|
+
task :win32_gem do
|
185
|
+
# Copy the win32 extension the top level directory
|
120
186
|
current_dir = File.expand_path(File.dirname(__FILE__))
|
121
|
-
source = File.join(current_dir,
|
122
|
-
target = File.join(current_dir, "lib",
|
187
|
+
source = File.join(current_dir, "ext", "win32", SO_NAME)
|
188
|
+
target = File.join(current_dir, "lib", SO_NAME)
|
123
189
|
cp(source, target)
|
124
|
-
# Create the gem, then move it to pkg.
|
125
|
-
Gem::Builder.new(spec).build
|
126
|
-
gem_file = "#{spec.name}-#{spec.version}-#{spec.platform}.gem"
|
127
|
-
mv(gem_task.gem_file, "pkg/#{gem_task.gem_file}")
|
128
|
-
# Delete the temporary target
|
129
|
-
rm target
|
130
|
-
end
|
131
190
|
|
132
|
-
|
133
|
-
|
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}")
|
134
195
|
|
135
|
-
|
136
|
-
|
137
|
-
t.rdoc_files.include 'README'
|
196
|
+
# Remove win extension from top level directory.
|
197
|
+
rm(target)
|
138
198
|
end
|
139
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__))
|
140
206
|
|
141
|
-
|
142
|
-
|
143
|
-
system("svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/debug-commons/jruby-debug/trunk")
|
207
|
+
Rake::SshDirPublisher.new("kent@rubyforge.org",
|
208
|
+
"/var/www/gforge-projects/ruby-debug", ruby_debug_path)
|
144
209
|
end
|
145
210
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
211
|
+
desc "Remove built files"
|
212
|
+
task :clean do
|
213
|
+
cd "ext" do
|
214
|
+
if File.exists?("Makefile")
|
215
|
+
sh "make clean"
|
216
|
+
rm "Makefile"
|
217
|
+
end
|
218
|
+
derived_files = Dir.glob(".o") + Dir.glob("*.so")
|
219
|
+
rm derived_files unless derived_files.empty?
|
152
220
|
end
|
221
|
+
rm 'lib/ruby_debug.jar' if File.exists?("lib/ruby_debug.jar")
|
222
|
+
end
|
153
223
|
|
154
|
-
|
155
|
-
|
156
|
-
|
224
|
+
# --------- RDoc Documentation ------
|
225
|
+
desc "Generate rdoc documentation"
|
226
|
+
RDoc::Task.new("rdoc") do |rdoc|
|
227
|
+
rdoc.rdoc_dir = 'doc/rdoc'
|
228
|
+
rdoc.title = "ruby-debug"
|
229
|
+
# Show source inline with line numbers
|
230
|
+
rdoc.options << "--inline-source" << "--line-numbers"
|
231
|
+
# Make the readme file the start page for the generated html
|
232
|
+
rdoc.options << '--main' << 'README'
|
233
|
+
rdoc.rdoc_files.include('bin/**/*',
|
234
|
+
'cli/ruby-debug/commands/*.rb',
|
235
|
+
'cli/ruby-debug/*.rb',
|
236
|
+
'lib/**/*.rb',
|
237
|
+
'ext/**/ruby_debug.c',
|
238
|
+
'README',
|
239
|
+
'LICENSE')
|
240
|
+
end
|
157
241
|
|
158
|
-
|
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)
|
159
248
|
end
|
160
249
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
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
|
165
260
|
end
|
166
261
|
|
167
|
-
def
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
separator = File::ALT_SEPARATOR || File::SEPARATOR
|
172
|
-
sh "jar cf #{RUBY_DEBUG_JAR} -C pkg#{separator}classes ."
|
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)
|
173
266
|
end
|
174
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
|
data/ext/extconf.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require "mkmf"
|
2
|
+
|
3
|
+
if RUBY_VERSION >= "1.9"
|
4
|
+
STDERR.print("Ruby version #{RUBY_VERSION} is too new\n")
|
5
|
+
exit(1)
|
6
|
+
elsif RUBY_VERSION >= "1.8"
|
7
|
+
if RUBY_RELEASE_DATE < "2005-03-22"
|
8
|
+
STDERR.print("Ruby release date #{RUBY_RELEASE_DATE} is too old\n")
|
9
|
+
exit(1)
|
10
|
+
end
|
11
|
+
else
|
12
|
+
STDERR.print("Ruby version is not compatible for this version.\n")
|
13
|
+
exit(1)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Allow use customization of compile options. For example, the
|
17
|
+
# following lines could be put in config_options to to turn off
|
18
|
+
# optimization:
|
19
|
+
# $CFLAGS='-fPIC -fno-strict-aliasing -g3 -ggdb -O2 -fPIC'
|
20
|
+
config_file = File.join(File.dirname(__FILE__), 'config_options.rb')
|
21
|
+
load config_file if File.exist?(config_file)
|
22
|
+
|
23
|
+
create_makefile("ruby_debug")
|