debugger 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (261) hide show
  1. data/AUTHORS +10 -0
  2. data/CHANGES +334 -0
  3. data/ChangeLog +5655 -0
  4. data/INSTALL.SVN +154 -0
  5. data/LICENSE +23 -0
  6. data/Makefile.am +14 -0
  7. data/OLD_README +122 -0
  8. data/README.md +10 -0
  9. data/Rakefile +266 -0
  10. data/autogen.sh +4 -0
  11. data/bin/rdebug +398 -0
  12. data/cli/ruby-debug.rb +173 -0
  13. data/cli/ruby-debug/command.rb +228 -0
  14. data/cli/ruby-debug/commands/breakpoints.rb +153 -0
  15. data/cli/ruby-debug/commands/catchpoint.rb +55 -0
  16. data/cli/ruby-debug/commands/condition.rb +49 -0
  17. data/cli/ruby-debug/commands/continue.rb +38 -0
  18. data/cli/ruby-debug/commands/control.rb +107 -0
  19. data/cli/ruby-debug/commands/display.rb +120 -0
  20. data/cli/ruby-debug/commands/edit.rb +48 -0
  21. data/cli/ruby-debug/commands/enable.rb +202 -0
  22. data/cli/ruby-debug/commands/eval.rb +176 -0
  23. data/cli/ruby-debug/commands/finish.rb +42 -0
  24. data/cli/ruby-debug/commands/frame.rb +301 -0
  25. data/cli/ruby-debug/commands/help.rb +56 -0
  26. data/cli/ruby-debug/commands/info.rb +467 -0
  27. data/cli/ruby-debug/commands/irb.rb +123 -0
  28. data/cli/ruby-debug/commands/jump.rb +66 -0
  29. data/cli/ruby-debug/commands/kill.rb +51 -0
  30. data/cli/ruby-debug/commands/list.rb +94 -0
  31. data/cli/ruby-debug/commands/method.rb +84 -0
  32. data/cli/ruby-debug/commands/quit.rb +39 -0
  33. data/cli/ruby-debug/commands/reload.rb +40 -0
  34. data/cli/ruby-debug/commands/save.rb +90 -0
  35. data/cli/ruby-debug/commands/set.rb +221 -0
  36. data/cli/ruby-debug/commands/show.rb +247 -0
  37. data/cli/ruby-debug/commands/skip.rb +35 -0
  38. data/cli/ruby-debug/commands/source.rb +36 -0
  39. data/cli/ruby-debug/commands/stepping.rb +81 -0
  40. data/cli/ruby-debug/commands/threads.rb +189 -0
  41. data/cli/ruby-debug/commands/tmate.rb +36 -0
  42. data/cli/ruby-debug/commands/trace.rb +57 -0
  43. data/cli/ruby-debug/commands/variables.rb +199 -0
  44. data/cli/ruby-debug/debugger.rb +5 -0
  45. data/cli/ruby-debug/helper.rb +69 -0
  46. data/cli/ruby-debug/interface.rb +232 -0
  47. data/cli/ruby-debug/processor.rb +474 -0
  48. data/configure.ac +12 -0
  49. data/debugger.gemspec +24 -0
  50. data/doc/.cvsignore +42 -0
  51. data/doc/Makefile.am +63 -0
  52. data/doc/emacs-notes.txt +38 -0
  53. data/doc/hanoi.rb +35 -0
  54. data/doc/primes.rb +28 -0
  55. data/doc/rdebug-emacs.texi +1030 -0
  56. data/doc/rdebug.1 +241 -0
  57. data/doc/ruby-debug.texi +3791 -0
  58. data/doc/test-tri2.rb +18 -0
  59. data/doc/tri3.rb +8 -0
  60. data/doc/triangle.rb +12 -0
  61. data/emacs/Makefile.am +130 -0
  62. data/emacs/rdebug-annotate.el +385 -0
  63. data/emacs/rdebug-breaks.el +407 -0
  64. data/emacs/rdebug-cmd.el +92 -0
  65. data/emacs/rdebug-core.el +502 -0
  66. data/emacs/rdebug-dbg.el +62 -0
  67. data/emacs/rdebug-error.el +79 -0
  68. data/emacs/rdebug-fns.el +111 -0
  69. data/emacs/rdebug-frames.el +230 -0
  70. data/emacs/rdebug-gud.el +242 -0
  71. data/emacs/rdebug-help.el +104 -0
  72. data/emacs/rdebug-info.el +83 -0
  73. data/emacs/rdebug-layouts.el +180 -0
  74. data/emacs/rdebug-locring.el +118 -0
  75. data/emacs/rdebug-output.el +106 -0
  76. data/emacs/rdebug-regexp.el +118 -0
  77. data/emacs/rdebug-secondary.el +260 -0
  78. data/emacs/rdebug-shortkey.el +175 -0
  79. data/emacs/rdebug-source.el +568 -0
  80. data/emacs/rdebug-track.el +392 -0
  81. data/emacs/rdebug-varbuf.el +150 -0
  82. data/emacs/rdebug-vars.el +125 -0
  83. data/emacs/rdebug-watch.el +132 -0
  84. data/emacs/rdebug.el +326 -0
  85. data/emacs/test/elk-test.el +242 -0
  86. data/emacs/test/test-annotate.el +103 -0
  87. data/emacs/test/test-cmd.el +116 -0
  88. data/emacs/test/test-core.el +104 -0
  89. data/emacs/test/test-fns.el +65 -0
  90. data/emacs/test/test-frames.el +62 -0
  91. data/emacs/test/test-gud.el +35 -0
  92. data/emacs/test/test-indent.el +58 -0
  93. data/emacs/test/test-regexp.el +144 -0
  94. data/emacs/test/test-shortkey.el +61 -0
  95. data/ext/ruby_debug/breakpoint.c +586 -0
  96. data/ext/ruby_debug/extconf.rb +49 -0
  97. data/ext/ruby_debug/ruby_debug.c +2624 -0
  98. data/ext/ruby_debug/ruby_debug.h +148 -0
  99. data/lib/ChangeLog +1065 -0
  100. data/lib/debugger.rb +7 -0
  101. data/lib/debugger/version.rb +3 -0
  102. data/lib/ruby-debug-base.rb +304 -0
  103. data/rdbg.rb +33 -0
  104. data/runner.sh +7 -0
  105. data/svn2cl_usermap +3 -0
  106. data/test/.cvsignore +1 -0
  107. data/test/base/base.rb +74 -0
  108. data/test/base/binding.rb +31 -0
  109. data/test/base/catchpoint.rb +26 -0
  110. data/test/base/load.rb +40 -0
  111. data/test/bp_loop_issue.rb +3 -0
  112. data/test/classes.rb +11 -0
  113. data/test/cli/commands/catchpoint_test.rb +36 -0
  114. data/test/cli/commands/unit/regexp.rb +42 -0
  115. data/test/config.yaml +8 -0
  116. data/test/data/annotate.cmd +29 -0
  117. data/test/data/annotate.right +139 -0
  118. data/test/data/break_bad.cmd +18 -0
  119. data/test/data/break_bad.right +28 -0
  120. data/test/data/break_loop_bug.cmd +5 -0
  121. data/test/data/break_loop_bug.right +15 -0
  122. data/test/data/breakpoints.cmd +38 -0
  123. data/test/data/breakpoints.right +98 -0
  124. data/test/data/catch.cmd +20 -0
  125. data/test/data/catch.right +49 -0
  126. data/test/data/catch2.cmd +19 -0
  127. data/test/data/catch2.right +65 -0
  128. data/test/data/catch3.cmd +11 -0
  129. data/test/data/catch3.right +37 -0
  130. data/test/data/condition.cmd +28 -0
  131. data/test/data/condition.right +65 -0
  132. data/test/data/ctrl.cmd +23 -0
  133. data/test/data/ctrl.right +70 -0
  134. data/test/data/display.cmd +24 -0
  135. data/test/data/display.right +44 -0
  136. data/test/data/dollar-0.right +2 -0
  137. data/test/data/dollar-0a.right +2 -0
  138. data/test/data/dollar-0b.right +2 -0
  139. data/test/data/edit.cmd +12 -0
  140. data/test/data/edit.right +19 -0
  141. data/test/data/emacs_basic.cmd +43 -0
  142. data/test/data/emacs_basic.right +106 -0
  143. data/test/data/enable.cmd +20 -0
  144. data/test/data/enable.right +36 -0
  145. data/test/data/finish.cmd +16 -0
  146. data/test/data/finish.right +31 -0
  147. data/test/data/frame.cmd +26 -0
  148. data/test/data/frame.right +55 -0
  149. data/test/data/help.cmd +20 -0
  150. data/test/data/help.right +21 -0
  151. data/test/data/history.right +7 -0
  152. data/test/data/info-thread.cmd +13 -0
  153. data/test/data/info-thread.right +37 -0
  154. data/test/data/info-var-bug2.cmd +5 -0
  155. data/test/data/info-var-bug2.right +10 -0
  156. data/test/data/info-var.cmd +23 -0
  157. data/test/data/info-var.right +52 -0
  158. data/test/data/info.cmd +21 -0
  159. data/test/data/info.right +65 -0
  160. data/test/data/jump.cmd +16 -0
  161. data/test/data/jump.right +56 -0
  162. data/test/data/jump2.cmd +16 -0
  163. data/test/data/jump2.right +44 -0
  164. data/test/data/linetrace.cmd +6 -0
  165. data/test/data/linetrace.right +23 -0
  166. data/test/data/list.cmd +19 -0
  167. data/test/data/list.right +127 -0
  168. data/test/data/method.cmd +10 -0
  169. data/test/data/method.right +21 -0
  170. data/test/data/methodsig.cmd +10 -0
  171. data/test/data/methodsig.right +20 -0
  172. data/test/data/next.cmd +22 -0
  173. data/test/data/next.right +61 -0
  174. data/test/data/noquit.right +1 -0
  175. data/test/data/output.cmd +6 -0
  176. data/test/data/output.right +31 -0
  177. data/test/data/pm-bug.cmd +7 -0
  178. data/test/data/pm-bug.right +12 -0
  179. data/test/data/post-mortem-next.cmd +8 -0
  180. data/test/data/post-mortem-next.right +14 -0
  181. data/test/data/post-mortem-osx.right +31 -0
  182. data/test/data/post-mortem.cmd +13 -0
  183. data/test/data/post-mortem.right +32 -0
  184. data/test/data/quit.cmd +6 -0
  185. data/test/data/quit.right +0 -0
  186. data/test/data/raise.cmd +11 -0
  187. data/test/data/raise.right +23 -0
  188. data/test/data/save.cmd +34 -0
  189. data/test/data/save.right +59 -0
  190. data/test/data/scope-var.cmd +42 -0
  191. data/test/data/scope-var.right +587 -0
  192. data/test/data/setshow.cmd +56 -0
  193. data/test/data/setshow.right +98 -0
  194. data/test/data/source.cmd +5 -0
  195. data/test/data/source.right +15 -0
  196. data/test/data/stepping.cmd +21 -0
  197. data/test/data/stepping.right +50 -0
  198. data/test/data/test-init-cygwin.right +7 -0
  199. data/test/data/test-init-osx.right +4 -0
  200. data/test/data/test-init.right +5 -0
  201. data/test/data/trace.right +14 -0
  202. data/test/dollar-0.rb +5 -0
  203. data/test/gcd-dbg-nox.rb +31 -0
  204. data/test/gcd-dbg.rb +30 -0
  205. data/test/gcd.rb +18 -0
  206. data/test/helper.rb +144 -0
  207. data/test/info-var-bug.rb +47 -0
  208. data/test/info-var-bug2.rb +2 -0
  209. data/test/jump.rb +14 -0
  210. data/test/jump2.rb +27 -0
  211. data/test/next.rb +18 -0
  212. data/test/null.rb +1 -0
  213. data/test/output.rb +2 -0
  214. data/test/pm-base.rb +22 -0
  215. data/test/pm-bug.rb +3 -0
  216. data/test/pm-catch.rb +12 -0
  217. data/test/pm-catch2.rb +27 -0
  218. data/test/pm-catch3.rb +47 -0
  219. data/test/pm.rb +11 -0
  220. data/test/raise.rb +3 -0
  221. data/test/rdebug-save.1 +7 -0
  222. data/test/runall +12 -0
  223. data/test/scope-var.rb +29 -0
  224. data/test/tdebug.rb +248 -0
  225. data/test/test-annotate.rb +25 -0
  226. data/test/test-break-bad.rb +37 -0
  227. data/test/test-breakpoints.rb +25 -0
  228. data/test/test-catch.rb +25 -0
  229. data/test/test-catch2.rb +25 -0
  230. data/test/test-catch3.rb +25 -0
  231. data/test/test-condition.rb +25 -0
  232. data/test/test-ctrl.rb +55 -0
  233. data/test/test-display.rb +26 -0
  234. data/test/test-dollar-0.rb +40 -0
  235. data/test/test-edit.rb +26 -0
  236. data/test/test-emacs-basic.rb +26 -0
  237. data/test/test-enable.rb +25 -0
  238. data/test/test-finish.rb +34 -0
  239. data/test/test-frame.rb +34 -0
  240. data/test/test-help.rb +60 -0
  241. data/test/test-hist.rb +68 -0
  242. data/test/test-info-thread.rb +32 -0
  243. data/test/test-info-var.rb +47 -0
  244. data/test/test-info.rb +26 -0
  245. data/test/test-init.rb +44 -0
  246. data/test/test-jump.rb +35 -0
  247. data/test/test-list.rb +25 -0
  248. data/test/test-method.rb +34 -0
  249. data/test/test-next.rb +25 -0
  250. data/test/test-output.rb +26 -0
  251. data/test/test-quit.rb +30 -0
  252. data/test/test-raise.rb +25 -0
  253. data/test/test-save.rb +31 -0
  254. data/test/test-scope-var.rb +25 -0
  255. data/test/test-setshow.rb +25 -0
  256. data/test/test-source.rb +25 -0
  257. data/test/test-stepping.rb +26 -0
  258. data/test/test-trace.rb +47 -0
  259. data/test/thread1.rb +26 -0
  260. data/test/trunc-call.rb +31 -0
  261. metadata +364 -0
@@ -0,0 +1,154 @@
1
+ Building and Installing ruby-debug from rubyforge's Subversion Repository (svn)
2
+
3
+ The below are Unix-centric instructions. If you have Microsoft Windows see
4
+ the section on building Microsoft Windows.
5
+
6
+
7
+ 0. Prerequisites: To build the package you'll need at a minimum:
8
+
9
+ - Ruby (of course). Currently only version 1.8.6 and above but not
10
+ version 1.9.x work.
11
+ - Ruby development headers. This typically includes a file called "ruby.h"
12
+ - A C compiler like GNU C (gcc)
13
+ - Rake
14
+ - Subversion (svn)
15
+
16
+ If you want to build the documentation and install Emacs files, you'll
17
+ also need:
18
+
19
+ - a POSIX shell
20
+ - autoconf
21
+ - automake
22
+ - GNU Make
23
+ - texinfo
24
+
25
+ 1. Basic package checkout and installation
26
+
27
+ Check out the trunk of repository following the instructions at
28
+ http://rubyforge.org/scm/?group_id=1900 For example on a Unixy system,
29
+ this may work:
30
+
31
+ mkdir ruby-debug
32
+ cd ruby-debug
33
+ svn checkout svn://rubyforge.org/var/svn/ruby-debug/trunk trunk
34
+
35
+ In order to make the Ruby gems, ruby-debug and ruby-debug-base, get
36
+ yourself into the trunk directory after the code has been checked out and run:
37
+
38
+ cd trunk # This is the same trunk checked out above.
39
+ rake package
40
+
41
+ If all goes well you should have some gem files put in the directory
42
+ pkg. Use the gem command to install that.
43
+
44
+ sudo gem install ruby-debug-*.gem # See gem help for other possibilities
45
+
46
+ If all goes well the rdebug script has been installed ruby-debug is
47
+ now ready to run. But if everything goes well you might want to run
48
+ the built-in regression tests to make sure everything is okay.
49
+ See step 3 below.
50
+
51
+ If the gem install didn't work,'t there may be a problem with your C
52
+ compiler or the Ruby headers are not installed.
53
+
54
+ 2. Trying out without installing.
55
+
56
+ You don't have to build a gem file to try out ruby debug. In fact when
57
+ developing new features for ruby-debug, developers often you want to
58
+ try it out *before* installing. If you have a problem in the latter
59
+ part of step 1 you may want to try this approach since we go into a
60
+ little more detail as to what happens under the covers when you do the
61
+ gem install.
62
+
63
+ Run (from trunk)
64
+ rake lib
65
+
66
+ This creates a Makefile and builds the ruby-debug shared library. (On
67
+ Unix the name is ruby_debug.so).
68
+
69
+ Once this is done you can run the debugger as you would rdebug using the
70
+ script rdbg.rb. For example (again from trunk)
71
+
72
+ ./rdbg.rb ~/my-ruby-program.rb
73
+
74
+ 3. Running the Regression tests
75
+
76
+ We've put together some basic tests to make sure ruby-debug is doing
77
+ what we think it should do. To run these (from trunk):
78
+
79
+ rake test
80
+
81
+ If you didn't build the ruby-debug shared library and skipped step 2,
82
+ don't worry "rake test" will do step 2 for you. You should see a line that
83
+ ends something like:
84
+
85
+ Finished in 2.767579 seconds.
86
+
87
+ 12 tests, 35 assertions, 0 failures, 0 errors
88
+
89
+ The number of seconds, tests, and assertions may be different from the
90
+ above. However you *should* see exactly "0 failures, 0 errors".
91
+
92
+ 4. Building the documentation and testing/installing Emacs files
93
+
94
+ Of course, I recommend you read the ruby-debug manual that comes with
95
+ the package. If you have the prerequisites described above, run this
96
+ once:
97
+ sh ./autogen.sh
98
+
99
+ Then run:
100
+ ./configure
101
+ make
102
+ make test # Runs Emacs regression tests
103
+ sudo make install # Or arrange to do this as root
104
+
105
+
106
+ Microsoft Windows
107
+
108
+ A problem here seems to be that the "One-click" install is compiled
109
+ using Microsoft Visual Studio C 6 which is not sold anymore and is
110
+ rather old.
111
+
112
+ Instead I suggest building via mingw/msys.
113
+ http://eigenclass.org/hiki.rb?cmd=view&p=cross+compiling+rcovrt&key=mingw has instructions on how to do. Some amendments to these instructions.
114
+
115
+ First, those instructions are a little GNU/Linux centric. If you are
116
+ using Ubuntu or Debian, then this should be the easiest to follow the
117
+ instructions. On Ubuntu or Debian there is a mingw3 Debian
118
+ package. Installing that will give you the cross compiler that is a
119
+ prerequisite. Alternatively if you are running MS Windows I notice
120
+ that cygwin also has a mingw package. Or possibly you could use MinGW
121
+ directly. For other OS's you might have to build a cross-compiler,
122
+ i.e. gcc which emits win32 code and can create a win32 DLL.
123
+
124
+ After you have a cross compiler you need to download the Ruby source
125
+ and basically build a ruby interpreter. The cross-compile.sh script
126
+ works although when I downloaded it, it had lots of blank space at the
127
+ beginning which will mess up the Unix magic interpretation. That is
128
+ remove the blanks in front of "#/bin/sh"
129
+
130
+ On my system, this script fails in running "make ruby" because the
131
+ fake.rb that got created needed to have a small change:
132
+
133
+ ALT_SEPARATOR = "\"; \
134
+ should be
135
+ ALT_SEPARATOR = "\\"; \
136
+
137
+ After fixing this, run
138
+ make ruby
139
+ Also, I needed to run
140
+ make rubyw
141
+
142
+ And then "make install" as indicated.
143
+
144
+ Once all of that's in place, the place you want be is in
145
+ ruby-debug/trunk/ext/win32, not ruby-debug/ext.
146
+
147
+ So let's say you've installed the cross-compiled install ruby in
148
+ /usr/local/ruby-mingw32/. Here then are the commands to build ruby-debug-base-xxx-mswin32.gem
149
+
150
+ cd .../ruby-debug/trunk/ext/win32
151
+ ruby -I /usr/local/ruby-mingw32/lib/ruby/1.8/i386-mingw32 ../extconf.rb
152
+ make # Not rake
153
+ cd ../.. # back in ruby-debug/trunk
154
+ rake win32_gem
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.
@@ -0,0 +1,14 @@
1
+ SUBDIRS = doc emacs
2
+ PHONY = test ChangeLogs
3
+ test: check
4
+ ChangeLogs: ChangeLog doc/ChangeLog emacs/ChangeLog lib/ChangeLog
5
+ ChangeLog:
6
+ svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk \
7
+ cli test bin AUTHORS CHANGES LICENSE README runner.sh -o ChangeLog
8
+ lib/ChangeLog:
9
+ svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk \
10
+ lib ext -o lib/ChangeLog
11
+ doc/ChangeLog:
12
+ svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk/doc -o doc/ChangeLog
13
+ emacs/ChangeLog:
14
+ svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk/emacs -o emacs/ChangeLog
@@ -0,0 +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.
@@ -0,0 +1,10 @@
1
+ ## Description
2
+ A fork of ruby-debug19 that works on 1.9.3 and installs easily.
3
+
4
+ ## Usage
5
+
6
+ ```ruby
7
+ require 'debugger'; debugger
8
+ ```
9
+
10
+ TODO
@@ -0,0 +1,266 @@
1
+ #!/usr/bin/env rake
2
+ # -*- Ruby -*-
3
+ require 'rubygems'
4
+ require 'rake/gempackagetask'
5
+ require 'rake/rdoctask'
6
+ require 'rake/testtask'
7
+ require 'rake/extensiontask'
8
+
9
+ Rake::ExtensionTask.new('ruby_debug')
10
+
11
+ SO_NAME = "ruby_debug.so"
12
+
13
+ # ------- Default Package ----------
14
+ RUBY_DEBUG_VERSION = open("ext/ruby_debug/ruby_debug.c") do |f|
15
+ f.grep(/^#define DEBUG_VERSION/).first[/"(.+)"/,1]
16
+ end
17
+
18
+ RUBY_DEBUG_TEENY = ".0"
19
+ RUBY_DEBUG_BASE_TEENY = ".0"
20
+
21
+ COMMON_FILES = FileList[
22
+ 'AUTHORS',
23
+ 'CHANGES',
24
+ 'LICENSE',
25
+ 'README',
26
+ 'Rakefile',
27
+ ]
28
+
29
+ CLI_TEST_FILE_LIST = FileList['test/cli/commands/unit/*.rb',
30
+ 'test/cli/commands/*_test.rb',
31
+ 'test/cli/**/*_test.rb',
32
+ 'test/test-*.rb']
33
+ CLI_FILES = COMMON_FILES + FileList[
34
+ "cli/**/*",
35
+ 'ChangeLog',
36
+ 'bin/*',
37
+ 'doc/rdebug.1',
38
+ 'test/**/data/*.cmd',
39
+ 'test/**/data/*.right',
40
+ 'test/**/*.rb',
41
+ 'rdbg.rb',
42
+ CLI_TEST_FILE_LIST
43
+ ]
44
+
45
+ BASE_TEST_FILE_LIST = %w(
46
+ test/base/base.rb
47
+ test/base/binding.rb
48
+ test/base/catchpoint.rb)
49
+ BASE_FILES = COMMON_FILES + FileList[
50
+ 'ext/ruby_debug/breakpoint.c',
51
+ 'ext/ruby_debug/extconf.rb',
52
+ 'ext/ruby_debug/ruby_debug.c',
53
+ 'ext/ruby_debug/ruby_debug.h',
54
+ 'ext/win32/*',
55
+ 'lib/**/*',
56
+ BASE_TEST_FILE_LIST,
57
+ ]
58
+
59
+ desc "Test everything."
60
+ task :test => :test_base do
61
+ Rake::TestTask.new(:test) do |t|
62
+ t.libs << './ext'
63
+ t.libs << './lib'
64
+ t.libs << './cli'
65
+ t.test_files = CLI_TEST_FILE_LIST
66
+ t.verbose = true
67
+ end
68
+ end
69
+
70
+ desc "Test ruby-debug-base."
71
+ task :test_base => :lib do
72
+ Rake::TestTask.new(:test_base) do |t|
73
+ t.libs << './ext'
74
+ t.libs << './lib'
75
+ t.test_files = FileList[BASE_TEST_FILE_LIST]
76
+ t.verbose = true
77
+ end
78
+ end
79
+
80
+ desc "Test everything - same as test."
81
+ task :check => :test
82
+
83
+ desc "Create the core ruby-debug shared library extension"
84
+ task :lib do
85
+ Dir.chdir("ext") do
86
+ system("#{Gem.ruby} extconf.rb && make")
87
+ end
88
+ end
89
+
90
+ desc "Compile Emacs code"
91
+ task :emacs => "emacs/rdebug.elc"
92
+ file "emacs/rdebug.elc" => ["emacs/elisp-comp", "emacs/rdebug.el"] do
93
+ Dir.chdir("emacs") do
94
+ system("./elisp-comp ./rdebug.el")
95
+ end
96
+ end
97
+
98
+ desc "Create a GNU-style ChangeLog via svn2cl"
99
+ task :ChangeLog do
100
+ system("svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk")
101
+ system("svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk/ext -o ext/ChangeLog")
102
+ system("svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk/lib -o lib/ChangeLog")
103
+ end
104
+
105
+ # Base GEM Specification
106
+ base_spec = Gem::Specification.new do |spec|
107
+ spec.name = "ruby-debug-base19"
108
+
109
+ spec.homepage = "http://rubyforge.org/projects/ruby-debug19/"
110
+ spec.summary = "Fast Ruby debugger - core component"
111
+ spec.description = <<-EOF
112
+ ruby-debug-base19 is a fast implementation of the standard Ruby debugger debug.rb.
113
+ It is implemented by utilizing a new Ruby C API hook. The core component
114
+ provides support that front-ends can build on. It provides breakpoint
115
+ handling, bindings for stack frames among other things.
116
+ EOF
117
+
118
+ spec.version = RUBY_DEBUG_VERSION + RUBY_DEBUG_BASE_TEENY
119
+
120
+ spec.authors = ["Kent Sibilev", "Mark Moseley"]
121
+ spec.email = "mark@fast-software.com"
122
+ spec.platform = Gem::Platform::RUBY
123
+ spec.require_path = "lib"
124
+ spec.extensions = ["ext/ruby_debug/extconf.rb"]
125
+ spec.files = BASE_FILES.to_a
126
+
127
+ spec.required_ruby_version = '>= 1.8.2'
128
+ spec.date = Time.now
129
+ spec.rubyforge_project = 'ruby-debug19'
130
+ spec.add_dependency('ruby_core_source', '>= 0.1.4')
131
+ spec.add_dependency('linecache19', '>= 0.5.11')
132
+
133
+ spec.test_files = FileList[BASE_TEST_FILE_LIST]
134
+
135
+ # rdoc
136
+ spec.has_rdoc = true
137
+ spec.extra_rdoc_files = ['README', 'ext/ruby_debug/ruby_debug.c']
138
+ end
139
+
140
+ cli_spec = Gem::Specification.new do |spec|
141
+ spec.name = "ruby-debug19"
142
+
143
+ spec.homepage = "http://rubyforge.org/projects/ruby-debug19/"
144
+ spec.summary = "Command line interface (CLI) for ruby-debug-base19"
145
+ spec.description = <<-EOF
146
+ A generic command line interface for ruby-debug.
147
+ EOF
148
+
149
+ spec.version = RUBY_DEBUG_VERSION + RUBY_DEBUG_TEENY
150
+
151
+ spec.authors = ["Kent Sibilev", "Mark Moseley"]
152
+ spec.email = "mark@fast-software.com"
153
+ spec.platform = Gem::Platform::RUBY
154
+ spec.require_path = "cli"
155
+ spec.bindir = "bin"
156
+ spec.executables = ["rdebug"]
157
+ spec.files = CLI_FILES.to_a
158
+
159
+ spec.required_ruby_version = '>= 1.8.2'
160
+ spec.date = Time.now
161
+ spec.rubyforge_project = 'ruby-debug'
162
+ spec.add_dependency('columnize', '>= 0.3.1')
163
+ spec.add_dependency('linecache19', '>= 0.5.11')
164
+ spec.add_dependency('ruby-debug-base19', '>= 0.12.0')
165
+
166
+ # FIXME: work out operational logistics for this
167
+ # spec.test_files = FileList[CLI_TEST_FILE_LIST]
168
+
169
+ # rdoc
170
+ spec.has_rdoc = true
171
+ spec.extra_rdoc_files = ['README']
172
+ end
173
+
174
+ # Rake task to build the default package
175
+ Rake::GemPackageTask.new(base_spec) do |pkg|
176
+ pkg.need_tar = true
177
+ end
178
+ Rake::GemPackageTask.new(cli_spec) do |pkg|
179
+ pkg.need_tar = true
180
+ end
181
+
182
+ task :default => [:package]
183
+
184
+ # Windows specification
185
+ win_spec = base_spec.clone
186
+ win_spec.extensions = []
187
+ ## win_spec.platform = Gem::Platform::WIN32 # deprecated
188
+ win_spec.platform = 'mswin32'
189
+ win_spec.files += ["lib/#{SO_NAME}"]
190
+
191
+ desc "Create Windows Gem"
192
+ task :win32_gem do
193
+ # Copy the win32 extension the top level directory
194
+ current_dir = File.expand_path(File.dirname(__FILE__))
195
+ source = File.join(current_dir, "ext", "win32", SO_NAME)
196
+ target = File.join(current_dir, "lib", SO_NAME)
197
+ cp(source, target)
198
+
199
+ # Create the gem, then move it to pkg.
200
+ Gem::Builder.new(win_spec).build
201
+ gem_file = "#{win_spec.name}-#{win_spec.version}-#{win_spec.platform}.gem"
202
+ mv(gem_file, "pkg/#{gem_file}")
203
+
204
+ # Remove win extension from top level directory.
205
+ rm(target)
206
+ end
207
+
208
+ desc "Publish ruby-debug to RubyForge."
209
+ task :publish do
210
+ require 'rake/contrib/sshpublisher'
211
+
212
+ # Get ruby-debug path.
213
+ ruby_debug_path = File.expand_path(File.dirname(__FILE__))
214
+
215
+ Rake::SshDirPublisher.new("kent@rubyforge.org",
216
+ "/var/www/gforge-projects/ruby-debug", ruby_debug_path)
217
+ end
218
+
219
+ desc "Remove built files"
220
+ task :clean do
221
+ cd "ext" do
222
+ if File.exists?("Makefile")
223
+ sh "make clean"
224
+ rm "Makefile"
225
+ end
226
+ derived_files = Dir.glob(".o") + Dir.glob("*.so")
227
+ rm derived_files unless derived_files.empty?
228
+ end
229
+ end
230
+
231
+ # --------- RDoc Documentation ------
232
+ desc "Generate rdoc documentation"
233
+ Rake::RDocTask.new("rdoc") do |rdoc|
234
+ rdoc.rdoc_dir = 'doc/rdoc'
235
+ rdoc.title = "ruby-debug"
236
+ # Show source inline with line numbers
237
+ rdoc.options << "--inline-source" << "--line-numbers"
238
+ # Make the readme file the start page for the generated html
239
+ rdoc.options << '--main' << 'README'
240
+ rdoc.rdoc_files.include('bin/**/*',
241
+ 'cli/ruby-debug/commands/*.rb',
242
+ 'lib/**/*.rb',
243
+ 'ext/**/ruby_debug.c',
244
+ 'README',
245
+ 'LICENSE')
246
+ end
247
+
248
+ desc "Publish the release files to RubyForge."
249
+ task :rubyforge_upload do
250
+ `rubyforge login`
251
+ release_command = "rubyforge add_release #{PKG_NAME} #{PKG_NAME} '#{PKG_NAME}-#{PKG_VERSION}' pkg/#{PKG_NAME}-#{PKG_VERSION}.gem"
252
+ puts release_command
253
+ system(release_command)
254
+ end
255
+
256
+ PKG_NAME = 'ruby-debug'
257
+ desc "Publish the release files to RubyForge."
258
+ task :rubyforge_upload do
259
+ `rubyforge login`
260
+ for pkg_name in ['ruby-debug', 'ruby-debug-base'] do
261
+ pkg_file_name = "#{pkg_name}-#{pkg_version}"
262
+ release_command = "rubyforge add_release ruby-debug #{pkg_name} '#{pkg_file_name}' pkg/#{pkg_file_name}.gem"
263
+ puts release_command
264
+ system(release_command)
265
+ end
266
+ end