Skip to content

Commit f25c7eb

Browse files
author
kent
committed
initial import
git-svn-id: http://ruby-debug.rubyforge.org/svn/trunk@1 453b2852-3d18-0410-866e-d09c099698e4
0 parents  commit f25c7eb

32 files changed

+4012
-0
lines changed

.gdb_history

+171
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
r
2+
q
3+
file ruby
4+
set args '-rruby_debug test.rb'
5+
r
6+
set args '-r../ruby_debug ../test.rb'
7+
r
8+
q
9+
attach 6275
10+
c
11+
where
12+
p breakpoints
13+
p RARRAY(breakpoints)->len
14+
q
15+
file ruby
16+
set args -rruby_debug test.rb
17+
r
18+
where
19+
p offset
20+
frame 1
21+
p threads_tbl
22+
p/x threads_tbl
23+
frame 3
24+
context
25+
p context
26+
p debug_context
27+
p node->nd_file
28+
line
29+
p line
30+
q
31+
attach
32+
attach 7230
33+
c
34+
where
35+
q
36+
attach 23918
37+
c
38+
where
39+
q
40+
file ruby
41+
set args '-I./lib/:./ext/ -rruby-debug test.rb'
42+
r
43+
q
44+
help
45+
q
46+
file ruby
47+
set args -Iext:lib ./bin/rdebug t.rb
48+
r
49+
w
50+
where
51+
q
52+
attach ruby.781
53+
b ruby_debug.c:454
54+
c
55+
attach ruby.808
56+
b ruby_debug.c:453
57+
c
58+
c
59+
b
60+
help breakpoint
61+
clear
62+
b
63+
clear
64+
clear
65+
help
66+
help breakpoints
67+
b ruby_debug.c:452
68+
c
69+
l
70+
l -
71+
w
72+
where
73+
step
74+
fin
75+
step
76+
b 466
77+
c
78+
q
79+
help
80+
help breakpoints
81+
help save-breakpoints
82+
exit
83+
quit
84+
file ruby
85+
set args -Iext:lib bin/rdebug t2.rb
86+
c
87+
r
88+
b ruby_debug.c:366
89+
del 1
90+
b
91+
del 1
92+
del 2
93+
b
94+
del 3
95+
b ruby_debug.c:364
96+
c
97+
c
98+
c
99+
c
100+
c
101+
c
102+
c
103+
c
104+
c
105+
c
106+
del 4
107+
c
108+
q
109+
file ruby
110+
set args -Iext:lib bin/rdebug t2.rb
111+
c
112+
r
113+
b ruby_debug.c:814
114+
c
115+
c
116+
breakpoints
117+
help breakpoints
118+
help show
119+
show breapoints
120+
show breapoint
121+
show breakpoint
122+
show breakpoints
123+
f
124+
w
125+
bt
126+
p current
127+
p context
128+
c
129+
del 1
130+
b ruby_debug.c:810
131+
c
132+
r
133+
c
134+
s
135+
fin
136+
p current
137+
p context
138+
s
139+
s
140+
s
141+
fin
142+
help stepping
143+
help
144+
help running
145+
n
146+
p current
147+
p context
148+
n
149+
p saved_crit
150+
p saved_crit
151+
n
152+
n
153+
q
154+
file ruby
155+
set args -Iext:lib bin/rdebug t2.rb
156+
b rb_thread_schedule
157+
del 1
158+
c
159+
r
160+
b rb_thread_schedule
161+
c
162+
c
163+
del
164+
c
165+
q
166+
file ruby
167+
set args -Iext:lib bin/rdebug t2.rb
168+
r
169+
c
170+
r
171+
q

CHANGES

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
0.4.3
2+
- Bugfixes.
3+
4+
0.4.2
5+
- Module#deubg_method added.
6+
- Added rdoc.
7+
- Bugfixes.
8+
9+
0.4.1
10+
- New binding_n method for Kernel module.
11+
- Bugfixes.
12+
13+
0.4
14+
- Debugger.start method takes a block. If a block is specified, this method starts debugger, yields to the block
15+
and stops debugger at the end.
16+
- 'tm[ate]' command accepts a frame number now.
17+
- 'list' command accepts on/off parameter which controls whether listing will be displayed on every stop.
18+
- 'eval on/off' controls the evaluation of unknown command.
19+
- Debugger reads readline history file .rdebug_hist at startup and saves it at exit.
20+
- 'sa[ve] <file>' command can be used to save current breackpoints and catchpoint if any
21+
- 'sc[ript] <file>' command can be used to run script file. Script files can contain only control commands.
22+
- rdebug script accepts '--script FILE' parameter.
23+
- thread commands are available for the control port.
24+
25+
0.3 (2006-08-07)
26+
- Renamed Debugger.start_server to Debugger.start_remote.
27+
- Debugger.start_remote activates debugger by calling Debugger.start.
28+
- Debugger.start_remote starts a control thread which listen on port 8990 and accepts control
29+
commands, such as adding/deleting breakpoints, assigning catchpoint, etc. (Useful for GUI integration)
30+
- New Debugger.wait_connection option. When it's true, Debugger.start_remote waits until
31+
a remote connection is made.
32+
- New Debugger.stop_on_connect option. When a remote connection is established, debugger
33+
stops the main thread (Thread.main).
34+
- 'interrupt' command is available for the control thread.
35+
36+
0.2.1 (2006-07-29)
37+
- 'f[rame] nn' command selects a numbered frame. Frame numbers can be obtained by running frame
38+
command without parameters.
39+
- 'l[ist] =' show code in the context of the current line.
40+
- 'tm[ate]' opens the current file in TextMate. Available only on Mac OSX.
41+
42+
0.2 (2006-07-17)
43+
- Added the remote debugging. It should be activated by calling Debugger#start_server method.
44+
- CHANGED: In order to activate the debugger, it's not enough to require 'ruby-debug'.
45+
Debugger#start method must be called explicitly.
46+
- Debugger used to evaluate anything you enter as long as it's not a command. Starting from
47+
this version the 'eval' command must be used to evaluate an expression.
48+
49+
0.1.5 (2006-07-13)
50+
- Now the check for a breakpoint uses base filename of the source file.
51+
- Removed compilation warnings when compiling with -Wall
52+
53+
0.1.4 (2006-07-12)
54+
- Remembers the previous command. Invoke it by typing a carriage return
55+
at the command prompt.
56+
57+
0.1.3 (2006-07-11)
58+
- Conditional breakpoints
59+
- Bugfixes
60+
61+
0.1.2 (2006-07-16)
62+
========================
63+
64+
- Initial release.

LICENSE

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Copyright (C) 2005 Kent Sibilev <[email protected]>
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.

README

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
= ruby-debug
2+
3+
== Overview
4+
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 Ruby C API.
7+
8+
== Requirements
9+
10+
ruby-debug requires Ruby 1.8.4 or higher.
11+
12+
If you are running Linux or Unix you'll need a C compiler so the extension
13+
can be compiled when it is installed.
14+
15+
16+
== Install
17+
18+
ruby-debug is provided as a RubyGem. To install:
19+
20+
<tt>gem install ruby-debug</tt>
21+
22+
== Usage
23+
24+
There are two ways of running ruby-debug.
25+
26+
=== rdebug executable:
27+
28+
$ rdebug <your-script>
29+
30+
When you start your script this way, the debugger will stop at
31+
the first line of code in the script file. So you will be able
32+
to set up your breakpoints.
33+
34+
=== ruby-debug API
35+
36+
The second way is to use the ruby-debug API to interrupt your
37+
code execution at runtime.
38+
39+
require 'ruby-debug'
40+
...
41+
def your_method
42+
...
43+
debugger
44+
...
45+
end
46+
47+
When Kernel#debugger method is executed, the debugger is activated
48+
and you will be able to inspect and step through your code.
49+
50+
== Performance
51+
52+
The debug.rb script that comes with the standard library uses
53+
Kernel#set_trace_func API. This way it is possible to implement
54+
the debugger in pure Ruby, but has a negative effect on the speed
55+
of your program execution. For each trace call Ruby interpreter
56+
creates a Binding object, even though it is not being used most
57+
of the time. ruby-debug library moves most of the functionality
58+
of debug.rb to a native extension, this way significantly improving
59+
the execution of your program.
60+
61+
== License
62+
63+
See LICENSE for license information.

0 commit comments

Comments
 (0)