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/AUTHORS
CHANGED
data/CHANGES
ADDED
@@ -0,0 +1,366 @@
|
|
1
|
+
0.10.5
|
2
|
+
12/25/10
|
3
|
+
- Remove extraneous .RB files messing up Microsoft Windows
|
4
|
+
- Deprecate "set force". Use "set di[fferent].
|
5
|
+
- Moved to github.
|
6
|
+
- Merged JRuby extension.
|
7
|
+
- Moved ruby-debug-extra to a separate repository.
|
8
|
+
- JRuby: fixed race condition that was causing the debugger to hang:
|
9
|
+
http://youtrack.jetbrains.net/issue/RUBY-8123
|
10
|
+
https://github.com/ruby-debug/ruby-debug/issues/7
|
11
|
+
http://jira.codehaus.org/browse/JRUBY-6083
|
12
|
+
- JRuby: fixed stopping in wrong file with the same basename
|
13
|
+
- Use rake-compiler for building extensions
|
14
|
+
- Fix use of stale variables after restarting the debugger (#4)
|
15
|
+
- Use Travis for CI
|
16
|
+
- JRuby: Remove GPL'd linecache code (#3)
|
17
|
+
|
18
|
+
0.10.4
|
19
|
+
10/27/10
|
20
|
+
|
21
|
+
- Various bug fixes:
|
22
|
+
* reload command.
|
23
|
+
* plain 'info' command
|
24
|
+
* improve list and list - (backwards) handling when hitting end of file
|
25
|
+
- Add ability to specify port to debug on
|
26
|
+
- Allow breakpoints at class methods
|
27
|
+
- "quit!" is same as "quit unconditionally"
|
28
|
+
- irb improvements: Access to non-executing rdebug commands inside irb via
|
29
|
+
"dbgr" method
|
30
|
+
- Go over documentation including that created by rdoc.
|
31
|
+
- For emacs package: add README, INSTALL, AUTHORS.
|
32
|
+
|
33
|
+
0.10.3
|
34
|
+
11/17/08
|
35
|
+
|
36
|
+
- a backtrace now warns when it thinks the callstack is truncated which it
|
37
|
+
gets by comparing with caller()
|
38
|
+
- fix setting $0.
|
39
|
+
- fix bug in showing variables in post-mortem
|
40
|
+
- Document how Debugger.start with a block is intended to be used.
|
41
|
+
- Move Kernel#debugger from ruby-debug-base into ruby-debug
|
42
|
+
- Get regression tests working again
|
43
|
+
- Warn and add a "confirmation" when setting a breakpoint on a
|
44
|
+
file that is not loaded.
|
45
|
+
|
46
|
+
0.10.2
|
47
|
+
- debugger(steps=0) breaks inside of debugger rather than wait for a line event.
|
48
|
+
- trace var varname (stop|nostop) added which issues trace_var.
|
49
|
+
- start method is now properly defined in Debugger module
|
50
|
+
- fixed 'finish' command
|
51
|
+
- rdebug script now works with Ruby 1.8.7
|
52
|
+
|
53
|
+
0.10.1
|
54
|
+
4/10/08 - in honor of the 30th Birthday of Kate Schwarz
|
55
|
+
|
56
|
+
- bin/rdebug
|
57
|
+
|
58
|
+
* "rdebug --post-mortem" now really catches uncaught exceptions and
|
59
|
+
brings you to post-mortem handling. "info program" shows the exception.
|
60
|
+
|
61
|
+
* rdebug now searches using ENV['PATH'] for a Ruby program to debug
|
62
|
+
if the program name is not found and doesn't have any path
|
63
|
+
characters in it.
|
64
|
+
|
65
|
+
* Use ~/.rdboptrc (rdbopt.ini on MS Windows) to change default options.
|
66
|
+
|
67
|
+
* --emacs is now --emacs-basic while --emacs 3 now implies emacs-basic
|
68
|
+
---annotate=3 --post-mortem --no-control --no-start --no-quit
|
69
|
+
|
70
|
+
- rdebug (CLI)
|
71
|
+
|
72
|
+
* "info" command additions and changes:
|
73
|
+
o fix bug in "info variables" when string had embedded %s'
|
74
|
+
o "info program" now shows uncaught exception information
|
75
|
+
o "info files" show what Ruby files are loaded
|
76
|
+
o "info file <f>" specific file information of <f> (e.g. time, # of lines, SHA1)
|
77
|
+
o "info catch" - Exceptions that can be caught in the current stack frame.
|
78
|
+
o "info "variables" shows "self" and class variables
|
79
|
+
o "info threads verbose" shows stack trace of all threads
|
80
|
+
o "info thread <t> verbose" shows stack trace of thread <t>.
|
81
|
+
|
82
|
+
* "frame" command now accepts an optional thread number argument
|
83
|
+
|
84
|
+
* Long information added to commands with subcommands: show, set,
|
85
|
+
info, enable, and disable. For example "help info <xxx>" will give
|
86
|
+
more detailed information about the "info <xxx>" command.
|
87
|
+
|
88
|
+
* columnize now pulled in from a separate package.
|
89
|
+
|
90
|
+
* add "var cl[ass]" command. Note "var const" can no longer be
|
91
|
+
abbreviated "var c"; use "var co" (or const or constant).
|
92
|
+
|
93
|
+
* add "condition" command. Allow removal of condition.
|
94
|
+
|
95
|
+
* $0 == __FILE__ when running rdebug should work -- most of the
|
96
|
+
time. See comments in code for a better solution.
|
97
|
+
|
98
|
+
* rdebug command history can be displayed with "show commands". Fix a bug
|
99
|
+
in history saving.
|
100
|
+
|
101
|
+
* INCOMPATIBLE CHANGE: "finish" works like gdb - stop just before the most
|
102
|
+
recent method finishes. Will now accept a number which stops that many
|
103
|
+
frames completed. (Note that return line numbers will be funny, the
|
104
|
+
first line of the method until Ruby 1.8.7.)
|
105
|
+
|
106
|
+
* fix bug in 'list' command when wrapping off the end.
|
107
|
+
|
108
|
+
- Emacs interaction drastically reworked, expanded, and improved.
|
109
|
+
|
110
|
+
- rdebug base
|
111
|
+
* allow catching multiple exceptions.
|
112
|
+
INCOMPATIBLE CHANGE: variable "Debugger.catchpoint", a String, was turned
|
113
|
+
into "Debugger.catchpoints", a Hash. Method "Debugger.catchpoint=" no
|
114
|
+
longer exists. Debugger.set_catchpoint was turned into
|
115
|
+
Debugger.add_catchpoint
|
116
|
+
|
117
|
+
* Add Debugger.last_exception which is set in post-mortem.
|
118
|
+
|
119
|
+
* remove Debugger.stop() when an exception is raised that would terminate the
|
120
|
+
debugged program. This may allow catchpoints to work and allow tracing user
|
121
|
+
code which handles "Exit" exceptions
|
122
|
+
|
123
|
+
* split off breakpoint code in ruby_debug.c.
|
124
|
+
|
125
|
+
* preface ruby_debug global Ruby variables with rdebug_.
|
126
|
+
|
127
|
+
* Change Debugger.start() to accept an optional options argument
|
128
|
+
:init => true saves things (like $0 and ARGV) necessary to
|
129
|
+
allow restart. Default: true
|
130
|
+
:post_mortem => true runs post-mortem on an uncaught exception
|
131
|
+
Default: false
|
132
|
+
|
133
|
+
The old Debugger.start() is now renamed to Debugger.start_()
|
134
|
+
|
135
|
+
* split of line caching to an external gem. We now only allow setting
|
136
|
+
breakpoints on lines where it makes sense to do so.
|
137
|
+
|
138
|
+
* Incompatible enhancement: even return/end will now call event handler
|
139
|
+
|
140
|
+
See ChangeLog for full details, and the reference guide for more complete
|
141
|
+
documentation of these changes.
|
142
|
+
|
143
|
+
0.10.0
|
144
|
+
12/25/07
|
145
|
+
|
146
|
+
- '-r' option can be used to require additional libraries.
|
147
|
+
- --noquit option added to stay in debugger when the program exits
|
148
|
+
- gdb-like --annotate option added. Can be used by front-ends to get information
|
149
|
+
without polling
|
150
|
+
- Fixed 'var const' command. Issue #10847.
|
151
|
+
- Using pretty-print for all var commands.
|
152
|
+
- Better error reporting for commands that require a numeric argument.
|
153
|
+
- Fixed Kernel#binding_n method
|
154
|
+
- Add option -d ($DEBUG = true) and --verbose. Make -v work like ruby.
|
155
|
+
- Remove debugger messages caused when warnings are turned on.
|
156
|
+
- "info" and "show" commands added. "set" made more like gdb's
|
157
|
+
set. subcommands can be abbreviated and are case insensitive.
|
158
|
+
- restart program if it terminates normally and we've got a tty and
|
159
|
+
we stop on the first statement.
|
160
|
+
- help is in tidy column format. method lists are shown that way as well.
|
161
|
+
the "width" setting ("set/show width") is used for the line width
|
162
|
+
- stack traces now show parameter names and types. "info args" lists just
|
163
|
+
the parameters (with the most recent values, not the values at call time).
|
164
|
+
- post-mortem "exit" bug fixed.
|
165
|
+
- More Emacs-friendly: rdebug-track.el will track location inside an Emacs
|
166
|
+
shell. Emacs position information is shown in breakpoints and catchpoints
|
167
|
+
similar to gdba. Commands to position in another window a unit test traceback
|
168
|
+
or ruby traceback. Much more work invisioned for Emacs.
|
169
|
+
- INCOMPATIBLE CHANGE: "break" now sets a breakpoint on the current line
|
170
|
+
(same as gdb). Use "info break" for a list of breakpoints.
|
171
|
+
- INCOMPATIBLE CHANGE: "script" command removed. Use "source" command instead
|
172
|
+
(same as gdb).
|
173
|
+
- Run .rdebugrc on Debugger.start. Look for a file in the current directory and
|
174
|
+
run that instead of the one in $HOME if that exists. Again, inspired by and compatible
|
175
|
+
with gdb.
|
176
|
+
- Changes compatible with Ruby 1.9. NOTE: this debugger will NOT work with
|
177
|
+
Ruby 1.9
|
178
|
+
- leaving irb shows position same as entering debugger; "list" position
|
179
|
+
is also cleared when leaving irb
|
180
|
+
- help "foo" gives message "Undefined command "foo" rather than a list
|
181
|
+
of help commands. (Message test is gdb's)
|
182
|
+
- Add set linetrace+ - similar to step+ for linetrace
|
183
|
+
- Start unit tests.
|
184
|
+
- Start a reference guide.
|
185
|
+
|
186
|
+
0.9.3
|
187
|
+
- Fixed if..elsif..end stepping.
|
188
|
+
- From irb session Ctrl-C or 'cont' command continues execution without showing the debugger prompt.
|
189
|
+
- Added Debugger.settings method to programatically modify command settings.
|
190
|
+
- Added Kernel#breakpoint as alias to Kernel#debugger is the former is not already defined.
|
191
|
+
|
192
|
+
0.9.2
|
193
|
+
- Fixed file comparison in Windows platform.
|
194
|
+
- Added setter methods to Breakpoint properties
|
195
|
+
- Added breakpoint hit condition functionality (not available via CLI yet) and methods:
|
196
|
+
Breakpoint:hit_count
|
197
|
+
Breakpoint:hit_value[=]
|
198
|
+
Breakpoint:hit_condition[=]
|
199
|
+
|
200
|
+
0.9.1
|
201
|
+
- Fixed incorrect stack calculation.
|
202
|
+
- Context#stop_next= method aliased as Context#step.
|
203
|
+
- Added the 'force' parameter to Context#step_over.
|
204
|
+
- Added the 'force' parameter to Context#step.
|
205
|
+
- 'next+/step+' commands forces to move to another line
|
206
|
+
- Added a new 'forcestep' setting.
|
207
|
+
|
208
|
+
0.9
|
209
|
+
- Kernel#debugger method will start the debugger if it's not running.
|
210
|
+
- Added Context#stop_reason method.
|
211
|
+
- Calling a method with a block will create a new frame. This changes the behavior of 'next' command. So in order to step into a block, 'step' command must be used. That fixes bug #9629.
|
212
|
+
- Added the possibility to add a temporary context-specific breakpoint. Context#breakpoint and Context#set_breakpoint methods are added.
|
213
|
+
- 'cont' command now accepts a numerical parameter which implements 'Continue until line' behavior.
|
214
|
+
- Added new Context.frame_class method
|
215
|
+
- Added new 'framefullpath' setting.
|
216
|
+
- Added new 'frameclassname' setting.
|
217
|
+
- All Ruby's 'eval' and require/load methods create a new frame. Fixes bug #9686.
|
218
|
+
|
219
|
+
0.8.1
|
220
|
+
- Added a shortcut module 'debugger'. require "ruby-debug/debugger" will start the debugger and stop at the next line (similar to require 'debug').
|
221
|
+
- Fixed remote debugging.
|
222
|
+
|
223
|
+
0.8
|
224
|
+
- Extract the base debugger API into a separate gem (ruby-debug-base), so it will be easier to add a new interface.
|
225
|
+
- Added 'set autoirb' setting.
|
226
|
+
- Bugfixes.
|
227
|
+
|
228
|
+
0.7.5
|
229
|
+
- Fixed 'reload on' command
|
230
|
+
- 'reload on' command is removed in favor of 'set autoreload'
|
231
|
+
- rdebug will evaluate ~/.rdebugrc script on startup
|
232
|
+
|
233
|
+
0.7.4
|
234
|
+
- Added a workaround of the Ruby interpreter problem where a method created with Module#define_method
|
235
|
+
and which raises an exception doesn't trigger a :return event, this way screwing the stack trace.
|
236
|
+
- Fixed a situation of an array 'out of bounds' access.
|
237
|
+
- Fixed the help for 'where' command.
|
238
|
+
|
239
|
+
0.7.3
|
240
|
+
- Fixed a case when a frame is not popped up properly.
|
241
|
+
- Removed Context.ignore= method, since it can result with the segmentation fault error.
|
242
|
+
- Fixed the case when Context#suspend may effect the state of the thread on Context#resume
|
243
|
+
- Fixed several cases of seg faults when accessing dyna_vars structure.
|
244
|
+
|
245
|
+
0.7.2
|
246
|
+
- Fixed Context#resume (a thread should be waked up only when it was running when it was suspended).
|
247
|
+
- When handling post-mortem exception, all threads must be suspended.
|
248
|
+
|
249
|
+
0.7.1
|
250
|
+
- Fixed 'delete' command
|
251
|
+
|
252
|
+
0.7
|
253
|
+
- Eliminated explicit Frame object. Use Context.frame_[binding,file,line] instead.
|
254
|
+
- Fixed help command.
|
255
|
+
- Renamed Debugger.keep_frame_info to Debugger.keep_frame_binding
|
256
|
+
- 'eval' command is available, even when keep_frame_binding is not used.
|
257
|
+
- New 'set' command is available.
|
258
|
+
|
259
|
+
0.6.2
|
260
|
+
- Added thread lookup cache.
|
261
|
+
- Control thread is always started by rdebug script.
|
262
|
+
- Ability to specify negative frame number to frame commands. Patch from R. Bernstein.
|
263
|
+
|
264
|
+
0.6.1
|
265
|
+
- Another performance optimization.
|
266
|
+
|
267
|
+
0.6
|
268
|
+
- Added option to exclude collecting of frame bindings.
|
269
|
+
- Several performance optimizations.
|
270
|
+
|
271
|
+
0.5.4
|
272
|
+
- Added -x/--trace option to rdebug script. Patch from R. Bernstein.
|
273
|
+
- Removed a live thread reference from the context's structure avoiding memory leakage.
|
274
|
+
|
275
|
+
0.5.3
|
276
|
+
- Added Module#post_mortem_method method, which wraps any method with Debugger.post_mortem block.
|
277
|
+
- Added breakpoint id, which is not dependent on the breakpoint position in Debugger.breakpoints array.
|
278
|
+
|
279
|
+
0.5.2
|
280
|
+
- Fixes interoperability problems with rspec.
|
281
|
+
- Made 'exit' as an alias to 'quit'
|
282
|
+
- Added 'restart' command. Patch from R. Bernstein.
|
283
|
+
|
284
|
+
0.5.1
|
285
|
+
- Bugfixes.
|
286
|
+
|
287
|
+
0.5
|
288
|
+
- Added post-mortem debugging
|
289
|
+
- Added 'irb' command.
|
290
|
+
|
291
|
+
0.4.5
|
292
|
+
- Fixed debug_method when applied to setter.
|
293
|
+
- Added 'reload' command which can be used to reload source code in case it's been changed.
|
294
|
+
- Added Debugger.reload_source_on_change option (true, by default) which controls whether ruby-debug should keep
|
295
|
+
track of the source files modification times and reload them if they've been changed.
|
296
|
+
|
297
|
+
0.4.4
|
298
|
+
- Renamed Context#set_suspend and Context#clear_suspend methods to Context#suspend and Context#resume respectively.
|
299
|
+
- Context#resume method not only clears suspend flag, but also resumes the thread execution.
|
300
|
+
- Bugfixes.
|
301
|
+
|
302
|
+
0.4.3
|
303
|
+
- Added Debugger.skip method which allows escaping a block from the debugger reach.
|
304
|
+
- Bugfixes.
|
305
|
+
|
306
|
+
0.4.2
|
307
|
+
- Module#deubg_method added.
|
308
|
+
- Added rdoc.
|
309
|
+
- Bugfixes.
|
310
|
+
|
311
|
+
0.4.1
|
312
|
+
- New binding_n method for Kernel module.
|
313
|
+
- Bugfixes.
|
314
|
+
|
315
|
+
0.4
|
316
|
+
- Debugger.start method takes a block. If a block is specified, this method starts debugger, yields to the block
|
317
|
+
and stops debugger at the end.
|
318
|
+
- 'tm[ate]' command accepts a frame number now.
|
319
|
+
- 'list' command accepts on/off parameter which controls whether listing will be displayed on every stop.
|
320
|
+
- 'eval on/off' controls the evaluation of unknown command.
|
321
|
+
- Debugger reads readline history file .rdebug_hist at startup and saves it at exit.
|
322
|
+
- 'sa[ve] <file>' command can be used to save current breackpoints and catchpoint if any
|
323
|
+
- 'sc[ript] <file>' command can be used to run script file. Script files can contain only control commands.
|
324
|
+
- rdebug script accepts '--script FILE' parameter.
|
325
|
+
- thread commands are available for the control port.
|
326
|
+
|
327
|
+
0.3 (2006-08-07)
|
328
|
+
- Renamed Debugger.start_server to Debugger.start_remote.
|
329
|
+
- Debugger.start_remote activates debugger by calling Debugger.start.
|
330
|
+
- Debugger.start_remote starts a control thread which listen on port 8990 and accepts control
|
331
|
+
commands, such as adding/deleting breakpoints, assigning catchpoint, etc. (Useful for GUI integration)
|
332
|
+
- New Debugger.wait_connection option. When it's true, Debugger.start_remote waits until
|
333
|
+
a remote connection is made.
|
334
|
+
- New Debugger.stop_on_connect option. When a remote connection is established, debugger
|
335
|
+
stops the main thread (Thread.main).
|
336
|
+
- 'interrupt' command is available for the control thread.
|
337
|
+
|
338
|
+
0.2.1 (2006-07-29)
|
339
|
+
- 'f[rame] nn' command selects a numbered frame. Frame numbers can be obtained by running frame
|
340
|
+
command without parameters.
|
341
|
+
- 'l[ist] =' show code in the context of the current line.
|
342
|
+
- 'tm[ate]' opens the current file in TextMate. Available only on Mac OSX.
|
343
|
+
|
344
|
+
0.2 (2006-07-17)
|
345
|
+
- Added the remote debugging. It should be activated by calling Debugger#start_server method.
|
346
|
+
- CHANGED: In order to activate the debugger, it's not enough to require 'ruby-debug'.
|
347
|
+
Debugger#start method must be called explicitly.
|
348
|
+
- Debugger used to evaluate anything you enter as long as it's not a command. Starting from
|
349
|
+
this version the 'eval' command must be used to evaluate an expression.
|
350
|
+
|
351
|
+
0.1.5 (2006-07-13)
|
352
|
+
- Now the check for a breakpoint uses base filename of the source file.
|
353
|
+
- Removed compilation warnings when compiling with -Wall
|
354
|
+
|
355
|
+
0.1.4 (2006-07-12)
|
356
|
+
- Remembers the previous command. Invoke it by typing a carriage return
|
357
|
+
at the command prompt.
|
358
|
+
|
359
|
+
0.1.3 (2006-07-11)
|
360
|
+
- Conditional breakpoints
|
361
|
+
- Bugfixes
|
362
|
+
|
363
|
+
0.1.2 (2006-07-16)
|
364
|
+
========================
|
365
|
+
|
366
|
+
- Initial release.
|
data/LICENSE
ADDED
@@ -0,0 +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
|
23
|
+
SUCH DAMAGE.
|
data/README
CHANGED
@@ -1,40 +1,133 @@
|
|
1
|
-
= ruby-debug
|
1
|
+
= ruby-debug
|
2
2
|
|
3
3
|
== Overview
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
ruby-debug is a fast implementation of the standard debugger debug.rb.
|
6
|
+
The faster execution speed is achieved by utilizing a new hook in the
|
7
|
+
Ruby C API.
|
8
|
+
|
9
|
+
== Requirements
|
10
|
+
|
11
|
+
ruby-debug requires Ruby 1.8.4 or higher.
|
12
|
+
|
13
|
+
Unless you get the packages as a binary (Microsoft Windows binaries
|
14
|
+
are sometimes available), you'll need a C compiler and Ruby
|
15
|
+
development headers, and a Make program so the extension in
|
16
|
+
ruby-debug-base can be compiled when it is installed.
|
17
|
+
|
18
|
+
To install on Microsoft Windows, unless you run under cygwin or mingw
|
19
|
+
you'll need Microsoft Visual C++ 6.0 also known as VC6.
|
20
|
+
http://rubyforge.org/tracker/index.php?func=detail&aid=16774&group_id=1900&atid=7436
|
21
|
+
suggests why.
|
22
|
+
|
8
23
|
|
9
24
|
== Install
|
10
25
|
|
11
|
-
|
12
|
-
|
26
|
+
ruby-debug is provided as a RubyGem. To install:
|
27
|
+
|
28
|
+
<tt>gem install ruby-debug</tt>
|
29
|
+
|
30
|
+
This should also pull in <tt>ruby-debug-base</tt> as a dependency.
|
31
|
+
|
32
|
+
(If you install ruby-debug-base explicitly, you can add in the <tt>--test</tt>
|
33
|
+
option after "install" to have the regression test run before
|
34
|
+
installing.)
|
13
35
|
|
14
|
-
|
15
|
-
|
36
|
+
For Emacs support and the Reference Manual, get
|
37
|
+
<tt>ruby-debug-extra</tt>. This is not a RubyGem, you'll need a Make
|
38
|
+
program and a POSIX shell. With this installed, run:
|
16
39
|
|
17
|
-
|
40
|
+
sh ./configure
|
41
|
+
make
|
42
|
+
make test # optional, but a good idea
|
43
|
+
sudo make install
|
18
44
|
|
19
|
-
jruby -S gem install ruby-debug-base-0.10.3-java.gem
|
20
45
|
|
21
|
-
|
46
|
+
==== Install on MS Windows
|
22
47
|
|
23
|
-
|
48
|
+
Compiling under cygwin or mingw works like it does on Unix.
|
24
49
|
|
25
|
-
|
50
|
+
* Have Microsoft Visual C++ 6.0 (VC6) installed - exactly that version.
|
26
51
|
|
27
|
-
|
52
|
+
* Set the appropriate environment variables.
|
28
53
|
|
29
|
-
|
54
|
+
* run `nmake'.
|
30
55
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
56
|
+
* Copy ruby_debug.so to `win32'.
|
57
|
+
|
58
|
+
* Go to the ruby_debug root.
|
59
|
+
|
60
|
+
* rake win32_gem
|
61
|
+
|
62
|
+
* The file is in named `rdebug-debug-base-0.10.0-mswin32.gem'.
|
63
|
+
|
64
|
+
== Usage
|
65
|
+
|
66
|
+
There are two ways of running ruby-debug.
|
67
|
+
|
68
|
+
=== rdebug executable:
|
69
|
+
|
70
|
+
$ rdebug <your-script>
|
71
|
+
|
72
|
+
When you start your script this way, the debugger will stop at
|
73
|
+
the first line of code in the script file. So you will be able
|
74
|
+
to set up your breakpoints.
|
75
|
+
|
76
|
+
=== ruby-debug API
|
77
|
+
|
78
|
+
The second way is to use the ruby-debug API to interrupt your
|
79
|
+
code execution at run time.
|
80
|
+
|
81
|
+
require 'ruby-debug' ; Debugger.start
|
82
|
+
...
|
83
|
+
def your_method
|
84
|
+
...
|
85
|
+
debugger
|
86
|
+
...
|
87
|
+
end
|
88
|
+
|
89
|
+
or
|
90
|
+
|
91
|
+
require 'ruby-debug' ;
|
92
|
+
Debugger.start do
|
93
|
+
...
|
94
|
+
debugger
|
95
|
+
end
|
96
|
+
|
97
|
+
When Kernel#debugger method is executed, the debugger is activated
|
98
|
+
and you will be able to inspect and step through your code.
|
99
|
+
|
100
|
+
== Performance
|
101
|
+
|
102
|
+
The <tt>debug.rb</tt> script that comes with the standard Ruby library uses
|
103
|
+
<tt>Kernel#set_trace_func</tt> API. Implementing the debugger in pure Ruby has
|
104
|
+
a negative impact on the speed of your program execution. This is
|
105
|
+
because the Ruby interpreter creates a Binding object each trace call,
|
106
|
+
even though it is not being used most of the time. ruby-debug moves
|
107
|
+
most of the functionality for Binding access and for breakpoint
|
108
|
+
testing to a native extension. Because this code is in C and because
|
109
|
+
and can be selectively enabled or disabled, the overhead in running
|
110
|
+
your program can be minimized.
|
111
|
+
|
112
|
+
== License
|
113
|
+
|
114
|
+
See LICENSE for license information.
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
= ruby-debug-base for JRuby
|
119
|
+
|
120
|
+
== Overview
|
121
|
+
|
122
|
+
(j)ruby-debug-base provides the fast debugger extension for JRuby interpreter.
|
123
|
+
It is the same as ruby-debug-base native C extension from ruby-debug project
|
124
|
+
(http://rubyforge.org/projects/ruby-debug/), but for JRuby.
|
125
|
+
|
126
|
+
== Install
|
127
|
+
|
128
|
+
(j)ruby-debug-base is available as a RubyGem:
|
129
|
+
|
130
|
+
jruby -S gem install ruby-debug-base
|
38
131
|
|
39
132
|
== Usage
|
40
133
|
|
@@ -58,4 +151,3 @@ For more information see: http://bashdb.sourceforge.net/ruby-debug.html
|
|
58
151
|
== License
|
59
152
|
|
60
153
|
See MIT-LICENSE for license information.
|
61
|
-
|