ruby-debug-base19x 0.11.28 → 0.11.29
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/AUTHORS +10 -10
- data/CHANGES +334 -334
- data/LICENSE +22 -22
- data/README +122 -122
- data/Rakefile +27 -138
- data/ext/ruby_debug/breakpoint.c +586 -586
- data/ext/ruby_debug/extconf.rb +27 -23
- data/ext/ruby_debug/ruby_debug.c +2609 -2642
- data/ext/ruby_debug/ruby_debug.h +148 -148
- data/lib/ChangeLog +1065 -1065
- data/lib/ruby-debug-base.rb +304 -304
- metadata +20 -42
- data/test/base/base.rb +0 -74
- data/test/base/binding.rb +0 -31
- data/test/base/catchpoint.rb +0 -26
data/LICENSE
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
Copyright (C) 2005 Kent Sibilev <ksibilev@yahoo.com>
|
2
|
-
All rights reserved.
|
3
|
-
*
|
4
|
-
Redistribution and use in source and binary forms, with or without
|
5
|
-
modification, are permitted provided that the following conditions
|
6
|
-
are met:
|
7
|
-
1. Redistributions of source code must retain the above copyright
|
8
|
-
notice, this list of conditions and the following disclaimer.
|
9
|
-
2. Redistributions in binary form must reproduce the above copyright
|
10
|
-
notice, this list of conditions and the following disclaimer in the
|
11
|
-
documentation and/or other materials provided with the distribution.
|
12
|
-
*
|
13
|
-
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
14
|
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
15
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
16
|
-
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
17
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
18
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
19
|
-
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
20
|
-
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
21
|
-
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
22
|
-
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
1
|
+
Copyright (C) 2005 Kent Sibilev <ksibilev@yahoo.com>
|
2
|
+
All rights reserved.
|
3
|
+
*
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions
|
6
|
+
are met:
|
7
|
+
1. Redistributions of source code must retain the above copyright
|
8
|
+
notice, this list of conditions and the following disclaimer.
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright
|
10
|
+
notice, this list of conditions and the following disclaimer in the
|
11
|
+
documentation and/or other materials provided with the distribution.
|
12
|
+
*
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
14
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
15
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
16
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
17
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
18
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
19
|
+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
20
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
21
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
22
|
+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
23
23
|
SUCH DAMAGE.
|
data/README
CHANGED
@@ -1,122 +1,122 @@
|
|
1
|
-
*************************************************************
|
2
|
-
|
3
|
-
NOTE: For Ruby 1.9 installation instructions, please see:
|
4
|
-
|
5
|
-
http://wiki.github.com/mark-moseley/ruby-debug
|
6
|
-
|
7
|
-
*************************************************************
|
8
|
-
|
9
|
-
= ruby-debug
|
10
|
-
|
11
|
-
== Overview
|
12
|
-
|
13
|
-
ruby-debug is a fast implementation of the standard debugger debug.rb.
|
14
|
-
The faster execution speed is achieved by utilizing a new hook in the
|
15
|
-
Ruby C API.
|
16
|
-
|
17
|
-
== Requirements
|
18
|
-
|
19
|
-
ruby-debug requires Ruby 1.8.4 or higher.
|
20
|
-
|
21
|
-
Unless you get the packages as a binary (Microsoft Windows binaries
|
22
|
-
are sometimes available), you'll need a C compiler and Ruby
|
23
|
-
development headers, and a Make program so the extension in
|
24
|
-
ruby-debug-base can be compiled when it is installed.
|
25
|
-
|
26
|
-
To install on Microsoft Windows, unless you run under cygwin or mingw
|
27
|
-
you'll need Microsoft Visual C++ 6.0 also known as VC6.
|
28
|
-
http://rubyforge.org/tracker/index.php?func=detail&aid=16774&group_id=1900&atid=7436
|
29
|
-
suggests why.
|
30
|
-
|
31
|
-
|
32
|
-
== Install
|
33
|
-
|
34
|
-
ruby-debug is provided as a RubyGem. To install:
|
35
|
-
|
36
|
-
<tt>gem install ruby-debug</tt>
|
37
|
-
|
38
|
-
This should also pull in <tt>ruby-debug-base</tt> as a dependency.
|
39
|
-
|
40
|
-
(If you install ruby-debug-base explicitly, you can add in the <tt>--test</tt>
|
41
|
-
option after "install" to have the regression test run before
|
42
|
-
installing.)
|
43
|
-
|
44
|
-
For Emacs support and the Reference Manual, get
|
45
|
-
<tt>ruby-debug-extra</tt>. This is not a RubyGem, you'll need a Make
|
46
|
-
program and a POSIX shell. With this installed, run:
|
47
|
-
|
48
|
-
sh ./configure
|
49
|
-
make
|
50
|
-
make test # optional, but a good idea
|
51
|
-
sudo make install
|
52
|
-
|
53
|
-
|
54
|
-
==== Install on MS Windows
|
55
|
-
|
56
|
-
Compiling under cygwin or mingw works like it does on Unix.
|
57
|
-
|
58
|
-
* Have Microsoft Visual C++ 6.0 (VC6) installed - exactly that version.
|
59
|
-
|
60
|
-
* Set the appropriate environment variables.
|
61
|
-
|
62
|
-
* run `nmake'.
|
63
|
-
|
64
|
-
* Copy ruby_debug.so to `win32'.
|
65
|
-
|
66
|
-
* Go to the ruby_debug root.
|
67
|
-
|
68
|
-
* rake win32_gem
|
69
|
-
|
70
|
-
* The file is in named `rdebug-debug-base-0.10.0-mswin32.gem'.
|
71
|
-
|
72
|
-
== Usage
|
73
|
-
|
74
|
-
There are two ways of running ruby-debug.
|
75
|
-
|
76
|
-
=== rdebug executable:
|
77
|
-
|
78
|
-
$ rdebug <your-script>
|
79
|
-
|
80
|
-
When you start your script this way, the debugger will stop at
|
81
|
-
the first line of code in the script file. So you will be able
|
82
|
-
to set up your breakpoints.
|
83
|
-
|
84
|
-
=== ruby-debug API
|
85
|
-
|
86
|
-
The second way is to use the ruby-debug API to interrupt your
|
87
|
-
code execution at run time.
|
88
|
-
|
89
|
-
require 'ruby-debug' ; Debugger.start
|
90
|
-
...
|
91
|
-
def your_method
|
92
|
-
...
|
93
|
-
debugger
|
94
|
-
...
|
95
|
-
end
|
96
|
-
|
97
|
-
or
|
98
|
-
|
99
|
-
require 'ruby-debug' ;
|
100
|
-
Debugger.start do
|
101
|
-
...
|
102
|
-
debugger
|
103
|
-
end
|
104
|
-
|
105
|
-
When Kernel#debugger method is executed, the debugger is activated
|
106
|
-
and you will be able to inspect and step through your code.
|
107
|
-
|
108
|
-
== Performance
|
109
|
-
|
110
|
-
The <tt>debug.rb</tt> script that comes with the standard Ruby library uses
|
111
|
-
<tt>Kernel#set_trace_func</tt> API. Implementing the debugger in pure Ruby has
|
112
|
-
a negative impact on the speed of your program execution. This is
|
113
|
-
because the Ruby interpreter creates a Binding object each trace call,
|
114
|
-
even though it is not being used most of the time. ruby-debug moves
|
115
|
-
most of the functionality for Binding access and for breakpoint
|
116
|
-
testing to a native extension. Because this code is in C and because
|
117
|
-
and can be selectively enabled or disabled, the overhead in running
|
118
|
-
your program can be minimized.
|
119
|
-
|
120
|
-
== License
|
121
|
-
|
122
|
-
See LICENSE for license information.
|
1
|
+
*************************************************************
|
2
|
+
|
3
|
+
NOTE: For Ruby 1.9 installation instructions, please see:
|
4
|
+
|
5
|
+
http://wiki.github.com/mark-moseley/ruby-debug
|
6
|
+
|
7
|
+
*************************************************************
|
8
|
+
|
9
|
+
= ruby-debug
|
10
|
+
|
11
|
+
== Overview
|
12
|
+
|
13
|
+
ruby-debug is a fast implementation of the standard debugger debug.rb.
|
14
|
+
The faster execution speed is achieved by utilizing a new hook in the
|
15
|
+
Ruby C API.
|
16
|
+
|
17
|
+
== Requirements
|
18
|
+
|
19
|
+
ruby-debug requires Ruby 1.8.4 or higher.
|
20
|
+
|
21
|
+
Unless you get the packages as a binary (Microsoft Windows binaries
|
22
|
+
are sometimes available), you'll need a C compiler and Ruby
|
23
|
+
development headers, and a Make program so the extension in
|
24
|
+
ruby-debug-base can be compiled when it is installed.
|
25
|
+
|
26
|
+
To install on Microsoft Windows, unless you run under cygwin or mingw
|
27
|
+
you'll need Microsoft Visual C++ 6.0 also known as VC6.
|
28
|
+
http://rubyforge.org/tracker/index.php?func=detail&aid=16774&group_id=1900&atid=7436
|
29
|
+
suggests why.
|
30
|
+
|
31
|
+
|
32
|
+
== Install
|
33
|
+
|
34
|
+
ruby-debug is provided as a RubyGem. To install:
|
35
|
+
|
36
|
+
<tt>gem install ruby-debug</tt>
|
37
|
+
|
38
|
+
This should also pull in <tt>ruby-debug-base</tt> as a dependency.
|
39
|
+
|
40
|
+
(If you install ruby-debug-base explicitly, you can add in the <tt>--test</tt>
|
41
|
+
option after "install" to have the regression test run before
|
42
|
+
installing.)
|
43
|
+
|
44
|
+
For Emacs support and the Reference Manual, get
|
45
|
+
<tt>ruby-debug-extra</tt>. This is not a RubyGem, you'll need a Make
|
46
|
+
program and a POSIX shell. With this installed, run:
|
47
|
+
|
48
|
+
sh ./configure
|
49
|
+
make
|
50
|
+
make test # optional, but a good idea
|
51
|
+
sudo make install
|
52
|
+
|
53
|
+
|
54
|
+
==== Install on MS Windows
|
55
|
+
|
56
|
+
Compiling under cygwin or mingw works like it does on Unix.
|
57
|
+
|
58
|
+
* Have Microsoft Visual C++ 6.0 (VC6) installed - exactly that version.
|
59
|
+
|
60
|
+
* Set the appropriate environment variables.
|
61
|
+
|
62
|
+
* run `nmake'.
|
63
|
+
|
64
|
+
* Copy ruby_debug.so to `win32'.
|
65
|
+
|
66
|
+
* Go to the ruby_debug root.
|
67
|
+
|
68
|
+
* rake win32_gem
|
69
|
+
|
70
|
+
* The file is in named `rdebug-debug-base-0.10.0-mswin32.gem'.
|
71
|
+
|
72
|
+
== Usage
|
73
|
+
|
74
|
+
There are two ways of running ruby-debug.
|
75
|
+
|
76
|
+
=== rdebug executable:
|
77
|
+
|
78
|
+
$ rdebug <your-script>
|
79
|
+
|
80
|
+
When you start your script this way, the debugger will stop at
|
81
|
+
the first line of code in the script file. So you will be able
|
82
|
+
to set up your breakpoints.
|
83
|
+
|
84
|
+
=== ruby-debug API
|
85
|
+
|
86
|
+
The second way is to use the ruby-debug API to interrupt your
|
87
|
+
code execution at run time.
|
88
|
+
|
89
|
+
require 'ruby-debug' ; Debugger.start
|
90
|
+
...
|
91
|
+
def your_method
|
92
|
+
...
|
93
|
+
debugger
|
94
|
+
...
|
95
|
+
end
|
96
|
+
|
97
|
+
or
|
98
|
+
|
99
|
+
require 'ruby-debug' ;
|
100
|
+
Debugger.start do
|
101
|
+
...
|
102
|
+
debugger
|
103
|
+
end
|
104
|
+
|
105
|
+
When Kernel#debugger method is executed, the debugger is activated
|
106
|
+
and you will be able to inspect and step through your code.
|
107
|
+
|
108
|
+
== Performance
|
109
|
+
|
110
|
+
The <tt>debug.rb</tt> script that comes with the standard Ruby library uses
|
111
|
+
<tt>Kernel#set_trace_func</tt> API. Implementing the debugger in pure Ruby has
|
112
|
+
a negative impact on the speed of your program execution. This is
|
113
|
+
because the Ruby interpreter creates a Binding object each trace call,
|
114
|
+
even though it is not being used most of the time. ruby-debug moves
|
115
|
+
most of the functionality for Binding access and for breakpoint
|
116
|
+
testing to a native extension. Because this code is in C and because
|
117
|
+
and can be selectively enabled or disabled, the overhead in running
|
118
|
+
your program can be minimized.
|
119
|
+
|
120
|
+
== License
|
121
|
+
|
122
|
+
See LICENSE for license information.
|
data/Rakefile
CHANGED
@@ -1,138 +1,27 @@
|
|
1
|
-
#!/usr/bin/env rake
|
2
|
-
# -*- Ruby -*-
|
3
|
-
require 'rubygems'
|
4
|
-
|
5
|
-
require '
|
6
|
-
require 'rake/
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
]
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
test/base/binding.rb
|
29
|
-
test/base/catchpoint.rb)
|
30
|
-
BASE_FILES = COMMON_FILES + FileList[
|
31
|
-
'ext/ruby_debug/breakpoint.c',
|
32
|
-
'ext/ruby_debug/extconf.rb',
|
33
|
-
'ext/ruby_debug/ruby_debug.c',
|
34
|
-
'ext/ruby_debug/ruby_debug.h',
|
35
|
-
'ext/win32/*',
|
36
|
-
'lib/**/*',
|
37
|
-
BASE_TEST_FILE_LIST,
|
38
|
-
]
|
39
|
-
|
40
|
-
# Base GEM Specification
|
41
|
-
base_spec = Gem::Specification.new do |spec|
|
42
|
-
spec.name = "ruby-debug-base19x"
|
43
|
-
|
44
|
-
spec.homepage = "http://rubyforge.org/projects/ruby-debug/"
|
45
|
-
spec.summary = "Fast Ruby debugger - core component"
|
46
|
-
spec.description = <<-EOF
|
47
|
-
ruby-debug is a fast implementation of the standard Ruby debugger debug.rb.
|
48
|
-
It is implemented by utilizing a new Ruby C API hook. The core component
|
49
|
-
provides support that front-ends can build on. It provides breakpoint
|
50
|
-
handling, bindings for stack frames among other things.
|
51
|
-
EOF
|
52
|
-
|
53
|
-
spec.version = RUBY_DEBUG_VERSION
|
54
|
-
|
55
|
-
spec.author = "Kent Sibilev, Mark Moseley"
|
56
|
-
spec.email = "ksibilev@yahoo.com"
|
57
|
-
spec.platform = Gem::Platform::RUBY
|
58
|
-
spec.require_path = "lib"
|
59
|
-
spec.extensions = ["ext/ruby_debug/extconf.rb"]
|
60
|
-
spec.files = BASE_FILES.to_a
|
61
|
-
|
62
|
-
spec.required_ruby_version = '>= 1.8.2'
|
63
|
-
spec.date = Time.now
|
64
|
-
spec.rubyforge_project = 'ruby-debug19'
|
65
|
-
spec.add_dependency('columnize', [">= 0.3.1"])
|
66
|
-
spec.add_dependency('ruby_core_source', [">= 0.1.4"])
|
67
|
-
spec.add_dependency('linecache19', [">= 0.5.11"])
|
68
|
-
|
69
|
-
spec.test_files = FileList[BASE_TEST_FILE_LIST]
|
70
|
-
|
71
|
-
# rdoc
|
72
|
-
spec.has_rdoc = true
|
73
|
-
spec.extra_rdoc_files = ['README', 'ext/ruby_debug/ruby_debug.c']
|
74
|
-
end
|
75
|
-
|
76
|
-
|
77
|
-
# Rake task to build the default package
|
78
|
-
Rake::GemPackageTask.new(base_spec) do |pkg|
|
79
|
-
pkg.need_tar = true
|
80
|
-
end
|
81
|
-
|
82
|
-
task :default => [:package]
|
83
|
-
|
84
|
-
# Windows specification
|
85
|
-
win_spec = base_spec.clone
|
86
|
-
win_spec.extensions = []
|
87
|
-
## win_spec.platform = Gem::Platform::WIN32 # deprecated
|
88
|
-
win_spec.platform = 'mswin32'
|
89
|
-
win_spec.files += ["lib/#{SO_NAME}"]
|
90
|
-
|
91
|
-
desc "Create Windows Gem"
|
92
|
-
task :win32_gem do
|
93
|
-
# Copy the win32 extension the top level directory
|
94
|
-
current_dir = File.expand_path(File.dirname(__FILE__))
|
95
|
-
source = File.join(current_dir, "ext", "win32", SO_NAME)
|
96
|
-
target = File.join(current_dir, "lib", SO_NAME)
|
97
|
-
cp(source, target)
|
98
|
-
|
99
|
-
# Create the gem, then move it to pkg.
|
100
|
-
Gem::Builder.new(win_spec).build
|
101
|
-
gem_file = "#{win_spec.name}-#{win_spec.version}-#{win_spec.platform}.gem"
|
102
|
-
mv(gem_file, "pkg/#{gem_file}")
|
103
|
-
|
104
|
-
# Remove win extension from top level directory.
|
105
|
-
rm(target)
|
106
|
-
end
|
107
|
-
|
108
|
-
desc "Publish ruby-debug to RubyForge."
|
109
|
-
task :publish do
|
110
|
-
require 'rake/contrib/sshpublisher'
|
111
|
-
|
112
|
-
# Get ruby-debug path.
|
113
|
-
ruby_debug_path = File.expand_path(File.dirname(__FILE__))
|
114
|
-
|
115
|
-
Rake::SshDirPublisher.new("kent@rubyforge.org",
|
116
|
-
"/var/www/gforge-projects/ruby-debug", ruby_debug_path)
|
117
|
-
end
|
118
|
-
|
119
|
-
desc "Remove built files"
|
120
|
-
task :clean do
|
121
|
-
cd "ext" do
|
122
|
-
if File.exists?("Makefile")
|
123
|
-
sh "make clean"
|
124
|
-
rm "Makefile"
|
125
|
-
end
|
126
|
-
derived_files = Dir.glob(".o") + Dir.glob("*.so")
|
127
|
-
rm derived_files unless derived_files.empty?
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
|
-
desc "Test ruby-debug-base."
|
132
|
-
task :test_base => :lib do
|
133
|
-
Rake::TestTask.new(:test_base) do |t|
|
134
|
-
t.libs += ['./ext', './lib']
|
135
|
-
t.test_files = FileList[BASE_TEST_FILE_LIST]
|
136
|
-
t.verbose = true
|
137
|
-
end
|
138
|
-
end
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# -*- Ruby -*-
|
3
|
+
require 'rubygems'
|
4
|
+
|
5
|
+
require 'bundler/gem_tasks'
|
6
|
+
require 'rake/rdoctask'
|
7
|
+
require 'rake/testtask'
|
8
|
+
|
9
|
+
BASE_TEST_FILE_LIST = Dir['test/**/*_test.rb']
|
10
|
+
|
11
|
+
task :default => [:test_base]
|
12
|
+
|
13
|
+
desc "Create the core ruby-debug shared library extension"
|
14
|
+
task :lib do
|
15
|
+
Dir.chdir("ext/ruby_debug") do
|
16
|
+
system("#{Gem.ruby} extconf.rb && make")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "Test ruby-debug-base."
|
21
|
+
task :test_base => :lib do
|
22
|
+
Rake::TestTask.new(:test_base) do |t|
|
23
|
+
t.libs += ['./ext/ruby_debug', './lib']
|
24
|
+
t.test_files = FileList[BASE_TEST_FILE_LIST]
|
25
|
+
t.verbose = true
|
26
|
+
end
|
27
|
+
end
|