Skip to content
Browse files

SVN RubyForge pull

  • Loading branch information...
1 parent f0eccc9 commit 0768eb098817fae08613f0492b89d6620f2c7d7c @mark-moseley committed Jul 21, 2009
Showing with 33,294 additions and 0 deletions.
  1. +7 −0 AUTHORS
  2. +334 −0 CHANGES
  3. +5,655 −0 ChangeLog
  4. +154 −0 INSTALL.SVN
  5. +23 −0 LICENSE
  6. +14 −0 Makefile.am
  7. +255 −0 Rakefile
  8. +4 −0 autogen.sh
  9. +2 −0 bin/.svn/README.txt
  10. 0 bin/.svn/empty-file
  11. +22 −0 bin/.svn/entries
  12. +1 −0 bin/.svn/format
  13. +5 −0 bin/.svn/prop-base/rdebug.svn-base
  14. +5 −0 bin/.svn/props/rdebug.svn-work
  15. +415 −0 bin/.svn/text-base/rdebug.svn-base
  16. +415 −0 bin/rdebug
  17. +2 −0 cli/.svn/README.txt
  18. 0 cli/.svn/empty-file
  19. +25 −0 cli/.svn/entries
  20. +1 −0 cli/.svn/format
  21. +1 −0 cli/.svn/prop-base/ruby-debug.rb.svn-base
  22. +1 −0 cli/.svn/props/ruby-debug.rb.svn-work
  23. +176 −0 cli/.svn/text-base/ruby-debug.rb.svn-base
  24. +176 −0 cli/ruby-debug.rb
  25. +2 −0 cli/ruby-debug/.svn/README.txt
  26. 0 cli/ruby-debug/.svn/empty-file
  27. +61 −0 cli/ruby-debug/.svn/entries
  28. +1 −0 cli/ruby-debug/.svn/format
  29. +1 −0 cli/ruby-debug/.svn/prop-base/command.rb.svn-base
  30. +1 −0 cli/ruby-debug/.svn/prop-base/debugger.rb.svn-base
  31. +1 −0 cli/ruby-debug/.svn/prop-base/helper.rb.svn-base
  32. +1 −0 cli/ruby-debug/.svn/prop-base/interface.rb.svn-base
  33. +1 −0 cli/ruby-debug/.svn/prop-base/processor.rb.svn-base
  34. +1 −0 cli/ruby-debug/.svn/props/command.rb.svn-work
  35. +1 −0 cli/ruby-debug/.svn/props/debugger.rb.svn-work
  36. +1 −0 cli/ruby-debug/.svn/props/helper.rb.svn-work
  37. +1 −0 cli/ruby-debug/.svn/props/interface.rb.svn-work
  38. +1 −0 cli/ruby-debug/.svn/props/processor.rb.svn-work
  39. +228 −0 cli/ruby-debug/.svn/text-base/command.rb.svn-base
  40. +5 −0 cli/ruby-debug/.svn/text-base/debugger.rb.svn-base
  41. +69 −0 cli/ruby-debug/.svn/text-base/helper.rb.svn-base
  42. +232 −0 cli/ruby-debug/.svn/text-base/interface.rb.svn-base
  43. +474 −0 cli/ruby-debug/.svn/text-base/processor.rb.svn-base
  44. +228 −0 cli/ruby-debug/command.rb
  45. +2 −0 cli/ruby-debug/commands/.svn/README.txt
  46. 0 cli/ruby-debug/commands/.svn/empty-file
  47. +265 −0 cli/ruby-debug/commands/.svn/entries
  48. +1 −0 cli/ruby-debug/commands/.svn/format
  49. +1 −0 cli/ruby-debug/commands/.svn/prop-base/breakpoints.rb.svn-base
  50. +1 −0 cli/ruby-debug/commands/.svn/prop-base/catchpoint.rb.svn-base
  51. +1 −0 cli/ruby-debug/commands/.svn/prop-base/condition.rb.svn-base
  52. +1 −0 cli/ruby-debug/commands/.svn/prop-base/continue.rb.svn-base
  53. +1 −0 cli/ruby-debug/commands/.svn/prop-base/control.rb.svn-base
  54. +1 −0 cli/ruby-debug/commands/.svn/prop-base/display.rb.svn-base
  55. +1 −0 cli/ruby-debug/commands/.svn/prop-base/edit.rb.svn-base
  56. +1 −0 cli/ruby-debug/commands/.svn/prop-base/enable.rb.svn-base
  57. +1 −0 cli/ruby-debug/commands/.svn/prop-base/eval.rb.svn-base
  58. +1 −0 cli/ruby-debug/commands/.svn/prop-base/finish.rb.svn-base
  59. +1 −0 cli/ruby-debug/commands/.svn/prop-base/frame.rb.svn-base
  60. +1 −0 cli/ruby-debug/commands/.svn/prop-base/help.rb.svn-base
  61. +1 −0 cli/ruby-debug/commands/.svn/prop-base/info.rb.svn-base
  62. +1 −0 cli/ruby-debug/commands/.svn/prop-base/irb.rb.svn-base
  63. +5 −0 cli/ruby-debug/commands/.svn/prop-base/kill.rb.svn-base
  64. +1 −0 cli/ruby-debug/commands/.svn/prop-base/list.rb.svn-base
  65. +1 −0 cli/ruby-debug/commands/.svn/prop-base/method.rb.svn-base
  66. +1 −0 cli/ruby-debug/commands/.svn/prop-base/quit.rb.svn-base
  67. +1 −0 cli/ruby-debug/commands/.svn/prop-base/reload.rb.svn-base
  68. +1 −0 cli/ruby-debug/commands/.svn/prop-base/save.rb.svn-base
  69. +1 −0 cli/ruby-debug/commands/.svn/prop-base/set.rb.svn-base
  70. +1 −0 cli/ruby-debug/commands/.svn/prop-base/show.rb.svn-base
  71. +1 −0 cli/ruby-debug/commands/.svn/prop-base/source.rb.svn-base
  72. +1 −0 cli/ruby-debug/commands/.svn/prop-base/stepping.rb.svn-base
  73. +1 −0 cli/ruby-debug/commands/.svn/prop-base/threads.rb.svn-base
  74. +1 −0 cli/ruby-debug/commands/.svn/prop-base/tmate.rb.svn-base
  75. +1 −0 cli/ruby-debug/commands/.svn/prop-base/trace.rb.svn-base
  76. +1 −0 cli/ruby-debug/commands/.svn/prop-base/variables.rb.svn-base
  77. +1 −0 cli/ruby-debug/commands/.svn/props/breakpoints.rb.svn-work
  78. +1 −0 cli/ruby-debug/commands/.svn/props/catchpoint.rb.svn-work
  79. +1 −0 cli/ruby-debug/commands/.svn/props/condition.rb.svn-work
  80. +1 −0 cli/ruby-debug/commands/.svn/props/continue.rb.svn-work
  81. +1 −0 cli/ruby-debug/commands/.svn/props/control.rb.svn-work
  82. +1 −0 cli/ruby-debug/commands/.svn/props/display.rb.svn-work
  83. +1 −0 cli/ruby-debug/commands/.svn/props/edit.rb.svn-work
  84. +1 −0 cli/ruby-debug/commands/.svn/props/enable.rb.svn-work
  85. +1 −0 cli/ruby-debug/commands/.svn/props/eval.rb.svn-work
  86. +1 −0 cli/ruby-debug/commands/.svn/props/finish.rb.svn-work
  87. +1 −0 cli/ruby-debug/commands/.svn/props/frame.rb.svn-work
  88. +1 −0 cli/ruby-debug/commands/.svn/props/help.rb.svn-work
  89. +1 −0 cli/ruby-debug/commands/.svn/props/info.rb.svn-work
  90. +1 −0 cli/ruby-debug/commands/.svn/props/irb.rb.svn-work
  91. +5 −0 cli/ruby-debug/commands/.svn/props/kill.rb.svn-work
  92. +1 −0 cli/ruby-debug/commands/.svn/props/list.rb.svn-work
  93. +1 −0 cli/ruby-debug/commands/.svn/props/method.rb.svn-work
  94. +1 −0 cli/ruby-debug/commands/.svn/props/quit.rb.svn-work
  95. +1 −0 cli/ruby-debug/commands/.svn/props/reload.rb.svn-work
  96. +1 −0 cli/ruby-debug/commands/.svn/props/save.rb.svn-work
  97. +1 −0 cli/ruby-debug/commands/.svn/props/set.rb.svn-work
  98. +1 −0 cli/ruby-debug/commands/.svn/props/show.rb.svn-work
  99. +1 −0 cli/ruby-debug/commands/.svn/props/source.rb.svn-work
  100. +1 −0 cli/ruby-debug/commands/.svn/props/stepping.rb.svn-work
  101. +1 −0 cli/ruby-debug/commands/.svn/props/threads.rb.svn-work
  102. +1 −0 cli/ruby-debug/commands/.svn/props/tmate.rb.svn-work
  103. +1 −0 cli/ruby-debug/commands/.svn/props/trace.rb.svn-work
  104. +1 −0 cli/ruby-debug/commands/.svn/props/variables.rb.svn-work
  105. +153 −0 cli/ruby-debug/commands/.svn/text-base/breakpoints.rb.svn-base
  106. +55 −0 cli/ruby-debug/commands/.svn/text-base/catchpoint.rb.svn-base
  107. +49 −0 cli/ruby-debug/commands/.svn/text-base/condition.rb.svn-base
  108. +38 −0 cli/ruby-debug/commands/.svn/text-base/continue.rb.svn-base
  109. +107 −0 cli/ruby-debug/commands/.svn/text-base/control.rb.svn-base
  110. +120 −0 cli/ruby-debug/commands/.svn/text-base/display.rb.svn-base
  111. +48 −0 cli/ruby-debug/commands/.svn/text-base/edit.rb.svn-base
  112. +202 −0 cli/ruby-debug/commands/.svn/text-base/enable.rb.svn-base
  113. +176 −0 cli/ruby-debug/commands/.svn/text-base/eval.rb.svn-base
  114. +42 −0 cli/ruby-debug/commands/.svn/text-base/finish.rb.svn-base
  115. +301 −0 cli/ruby-debug/commands/.svn/text-base/frame.rb.svn-base
  116. +56 −0 cli/ruby-debug/commands/.svn/text-base/help.rb.svn-base
  117. +469 −0 cli/ruby-debug/commands/.svn/text-base/info.rb.svn-base
  118. +123 −0 cli/ruby-debug/commands/.svn/text-base/irb.rb.svn-base
  119. +51 −0 cli/ruby-debug/commands/.svn/text-base/kill.rb.svn-base
  120. +94 −0 cli/ruby-debug/commands/.svn/text-base/list.rb.svn-base
  121. +84 −0 cli/ruby-debug/commands/.svn/text-base/method.rb.svn-base
  122. +39 −0 cli/ruby-debug/commands/.svn/text-base/quit.rb.svn-base
  123. +40 −0 cli/ruby-debug/commands/.svn/text-base/reload.rb.svn-base
  124. +90 −0 cli/ruby-debug/commands/.svn/text-base/save.rb.svn-base
  125. +237 −0 cli/ruby-debug/commands/.svn/text-base/set.rb.svn-base
  126. +253 −0 cli/ruby-debug/commands/.svn/text-base/show.rb.svn-base
  127. +36 −0 cli/ruby-debug/commands/.svn/text-base/source.rb.svn-base
  128. +81 −0 cli/ruby-debug/commands/.svn/text-base/stepping.rb.svn-base
  129. +189 −0 cli/ruby-debug/commands/.svn/text-base/threads.rb.svn-base
  130. +36 −0 cli/ruby-debug/commands/.svn/text-base/tmate.rb.svn-base
  131. +57 −0 cli/ruby-debug/commands/.svn/text-base/trace.rb.svn-base
  132. +199 −0 cli/ruby-debug/commands/.svn/text-base/variables.rb.svn-base
  133. +153 −0 cli/ruby-debug/commands/breakpoints.rb
  134. +55 −0 cli/ruby-debug/commands/catchpoint.rb
  135. +49 −0 cli/ruby-debug/commands/condition.rb
  136. +38 −0 cli/ruby-debug/commands/continue.rb
  137. +107 −0 cli/ruby-debug/commands/control.rb
  138. +120 −0 cli/ruby-debug/commands/display.rb
  139. +48 −0 cli/ruby-debug/commands/edit.rb
  140. +202 −0 cli/ruby-debug/commands/enable.rb
  141. +176 −0 cli/ruby-debug/commands/eval.rb
  142. +42 −0 cli/ruby-debug/commands/finish.rb
  143. +301 −0 cli/ruby-debug/commands/frame.rb
  144. +56 −0 cli/ruby-debug/commands/help.rb
  145. +469 −0 cli/ruby-debug/commands/info.rb
  146. +123 −0 cli/ruby-debug/commands/irb.rb
  147. +51 −0 cli/ruby-debug/commands/kill.rb
  148. +94 −0 cli/ruby-debug/commands/list.rb
  149. +84 −0 cli/ruby-debug/commands/method.rb
  150. +39 −0 cli/ruby-debug/commands/quit.rb
  151. +40 −0 cli/ruby-debug/commands/reload.rb
  152. +90 −0 cli/ruby-debug/commands/save.rb
  153. +237 −0 cli/ruby-debug/commands/set.rb
  154. +253 −0 cli/ruby-debug/commands/show.rb
  155. +36 −0 cli/ruby-debug/commands/source.rb
  156. +81 −0 cli/ruby-debug/commands/stepping.rb
  157. +189 −0 cli/ruby-debug/commands/threads.rb
  158. +36 −0 cli/ruby-debug/commands/tmate.rb
  159. +57 −0 cli/ruby-debug/commands/trace.rb
  160. +199 −0 cli/ruby-debug/commands/variables.rb
  161. +5 −0 cli/ruby-debug/debugger.rb
  162. +69 −0 cli/ruby-debug/helper.rb
  163. +232 −0 cli/ruby-debug/interface.rb
  164. +474 −0 cli/ruby-debug/processor.rb
  165. +12 −0 configure.ac
  166. +42 −0 doc/.cvsignore
  167. +2 −0 doc/.svn/README.txt
  168. +47 −0 doc/.svn/dir-prop-base
  169. +47 −0 doc/.svn/dir-props
  170. 0 doc/.svn/empty-file
  171. +113 −0 doc/.svn/entries
  172. +1 −0 doc/.svn/format
  173. +1 −0 doc/.svn/prop-base/.cvsignore.svn-base
  174. +1 −0 doc/.svn/prop-base/Makefile.am.svn-base
  175. +1 −0 doc/.svn/prop-base/emacs-notes.txt.svn-base
  176. +1 −0 doc/.svn/prop-base/hanoi.rb.svn-base
  177. +1 −0 doc/.svn/prop-base/primes.rb.svn-base
  178. +1 −0 doc/.svn/prop-base/rdebug-emacs.texi.svn-base
  179. +5 −0 doc/.svn/prop-base/rdebug.1.svn-base
  180. +1 −0 doc/.svn/prop-base/ruby-debug.texi.svn-base
  181. +1 −0 doc/.svn/prop-base/test-tri2.rb.svn-base
  182. +1 −0 doc/.svn/prop-base/tri3.rb.svn-base
  183. +1 −0 doc/.svn/prop-base/triangle.rb.svn-base
  184. +1 −0 doc/.svn/props/.cvsignore.svn-work
  185. +1 −0 doc/.svn/props/Makefile.am.svn-work
  186. +1 −0 doc/.svn/props/emacs-notes.txt.svn-work
  187. +1 −0 doc/.svn/props/hanoi.rb.svn-work
  188. +1 −0 doc/.svn/props/primes.rb.svn-work
  189. +1 −0 doc/.svn/props/rdebug-emacs.texi.svn-work
  190. +5 −0 doc/.svn/props/rdebug.1.svn-work
  191. +1 −0 doc/.svn/props/ruby-debug.texi.svn-work
  192. +1 −0 doc/.svn/props/test-tri2.rb.svn-work
  193. +1 −0 doc/.svn/props/tri3.rb.svn-work
  194. +1 −0 doc/.svn/props/triangle.rb.svn-work
  195. +42 −0 doc/.svn/text-base/.cvsignore.svn-base
  196. +63 −0 doc/.svn/text-base/Makefile.am.svn-base
  197. +38 −0 doc/.svn/text-base/emacs-notes.txt.svn-base
  198. +35 −0 doc/.svn/text-base/hanoi.rb.svn-base
  199. +28 −0 doc/.svn/text-base/primes.rb.svn-base
  200. +1,030 −0 doc/.svn/text-base/rdebug-emacs.texi.svn-base
  201. +241 −0 doc/.svn/text-base/rdebug.1.svn-base
  202. +3,982 −0 doc/.svn/text-base/ruby-debug.texi.svn-base
  203. +18 −0 doc/.svn/text-base/test-tri2.rb.svn-base
  204. +8 −0 doc/.svn/text-base/tri3.rb.svn-base
  205. +12 −0 doc/.svn/text-base/triangle.rb.svn-base
  206. +63 −0 doc/Makefile.am
  207. +38 −0 doc/emacs-notes.txt
  208. +35 −0 doc/hanoi.rb
  209. +28 −0 doc/primes.rb
  210. +1,030 −0 doc/rdebug-emacs.texi
  211. +241 −0 doc/rdebug.1
  212. +3,982 −0 doc/ruby-debug.texi
  213. +18 −0 doc/test-tri2.rb
  214. +8 −0 doc/tri3.rb
  215. +12 −0 doc/triangle.rb
  216. +2 −0 emacs/.svn/README.txt
  217. +10 −0 emacs/.svn/dir-prop-base
  218. +10 −0 emacs/.svn/dir-props
  219. 0 emacs/.svn/empty-file
  220. +233 −0 emacs/.svn/entries
  221. +1 −0 emacs/.svn/format
  222. +1 −0 emacs/.svn/prop-base/Makefile.am.svn-base
  223. +5 −0 emacs/.svn/prop-base/rdebug-annotate.el.svn-base
  224. +5 −0 emacs/.svn/prop-base/rdebug-breaks.el.svn-base
  225. +5 −0 emacs/.svn/prop-base/rdebug-cmd.el.svn-base
  226. +5 −0 emacs/.svn/prop-base/rdebug-core.el.svn-base
  227. +5 −0 emacs/.svn/prop-base/rdebug-dbg.el.svn-base
  228. +5 −0 emacs/.svn/prop-base/rdebug-error.el.svn-base
  229. +1 −0 emacs/.svn/prop-base/rdebug-fns.el.svn-base
  230. +5 −0 emacs/.svn/prop-base/rdebug-frames.el.svn-base
  231. +5 −0 emacs/.svn/prop-base/rdebug-gud.el.svn-base
  232. +5 −0 emacs/.svn/prop-base/rdebug-help.el.svn-base
  233. +1 −0 emacs/.svn/prop-base/rdebug-info.el.svn-base
  234. +5 −0 emacs/.svn/prop-base/rdebug-layouts.el.svn-base
  235. +5 −0 emacs/.svn/prop-base/rdebug-locring.el.svn-base
  236. +5 −0 emacs/.svn/prop-base/rdebug-output.el.svn-base
  237. +5 −0 emacs/.svn/prop-base/rdebug-regexp.el.svn-base
  238. +5 −0 emacs/.svn/prop-base/rdebug-secondary.el.svn-base
  239. +5 −0 emacs/.svn/prop-base/rdebug-shortkey.el.svn-base
  240. +5 −0 emacs/.svn/prop-base/rdebug-source.el.svn-base
  241. +5 −0 emacs/.svn/prop-base/rdebug-track.el.svn-base
  242. +5 −0 emacs/.svn/prop-base/rdebug-varbuf.el.svn-base
  243. +5 −0 emacs/.svn/prop-base/rdebug-vars.el.svn-base
  244. +5 −0 emacs/.svn/prop-base/rdebug-watch.el.svn-base
  245. +1 −0 emacs/.svn/prop-base/rdebug.el.svn-base
  246. +1 −0 emacs/.svn/props/Makefile.am.svn-work
  247. +5 −0 emacs/.svn/props/rdebug-annotate.el.svn-work
  248. +5 −0 emacs/.svn/props/rdebug-breaks.el.svn-work
  249. +5 −0 emacs/.svn/props/rdebug-cmd.el.svn-work
  250. +5 −0 emacs/.svn/props/rdebug-core.el.svn-work
  251. +5 −0 emacs/.svn/props/rdebug-dbg.el.svn-work
  252. +5 −0 emacs/.svn/props/rdebug-error.el.svn-work
  253. +1 −0 emacs/.svn/props/rdebug-fns.el.svn-work
  254. +5 −0 emacs/.svn/props/rdebug-frames.el.svn-work
  255. +5 −0 emacs/.svn/props/rdebug-gud.el.svn-work
  256. +5 −0 emacs/.svn/props/rdebug-help.el.svn-work
  257. +1 −0 emacs/.svn/props/rdebug-info.el.svn-work
  258. +5 −0 emacs/.svn/props/rdebug-layouts.el.svn-work
  259. +5 −0 emacs/.svn/props/rdebug-locring.el.svn-work
  260. +5 −0 emacs/.svn/props/rdebug-output.el.svn-work
  261. +5 −0 emacs/.svn/props/rdebug-regexp.el.svn-work
  262. +5 −0 emacs/.svn/props/rdebug-secondary.el.svn-work
  263. +5 −0 emacs/.svn/props/rdebug-shortkey.el.svn-work
  264. +5 −0 emacs/.svn/props/rdebug-source.el.svn-work
  265. +5 −0 emacs/.svn/props/rdebug-track.el.svn-work
  266. +5 −0 emacs/.svn/props/rdebug-varbuf.el.svn-work
  267. +5 −0 emacs/.svn/props/rdebug-vars.el.svn-work
  268. +5 −0 emacs/.svn/props/rdebug-watch.el.svn-work
  269. +1 −0 emacs/.svn/props/rdebug.el.svn-work
  270. +130 −0 emacs/.svn/text-base/Makefile.am.svn-base
  271. +385 −0 emacs/.svn/text-base/rdebug-annotate.el.svn-base
  272. +407 −0 emacs/.svn/text-base/rdebug-breaks.el.svn-base
  273. +92 −0 emacs/.svn/text-base/rdebug-cmd.el.svn-base
  274. +502 −0 emacs/.svn/text-base/rdebug-core.el.svn-base
  275. +62 −0 emacs/.svn/text-base/rdebug-dbg.el.svn-base
  276. +79 −0 emacs/.svn/text-base/rdebug-error.el.svn-base
  277. +111 −0 emacs/.svn/text-base/rdebug-fns.el.svn-base
  278. +230 −0 emacs/.svn/text-base/rdebug-frames.el.svn-base
  279. +242 −0 emacs/.svn/text-base/rdebug-gud.el.svn-base
  280. +104 −0 emacs/.svn/text-base/rdebug-help.el.svn-base
  281. +83 −0 emacs/.svn/text-base/rdebug-info.el.svn-base
  282. +180 −0 emacs/.svn/text-base/rdebug-layouts.el.svn-base
  283. +118 −0 emacs/.svn/text-base/rdebug-locring.el.svn-base
  284. +106 −0 emacs/.svn/text-base/rdebug-output.el.svn-base
  285. +118 −0 emacs/.svn/text-base/rdebug-regexp.el.svn-base
  286. +260 −0 emacs/.svn/text-base/rdebug-secondary.el.svn-base
  287. +175 −0 emacs/.svn/text-base/rdebug-shortkey.el.svn-base
  288. +568 −0 emacs/.svn/text-base/rdebug-source.el.svn-base
  289. +392 −0 emacs/.svn/text-base/rdebug-track.el.svn-base
  290. +150 −0 emacs/.svn/text-base/rdebug-varbuf.el.svn-base
  291. +125 −0 emacs/.svn/text-base/rdebug-vars.el.svn-base
Sorry, we could not display the entire diff because too many files (970) changed.
View
7 AUTHORS
@@ -0,0 +1,7 @@
+Author and maintainer:
+Kent Sibilev
+
+Contributers:
+Markus Barchfeld
+R. Bernstein
+Anders Lindgren
View
334 CHANGES
@@ -0,0 +1,334 @@
+0.10.3
+11/17/08
+
+ - a backtrace now warns when it thinks the callstack is truncated which it
+ gets by comparing with caller()
+ - fix setting $0.
+ - fix bug in showing variables in post-mortem
+ - Document how Debugger.start with a block is intended to be used.
+ - Move Kernel#debugger from ruby-debug-base into ruby-debug
+ - Get regression tests working again
+ - Warn and add a "confirmation" when setting a breakpoint on a
+ file that is not loaded.
+
+0.10.2
+ - debugger(steps=0) breaks inside of debugger rather than wait for a line event.
+ - trace var varname (stop|nostop) added which issues trace_var.
+ - start method is now properly defined in Debugger module
+ - fixed 'finish' command
+ - rdebug script now works with Ruby 1.8.7
+
+0.10.1
+4/10/08 - in honor of the 30th Birthday of Kate Schwarz
+
+- bin/rdebug
+
+ * "rdebug --post-mortem" now really catches uncaught exceptions and
+ brings you to post-mortem handling. "info program" shows the exception.
+
+ * rdebug now searches using ENV['PATH'] for a Ruby program to debug
+ if the program name is not found and doesn't have any path
+ characters in it.
+
+ * Use ~/.rdboptrc (rdbopt.ini on MS Windows) to change default options.
+
+ * --emacs is now --emacs-basic while --emacs 3 now implies emacs-basic
+ ---annotate=3 --post-mortem --no-control --no-start --no-quit
+
+- rdebug (CLI)
+
+ * "info" command additions and changes:
+ o fix bug in "info variables" when string had embedded %s'
+ o "info program" now shows uncaught exception information
+ o "info files" show what Ruby files are loaded
+ o "info file <f>" specific file information of <f> (e.g. time, # of lines, SHA1)
+ o "info catch" - Exceptions that can be caught in the current stack frame.
+ o "info "variables" shows "self" and class variables
+ o "info threads verbose" shows stack trace of all threads
+ o "info thread <t> verbose" shows stack trace of thread <t>.
+
+ * "frame" command now accepts an optional thread number argument
+
+ * Long information added to commands with subcommands: show, set,
+ info, enable, and disable. For example "help info <xxx>" will give
+ more detailed information about the "info <xxx>" command.
+
+ * columnize now pulled in from a separate package.
+
+ * add "var cl[ass]" command. Note "var const" can no longer be
+ abbreviated "var c"; use "var co" (or const or constant).
+
+ * add "condition" command. Allow removal of condition.
+
+ * $0 == __FILE__ when running rdebug should work -- most of the
+ time. See comments in code for a better solution.
+
+ * rdebug command history can be displayed with "show commands". Fix a bug
+ in history saving.
+
+ * INCOMPATIBLE CHANGE: "finish" works like gdb - stop just before the most
+ recent method finishes. Will now accept a number which stops that many
+ frames completed. (Note that return line numbers will be funny, the
+ first line of the method until Ruby 1.8.7.)
+
+ * fix bug in 'list' command when wrapping off the end.
+
+- Emacs interaction drastically reworked, expanded, and improved.
+
+- rdebug base
+ * allow catching multiple exceptions.
+ INCOMPATIBLE CHANGE: variable "Debugger.catchpoint", a String, was turned
+ into "Debugger.catchpoints", a Hash. Method "Debugger.catchpoint=" no
+ longer exists. Debugger.set_catchpoint was turned into
+ Debugger.add_catchpoint
+
+ * Add Debugger.last_exception which is set in post-mortem.
+
+ * remove Debugger.stop() when an exception is raised that would terminate the
+ debugged program. This may allow catchpoints to work and allow tracing user
+ code which handles "Exit" exceptions
+
+ * split off breakpoint code in ruby_debug.c.
+
+ * preface ruby_debug global Ruby variables with rdebug_.
+
+ * Change Debugger.start() to accept an optional options argument
+ :init => true saves things (like $0 and ARGV) necessary to
+ allow restart. Default: true
+ :post_mortem => true runs post-mortem on an uncaught exception
+ Default: false
+
+ The old Debugger.start() is now renamed to Debugger.start_()
+
+ * split of line caching to an external gem. We now only allow setting
+ breakpoints on lines where it makes sense to do so.
+
+ * Incompatible enhancement: even return/end will now call event handler
+
+ See ChangeLog for full details, and the reference guide for more complete
+ documentation of these changes.
+
+0.10.0
+12/25/07
+
+- '-r' option can be used to require additional libraries.
+- --noquit option added to stay in debugger when the program exits
+- gdb-like --annotate option added. Can be used by front-ends to get information
+ without polling
+- Fixed 'var const' command. Issue #10847.
+- Using pretty-print for all var commands.
+- Better error reporting for commands that require a numeric argument.
+- Fixed Kernel#binding_n method
+- Add option -d ($DEBUG = true) and --verbose. Make -v work like ruby.
+- Remove debugger messages caused when warnings are turned on.
+- "info" and "show" commands added. "set" made more like gdb's
+ set. subcommands can be abbreviated and are case insensitive.
+- restart program if it terminates normally and we've got a tty and
+ we stop on the first statement.
+- help is in tidy column format. method lists are shown that way as well.
+ the "width" setting ("set/show width") is used for the line width
+- stack traces now show parameter names and types. "info args" lists just
+ the parameters (with the most recent values, not the values at call time).
+- post-mortem "exit" bug fixed.
+- More Emacs-friendly: rdebug-track.el will track location inside an Emacs
+ shell. Emacs position information is shown in breakpoints and catchpoints
+ similar to gdba. Commands to position in another window a unit test traceback
+ or ruby traceback. Much more work invisioned for Emacs.
+- INCOMPATIBLE CHANGE: "break" now sets a breakpoint on the current line
+ (same as gdb). Use "info break" for a list of breakpoints.
+- INCOMPATIBLE CHANGE: "script" command removed. Use "source" command instead
+ (same as gdb).
+- Run .rdebugrc on Debugger.start. Look for a file in the current directory and
+ run that instead of the one in $HOME if that exists. Again, inspired by and compatible
+ with gdb.
+- Changes compatible with Ruby 1.9. NOTE: this debugger will NOT work with
+ Ruby 1.9
+- leaving irb shows position same as entering debugger; "list" position
+ is also cleared when leaving irb
+- help "foo" gives message "Undefined command "foo" rather than a list
+ of help commands. (Message test is gdb's)
+- Add set linetrace+ - similar to step+ for linetrace
+- Start unit tests.
+- Start a reference guide.
+
+0.9.3
+- Fixed if..elsif..end stepping.
+- From irb session Ctrl-C or 'cont' command continues execution without showing the debugger prompt.
+- Added Debugger.settings method to programatically modify command settings.
+- Added Kernel#breakpoint as alias to Kernel#debugger is the former is not already defined.
+
+0.9.2
+- Fixed file comparison in Windows platform.
+- Added setter methods to Breakpoint properties
+- Added breakpoint hit condition functionality (not available via CLI yet) and methods:
+ Breakpoint:hit_count
+ Breakpoint:hit_value[=]
+ Breakpoint:hit_condition[=]
+
+0.9.1
+- Fixed incorrect stack calculation.
+- Context#stop_next= method aliased as Context#step.
+- Added the 'force' parameter to Context#step_over.
+- Added the 'force' parameter to Context#step.
+- 'next+/step+' commands forces to move to another line
+- Added a new 'forcestep' setting.
+
+0.9
+- Kernel#debugger method will start the debugger if it's not running.
+- Added Context#stop_reason method.
+- 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.
+- Added the possibility to add a temporary context-specific breakpoint. Context#breakpoint and Context#set_breakpoint methods are added.
+- 'cont' command now accepts a numerical parameter which implements 'Continue until line' behavior.
+- Added new Context.frame_class method
+- Added new 'framefullpath' setting.
+- Added new 'frameclassname' setting.
+- All Ruby's 'eval' and require/load methods create a new frame. Fixes bug #9686.
+
+0.8.1
+- Added a shortcut module 'debugger'. require "ruby-debug/debugger" will start the debugger and stop at the next line (similar to require 'debug').
+- Fixed remote debugging.
+
+0.8
+- Extract the base debugger API into a separate gem (ruby-debug-base), so it will be easier to add a new interface.
+- Added 'set autoirb' setting.
+- Bugfixes.
+
+0.7.5
+- Fixed 'reload on' command
+- 'reload on' command is removed in favor of 'set autoreload'
+- rdebug will evaluate ~/.rdebugrc script on startup
+
+0.7.4
+- Added a workaround of the Ruby interpreter problem where a method created with Module#define_method
+ and which raises an exception doesn't trigger a :return event, this way screwing the stack trace.
+- Fixed a situation of an array 'out of bounds' access.
+- Fixed the help for 'where' command.
+
+0.7.3
+- Fixed a case when a frame is not popped up properly.
+- Removed Context.ignore= method, since it can result with the segmentation fault error.
+- Fixed the case when Context#suspend may effect the state of the thread on Context#resume
+- Fixed several cases of seg faults when accessing dyna_vars structure.
+
+0.7.2
+- Fixed Context#resume (a thread should be waked up only when it was running when it was suspended).
+- When handling post-mortem exception, all threads must be suspended.
+
+0.7.1
+- Fixed 'delete' command
+
+0.7
+- Eliminated explicit Frame object. Use Context.frame_[binding,file,line] instead.
+- Fixed help command.
+- Renamed Debugger.keep_frame_info to Debugger.keep_frame_binding
+- 'eval' command is available, even when keep_frame_binding is not used.
+- New 'set' command is available.
+
+0.6.2
+- Added thread lookup cache.
+- Control thread is always started by rdebug script.
+- Ability to specify negative frame number to frame commands. Patch from R. Bernstein.
+
+0.6.1
+- Another performance optimization.
+
+0.6
+- Added option to exclude collecting of frame bindings.
+- Several performance optimizations.
+
+0.5.4
+- Added -x/--trace option to rdebug script. Patch from R. Bernstein.
+- Removed a live thread reference from the context's structure avoiding memory leakage.
+
+0.5.3
+- Added Module#post_mortem_method method, which wraps any method with Debugger.post_mortem block.
+- Added breakpoint id, which is not dependent on the breakpoint position in Debugger.breakpoints array.
+
+0.5.2
+- Fixes interoperability problems with rspec.
+- Made 'exit' as an alias to 'quit'
+- Added 'restart' command. Patch from R. Bernstein.
+
+0.5.1
+- Bugfixes.
+
+0.5
+- Added post-mortem debugging
+- Added 'irb' command.
+
+0.4.5
+- Fixed debug_method when applied to setter.
+- Added 'reload' command which can be used to reload source code in case it's been changed.
+- Added Debugger.reload_source_on_change option (true, by default) which controls whether ruby-debug should keep
+ track of the source files modification times and reload them if they've been changed.
+
+0.4.4
+- Renamed Context#set_suspend and Context#clear_suspend methods to Context#suspend and Context#resume respectively.
+- Context#resume method not only clears suspend flag, but also resumes the thread execution.
+- Bugfixes.
+
+0.4.3
+- Added Debugger.skip method which allows escaping a block from the debugger reach.
+- Bugfixes.
+
+0.4.2
+- Module#deubg_method added.
+- Added rdoc.
+- Bugfixes.
+
+0.4.1
+- New binding_n method for Kernel module.
+- Bugfixes.
+
+0.4
+- Debugger.start method takes a block. If a block is specified, this method starts debugger, yields to the block
+ and stops debugger at the end.
+- 'tm[ate]' command accepts a frame number now.
+- 'list' command accepts on/off parameter which controls whether listing will be displayed on every stop.
+- 'eval on/off' controls the evaluation of unknown command.
+- Debugger reads readline history file .rdebug_hist at startup and saves it at exit.
+- 'sa[ve] <file>' command can be used to save current breackpoints and catchpoint if any
+- 'sc[ript] <file>' command can be used to run script file. Script files can contain only control commands.
+- rdebug script accepts '--script FILE' parameter.
+- thread commands are available for the control port.
+
+0.3 (2006-08-07)
+- Renamed Debugger.start_server to Debugger.start_remote.
+- Debugger.start_remote activates debugger by calling Debugger.start.
+- Debugger.start_remote starts a control thread which listen on port 8990 and accepts control
+ commands, such as adding/deleting breakpoints, assigning catchpoint, etc. (Useful for GUI integration)
+- New Debugger.wait_connection option. When it's true, Debugger.start_remote waits until
+ a remote connection is made.
+- New Debugger.stop_on_connect option. When a remote connection is established, debugger
+ stops the main thread (Thread.main).
+- 'interrupt' command is available for the control thread.
+
+0.2.1 (2006-07-29)
+- 'f[rame] nn' command selects a numbered frame. Frame numbers can be obtained by running frame
+ command without parameters.
+- 'l[ist] =' show code in the context of the current line.
+- 'tm[ate]' opens the current file in TextMate. Available only on Mac OSX.
+
+0.2 (2006-07-17)
+- Added the remote debugging. It should be activated by calling Debugger#start_server method.
+- CHANGED: In order to activate the debugger, it's not enough to require 'ruby-debug'.
+ Debugger#start method must be called explicitly.
+- Debugger used to evaluate anything you enter as long as it's not a command. Starting from
+ this version the 'eval' command must be used to evaluate an expression.
+
+0.1.5 (2006-07-13)
+- Now the check for a breakpoint uses base filename of the source file.
+- Removed compilation warnings when compiling with -Wall
+
+0.1.4 (2006-07-12)
+- Remembers the previous command. Invoke it by typing a carriage return
+ at the command prompt.
+
+0.1.3 (2006-07-11)
+- Conditional breakpoints
+- Bugfixes
+
+0.1.2 (2006-07-16)
+========================
+
+- Initial release.
View
5,655 ChangeLog
5,655 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
154 INSTALL.SVN
@@ -0,0 +1,154 @@
+Building and Installing ruby-debug from rubyforge's Subversion Repository (svn)
+
+The below are Unix-centric instructions. If you have Microsoft Windows see
+the section on building Microsoft Windows.
+
+
+0. Prerequisites: To build the package you'll need at a minimum:
+
+ - Ruby (of course). Currently only version 1.8.6 and above but not
+ version 1.9.x work.
+ - Ruby development headers. This typically includes a file called "ruby.h"
+ - A C compiler like GNU C (gcc)
+ - Rake
+ - Subversion (svn)
+
+If you want to build the documentation and install Emacs files, you'll
+also need:
+
+ - a POSIX shell
+ - autoconf
+ - automake
+ - GNU Make
+ - texinfo
+
+1. Basic package checkout and installation
+
+Check out the trunk of repository following the instructions at
+http://rubyforge.org/scm/?group_id=1900 For example on a Unixy system,
+this may work:
+
+ mkdir ruby-debug
+ cd ruby-debug
+ svn checkout svn://rubyforge.org/var/svn/ruby-debug/trunk trunk
+
+In order to make the Ruby gems, ruby-debug and ruby-debug-base, get
+yourself into the trunk directory after the code has been checked out and run:
+
+ cd trunk # This is the same trunk checked out above.
+ rake package
+
+If all goes well you should have some gem files put in the directory
+pkg. Use the gem command to install that.
+
+ sudo gem install ruby-debug-*.gem # See gem help for other possibilities
+
+If all goes well the rdebug script has been installed ruby-debug is
+now ready to run. But if everything goes well you might want to run
+the built-in regression tests to make sure everything is okay.
+See step 3 below.
+
+If the gem install didn't work,'t there may be a problem with your C
+compiler or the Ruby headers are not installed.
+
+2. Trying out without installing.
+
+You don't have to build a gem file to try out ruby debug. In fact when
+developing new features for ruby-debug, developers often you want to
+try it out *before* installing. If you have a problem in the latter
+part of step 1 you may want to try this approach since we go into a
+little more detail as to what happens under the covers when you do the
+gem install.
+
+Run (from trunk)
+ rake lib
+
+This creates a Makefile and builds the ruby-debug shared library. (On
+Unix the name is ruby_debug.so).
+
+Once this is done you can run the debugger as you would rdebug using the
+script rdbg.rb. For example (again from trunk)
+
+ ./rdbg.rb ~/my-ruby-program.rb
+
+3. Running the Regression tests
+
+We've put together some basic tests to make sure ruby-debug is doing
+what we think it should do. To run these (from trunk):
+
+ rake test
+
+If you didn't build the ruby-debug shared library and skipped step 2,
+don't worry "rake test" will do step 2 for you. You should see a line that
+ends something like:
+
+ Finished in 2.767579 seconds.
+
+ 12 tests, 35 assertions, 0 failures, 0 errors
+
+The number of seconds, tests, and assertions may be different from the
+above. However you *should* see exactly "0 failures, 0 errors".
+
+4. Building the documentation and testing/installing Emacs files
+
+Of course, I recommend you read the ruby-debug manual that comes with
+the package. If you have the prerequisites described above, run this
+once:
+ sh ./autogen.sh
+
+Then run:
+ ./configure
+ make
+ make test # Runs Emacs regression tests
+ sudo make install # Or arrange to do this as root
+
+
+Microsoft Windows
+
+A problem here seems to be that the "One-click" install is compiled
+using Microsoft Visual Studio C 6 which is not sold anymore and is
+rather old.
+
+Instead I suggest building via mingw/msys.
+http://eigenclass.org/hiki.rb?cmd=view&p=cross+compiling+rcovrt&key=mingw has instructions on how to do. Some amendments to these instructions.
+
+First, those instructions are a little GNU/Linux centric. If you are
+using Ubuntu or Debian, then this should be the easiest to follow the
+instructions. On Ubuntu or Debian there is a mingw3 Debian
+package. Installing that will give you the cross compiler that is a
+prerequisite. Alternatively if you are running MS Windows I notice
+that cygwin also has a mingw package. Or possibly you could use MinGW
+directly. For other OS's you might have to build a cross-compiler,
+i.e. gcc which emits win32 code and can create a win32 DLL.
+
+After you have a cross compiler you need to download the Ruby source
+and basically build a ruby interpreter. The cross-compile.sh script
+works although when I downloaded it, it had lots of blank space at the
+beginning which will mess up the Unix magic interpretation. That is
+remove the blanks in front of "#/bin/sh"
+
+On my system, this script fails in running "make ruby" because the
+fake.rb that got created needed to have a small change:
+
+ ALT_SEPARATOR = "\"; \
+should be
+ ALT_SEPARATOR = "\\"; \
+
+After fixing this, run
+ make ruby
+Also, I needed to run
+ make rubyw
+
+And then "make install" as indicated.
+
+Once all of that's in place, the place you want be is in
+ruby-debug/trunk/ext/win32, not ruby-debug/ext.
+
+So let's say you've installed the cross-compiled install ruby in
+/usr/local/ruby-mingw32/. Here then are the commands to build ruby-debug-base-xxx-mswin32.gem
+
+ cd .../ruby-debug/trunk/ext/win32
+ ruby -I /usr/local/ruby-mingw32/lib/ruby/1.8/i386-mingw32 ../extconf.rb
+ make # Not rake
+ cd ../.. # back in ruby-debug/trunk
+ rake win32_gem
View
23 LICENSE
@@ -0,0 +1,23 @@
+Copyright (C) 2005 Kent Sibilev <ksibilev@yahoo.com>
+All rights reserved.
+ *
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ *
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
View
14 Makefile.am
@@ -0,0 +1,14 @@
+SUBDIRS = doc emacs
+PHONY = test ChangeLogs
+test: check
+ChangeLogs: ChangeLog doc/ChangeLog emacs/ChangeLog lib/ChangeLog
+ChangeLog:
+ svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk \
+ cli test bin AUTHORS CHANGES LICENSE README runner.sh -o ChangeLog
+lib/ChangeLog:
+ svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk \
+ lib ext -o lib/ChangeLog
+doc/ChangeLog:
+ svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk/doc -o doc/ChangeLog
+emacs/ChangeLog:
+ svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk/emacs -o emacs/ChangeLog
View
255 Rakefile
@@ -0,0 +1,255 @@
+#!/usr/bin/env rake
+# -*- Ruby -*-
+require 'rubygems'
+require 'rake/gempackagetask'
+require 'rake/rdoctask'
+require 'rake/testtask'
+
+SO_NAME = "ruby_debug.so"
+
+# ------- Default Package ----------
+RUBY_DEBUG_VERSION = open("ext/ruby_debug.c") do |f|
+ f.grep(/^#define DEBUG_VERSION/).first[/"(.+)"/,1]
+end
+
+COMMON_FILES = FileList[
+ 'AUTHORS',
+ 'CHANGES',
+ 'LICENSE',
+ 'README',
+ 'Rakefile',
+]
+
+CLI_TEST_FILE_LIST = FileList['test/cli/commands/unit/*.rb',
+ 'test/cli/commands/*_test.rb',
+ 'test/cli/**/*_test.rb',
+ 'test/test-*.rb']
+CLI_FILES = COMMON_FILES + FileList[
+ "cli/**/*",
+ 'ChangeLog',
+ 'bin/*',
+ 'doc/rdebug.1',
+ 'test/**/data/*.cmd',
+ 'test/**/data/*.right',
+ 'test/**/*.rb',
+ 'rdbg.rb',
+ CLI_TEST_FILE_LIST
+]
+
+BASE_TEST_FILE_LIST = %w(
+ test/base/base.rb
+ test/base/binding.rb
+ test/base/catchpoint.rb)
+BASE_FILES = COMMON_FILES + FileList[
+ 'ext/breakpoint.c',
+ 'ext/extconf.rb',
+ 'ext/ruby_debug.c',
+ 'ext/ruby_debug.h',
+ 'ext/win32/*',
+ 'lib/**/*',
+ BASE_TEST_FILE_LIST,
+]
+
+desc "Test everything."
+task :test => :test_base do
+ Rake::TestTask.new(:test) do |t|
+ t.libs << ['./ext', './lib', './cli']
+ t.test_files = CLI_TEST_FILE_LIST
+ t.verbose = true
+ end
+end
+
+desc "Test ruby-debug-base."
+task :test_base => :lib do
+ Rake::TestTask.new(:test_base) do |t|
+ t.libs << ['./ext', './lib']
+ t.test_files = FileList[BASE_TEST_FILE_LIST]
+ t.verbose = true
+ end
+end
+
+desc "Test everything - same as test."
+task :check => :test
+
+desc "Create the core ruby-debug shared library extension"
+task :lib do
+ Dir.chdir("ext") do
+ system("#{Gem.ruby} extconf.rb && make")
+ end
+end
+
+desc "Compile Emacs code"
+task :emacs => "emacs/rdebug.elc"
+file "emacs/rdebug.elc" => ["emacs/elisp-comp", "emacs/rdebug.el"] do
+ Dir.chdir("emacs") do
+ system("./elisp-comp ./rdebug.el")
+ end
+end
+
+desc "Create a GNU-style ChangeLog via svn2cl"
+task :ChangeLog do
+ system("svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk")
+ system("svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk/ext -o ext/ChangeLog")
+ system("svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk/lib -o lib/ChangeLog")
+end
+
+# Base GEM Specification
+base_spec = Gem::Specification.new do |spec|
+ spec.name = "ruby-debug-base"
+
+ spec.homepage = "http://rubyforge.org/projects/ruby-debug/"
+ spec.summary = "Fast Ruby debugger - core component"
+ spec.description = <<-EOF
+ruby-debug is a fast implementation of the standard Ruby debugger debug.rb.
+It is implemented by utilizing a new Ruby C API hook. The core component
+provides support that front-ends can build on. It provides breakpoint
+handling, bindings for stack frames among other things.
+EOF
+
+ spec.version = RUBY_DEBUG_VERSION
+
+ spec.author = "Kent Sibilev"
+ spec.email = "ksibilev@yahoo.com"
+ spec.platform = Gem::Platform::RUBY
+ spec.require_path = "lib"
+ spec.extensions = ["ext/extconf.rb"]
+ spec.files = BASE_FILES.to_a
+
+ spec.required_ruby_version = '>= 1.8.2'
+ spec.date = Time.now
+ spec.rubyforge_project = 'ruby-debug'
+ spec.add_dependency('linecache', '>= 0.3')
+
+ spec.test_files = FileList[BASE_TEST_FILE_LIST]
+
+ # rdoc
+ spec.has_rdoc = true
+ spec.extra_rdoc_files = ['README', 'ext/ruby_debug.c']
+end
+
+cli_spec = Gem::Specification.new do |spec|
+ spec.name = "ruby-debug"
+
+ spec.homepage = "http://rubyforge.org/projects/ruby-debug/"
+ spec.summary = "Command line interface (CLI) for ruby-debug-base"
+ spec.description = <<-EOF
+A generic command line interface for ruby-debug.
+EOF
+
+ spec.version = RUBY_DEBUG_VERSION
+
+ spec.author = "Kent Sibilev"
+ spec.email = "ksibilev@yahoo.com"
+ spec.platform = Gem::Platform::RUBY
+ spec.require_path = "cli"
+ spec.bindir = "bin"
+ spec.executables = ["rdebug"]
+ spec.files = CLI_FILES.to_a
+
+ spec.required_ruby_version = '>= 1.8.2'
+ spec.date = Time.now
+ spec.rubyforge_project = 'ruby-debug'
+ spec.add_dependency('columnize', '>= 0.1')
+ spec.add_dependency('ruby-debug-base', "~> #{RUBY_DEBUG_VERSION}.0")
+
+ # FIXME: work out operational logistics for this
+ # spec.test_files = FileList[CLI_TEST_FILE_LIST]
+
+ # rdoc
+ spec.has_rdoc = true
+ spec.extra_rdoc_files = ['README']
+end
+
+# Rake task to build the default package
+Rake::GemPackageTask.new(base_spec) do |pkg|
+ pkg.need_tar = true
+end
+Rake::GemPackageTask.new(cli_spec) do |pkg|
+ pkg.need_tar = true
+end
+
+task :default => [:package]
+
+# Windows specification
+win_spec = base_spec.clone
+win_spec.extensions = []
+## win_spec.platform = Gem::Platform::WIN32 # deprecated
+win_spec.platform = 'mswin32'
+win_spec.files += ["lib/#{SO_NAME}"]
+
+desc "Create Windows Gem"
+task :win32_gem do
+ # Copy the win32 extension the top level directory
+ current_dir = File.expand_path(File.dirname(__FILE__))
+ source = File.join(current_dir, "ext", "win32", SO_NAME)
+ target = File.join(current_dir, "lib", SO_NAME)
+ cp(source, target)
+
+ # Create the gem, then move it to pkg.
+ Gem::Builder.new(win_spec).build
+ gem_file = "#{win_spec.name}-#{win_spec.version}-#{win_spec.platform}.gem"
+ mv(gem_file, "pkg/#{gem_file}")
+
+ # Remove win extension from top level directory.
+ rm(target)
+end
+
+desc "Publish ruby-debug to RubyForge."
+task :publish do
+ require 'rake/contrib/sshpublisher'
+
+ # Get ruby-debug path.
+ ruby_debug_path = File.expand_path(File.dirname(__FILE__))
+
+ Rake::SshDirPublisher.new("kent@rubyforge.org",
+ "/var/www/gforge-projects/ruby-debug", ruby_debug_path)
+end
+
+desc "Remove built files"
+task :clean do
+ cd "ext" do
+ if File.exists?("Makefile")
+ sh "make clean"
+ rm "Makefile"
+ end
+ derived_files = Dir.glob(".o") + Dir.glob("*.so")
+ rm derived_files unless derived_files.empty?
+ end
+end
+
+# --------- RDoc Documentation ------
+desc "Generate rdoc documentation"
+Rake::RDocTask.new("rdoc") do |rdoc|
+ rdoc.rdoc_dir = 'doc/rdoc'
+ rdoc.title = "ruby-debug"
+ # Show source inline with line numbers
+ rdoc.options << "--inline-source" << "--line-numbers"
+ # Make the readme file the start page for the generated html
+ rdoc.options << '--main' << 'README'
+ rdoc.rdoc_files.include('bin/**/*',
+ 'cli/ruby-debug/commands/*.rb',
+ 'lib/**/*.rb',
+ 'ext/**/ruby_debug.c',
+ 'README',
+ 'LICENSE')
+end
+
+desc "Publish the release files to RubyForge."
+task :rubyforge_upload do
+ `rubyforge login`
+ release_command = "rubyforge add_release #{PKG_NAME} #{PKG_NAME} '#{PKG_NAME}-#{PKG_VERSION}' pkg/#{PKG_NAME}-#{PKG_VERSION}.gem"
+ puts release_command
+ system(release_command)
+end
+
+PKG_NAME = 'ruby-debug'
+desc "Publish the release files to RubyForge."
+task :rubyforge_upload do
+ `rubyforge login`
+ for pkg_name in ['ruby-debug', 'ruby-debug-base'] do
+ pkg_file_name = "#{pkg_name}-#{pkg_version}"
+ release_command = "rubyforge add_release ruby-debug #{pkg_name} '#{pkg_file_name}' pkg/#{pkg_file_name}.gem"
+ puts release_command
+ system(release_command)
+ end
+end
View
4 autogen.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Things to do after doing a clean SVN update to add the proper files.
+ln -vfs CHANGES NEWS
+autoreconf -i -s
View
2 bin/.svn/README.txt
@@ -0,0 +1,2 @@
+This is a Subversion working copy administrative directory.
+Visit http://subversion.tigris.org/ for more information.
View
0 bin/.svn/empty-file
No changes.
View
22 bin/.svn/entries
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wc-entries
+ xmlns="svn:">
+<entry
+ committed-rev="921"
+ name=""
+ committed-date="2009-04-11T16:34:47.393159Z"
+ url="svn://rubyforge.org/var/svn/ruby-debug/trunk/bin"
+ last-author="rockyb"
+ kind="dir"
+ uuid="453b2852-3d18-0410-866e-d09c099698e4"
+ revision="922"/>
+<entry
+ committed-rev="921"
+ name="rdebug"
+ text-time="2009-07-22T04:17:38.000000Z"
+ committed-date="2009-04-11T16:34:47.393159Z"
+ checksum="f3cf411948f1aceec91895d0db210e33"
+ last-author="rockyb"
+ kind="file"
+ prop-time="2009-07-22T04:17:38.000000Z"/>
+</wc-entries>
View
1 bin/.svn/format
@@ -0,0 +1 @@
+4
View
5 bin/.svn/prop-base/rdebug.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 0
+
+END
View
5 bin/.svn/props/rdebug.svn-work
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 0
+
+END
View
415 bin/.svn/text-base/rdebug.svn-base
@@ -0,0 +1,415 @@
+#!/usr/bin/env ruby
+
+#=== Summary
+#
+#A command-line front-end to the Ruby debugger, <tt>ruby-debug</tt>, the
+#Fast Ruby Debugger.
+#
+#Command invocation:
+#
+# rdebug [options] [--] [script-options] ruby-script-to-debug
+# rdebug [options] [script-options] [--client]
+# rdebug [--version | --help]
+#
+#=== Options
+#
+#<tt>-A | --annotate</tt> <i>level</i>::
+# Set gdb-style annotation to <i>level</i>, a number. Additional
+# information is output automatically when program state is
+# changed. This can be used by front-ends such as GNU Emacs to post
+# this updated information without having to poll for it.
+#
+#<tt>--client</tt>::
+# Connect to a remote debugger. Used with another rdebug invocation
+# using <tt>--server</tt>. See also <tt>--host</tt> and
+# <tt>--cport</tt> options
+#
+#<tt>--cport=</tt><i>port</i>::
+# Use port <i>port</i> for access to debugger control.
+#
+#<tt>-d | --debug</tt>::
+# Set $DEBUG true.
+#
+#<tt>--emacs</tt>::
+# Activates full GNU Emacs mode. Is the equivalent of setting the
+# options <tt>--emacs-basic --annotate=3 --no-stop --no-control
+# --post-mortem</tt>.
+#
+#<tt>--emacs-basic</tt>::
+# Activates GNU Emacs mode. Debugger prompts are prefaced with two
+# octal 032 characters.
+#
+#<tt>-h | --host=</tt><i>host</i>::
+# Use host name <i>host</i> for remote debugging.
+#
+#<tt>-I | --include</tt> <i>path</i>
+# Add <i>path</i> to <tt>$LOAD_PATH</tt>
+#
+#<tt>-m | --post-mortem</tt>::
+# Activate post-mortem mode.
+#
+#<tt>--no-control</tt>::
+# Do not automatically start control thread.
+#
+#<tt>--no-stop</tt>::
+# Do not stop when script is loaded.
+#
+#<tt>-p | --port=PORT</tt>::
+# Host name used for remote debugging.
+#
+#<tt>-r | --require</tt><i>script</i>::
+# Require the library, before executing your script.
+#
+#<tt>--script</tt> <i>file</i>::
+# Run debugger script file <i>file</i>
+#
+#<tt>-x | --trace</tt>::
+# Show lines before executing them.
+#
+#<tt>--no-quit</tt>::
+# Do not quit when script terminates. Instead rerun the
+# program.
+#
+#<tt>--version</tt>::
+# Show the version number and exit.
+#
+#<tt>--verbose</tt>::
+# Turn on verbose mode.
+#
+#<tt>--v</tt>::
+# Print the version number, then turn on verbose mode if
+# a script name is given. If no script name is given
+# just exit after printing the version number.
+#
+#<tt>--nx</tt>::
+# Don’t execute commands found in any initialization
+# files, e.g. <tt>.rdebugrc</tt>.
+#
+#<tt>--keep-frame-binding</tt>::
+# Keep frame bindings.
+#
+#<tt>--script=</tt><i>file</i>::
+# Name of the script file to run
+#
+#<tt>-s | --server</tt>::
+# Listen for remote connections. Another rdebug session
+# accesses using the <tt>--client</tt> option. See also the
+# <tt>--host</tt>, <tt>--port</tt> and <tt>--cport</tt> options
+#
+#<tt>-w | --wait</tt>::
+# Wait for a client connection; implies <tt>-s</tt> option.
+#
+#<tt>--help</tt>::
+# Show invocation help and exit.
+
+require 'rubygems'
+require 'optparse'
+require 'ostruct'
+require 'ruby-debug'
+
+def debug_program(options)
+ # Make sure Ruby script syntax checks okay.
+ # Otherwise we get a load message that looks like rdebug has
+ # a problem.
+ output = `ruby -c "#{Debugger::PROG_SCRIPT}" 2>&1`
+ if $?.exitstatus != 0 and RUBY_PLATFORM !~ /mswin/
+ puts output
+ exit $?.exitstatus
+ end
+ print "\032\032starting\n" if Debugger.annotate and Debugger.annotate > 2
+
+ # Record where we are we can know if the call stack has been
+ # truncated or not.
+ Debugger.start_sentinal=caller(0)[1]
+
+ bt = Debugger.debug_load(Debugger::PROG_SCRIPT, options.stop, false)
+ if bt
+ if options.post_mortem
+ Debugger.handle_post_mortem(bt)
+ else
+ print bt.backtrace.map{|l| "\t#{l}"}.join("\n"), "\n"
+ print "Uncaught exception: #{bt}\n"
+ end
+ end
+end
+
+# Do a shell-like path lookup for prog_script and return the results.
+# If we can't find anything return prog_script.
+def whence_file(prog_script)
+ if prog_script.index(File::SEPARATOR)
+ # Don't search since this name has path separator components
+ return prog_script
+ end
+ for dirname in ENV['PATH'].split(File::PATH_SEPARATOR) do
+ prog_script_try = File.join(dirname, prog_script)
+ return prog_script_try if File.exist?(prog_script_try)
+ end
+ # Failure
+ return prog_script
+end
+
+options = OpenStruct.new(
+ 'annotate' => Debugger.annotate,
+ 'client' => false,
+ 'control' => true,
+ 'cport' => Debugger::PORT + 1,
+ 'frame_bind' => false,
+ 'host' => nil,
+ 'quit' => true,
+ 'no_rewrite_program' => false,
+ 'stop' => true,
+ 'nx' => false,
+ 'port' => Debugger::PORT,
+ 'post_mortem' => false,
+ 'restart_script' => nil,
+ 'script' => nil,
+ 'server' => false,
+ 'tracing' => false,
+ 'verbose_long' => false,
+ 'wait' => false
+)
+
+def process_options(options)
+ program = File.basename($0)
+ opts = OptionParser.new do |opts|
+ opts.banner = <<EOB
+#{program} #{Debugger::VERSION}
+Usage: #{program} [options] <script.rb> -- <script.rb parameters>
+EOB
+ opts.separator ""
+ opts.separator "Options:"
+ opts.on("-A", "--annotate LEVEL", Integer, "Set annotation level") do
+ |annotate|
+ Debugger.annotate = annotate
+ end
+ opts.on("-c", "--client", "Connect to remote debugger") do
+ options.client = true
+ end
+ opts.on("--cport PORT", Integer, "Port used for control commands") do
+ |cport|
+ options.cport = cport
+ end
+ opts.on("-d", "--debug", "Set $DEBUG=true") {$DEBUG = true}
+ opts.on("--emacs LEVEL", Integer,
+ "Activates full Emacs support at annotation level LEVEL") do
+ |level|
+ Debugger.annotate = level.to_i
+ ENV['EMACS'] = '1'
+ ENV['COLUMNS'] = '120' if ENV['COLUMNS'].to_i < 120
+ options.control = false
+ options.quit = false
+ options.post_mortem = true
+ end
+ opts.on('--emacs-basic', 'Activates basic Emacs mode') do
+ ENV['EMACS'] = '1'
+ end
+ opts.on('-h', '--host HOST', 'Host name used for remote debugging') do
+ |host|
+ options.host = host
+ end
+ opts.on('-I', '--include PATH', String, 'Add PATH to $LOAD_PATH') do |path|
+ $LOAD_PATH.unshift(path)
+ end
+ opts.on('--keep-frame-binding', 'Keep frame bindings') do
+ options.frame_bind = true
+ end
+ opts.on('-m', '--post-mortem', 'Activate post-mortem mode') do
+ options.post_mortem = true
+ end
+ opts.on('--no-control', 'Do not automatically start control thread') do
+ options.control = false
+ end
+ opts.on('--no-quit', 'Do not quit when script finishes') do
+ options.quit = false
+ end
+ opts.on('--no-rewrite-program',
+ 'Do not set $0 to the program being debugged') do
+ options.no_rewrite_program = true
+ end
+ opts.on('--no-stop', 'Do not stop when script is loaded') do
+ options.stop = false
+ end
+ opts.on('-nx', 'Not run debugger initialization files (e.g. .rdebugrc') do
+ options.nx = true
+ end
+ opts.on('-p', '--port PORT', Integer, 'Port used for remote debugging') do
+ |port|
+ options.port = port
+ end
+ opts.on('-r', '--require SCRIPT', String,
+ 'Require the library, before executing your script') do |name|
+ if name == 'debug'
+ puts "ruby-debug is not compatible with Ruby's 'debug' library. This option is ignored."
+ else
+ require name
+ end
+ end
+ opts.on('--restart-script FILE', String,
+ 'Name of the script file to run. Erased after read') do
+ |restart_script|
+ options.restart_script = restart_script
+ unless File.exists?(options.restart_script)
+ puts "Script file '#{options.restart_script}' is not found"
+ exit
+ end
+ end
+ opts.on('--script FILE', String, 'Name of the script file to run') do
+ |script|
+ options.script = script
+ unless File.exists?(options.script)
+ puts "Script file '#{options.script}' is not found"
+ exit
+ end
+ end
+ opts.on('-s', '--server', 'Listen for remote connections') do
+ options.server = true
+ end
+ opts.on('-w', '--wait', 'Wait for a client connection, implies -s option') do
+ options.wait = true
+ end
+ opts.on('-x', '--trace', 'Turn on line tracing') {options.tracing = true}
+ opts.separator ''
+ opts.separator 'Common options:'
+ opts.on_tail('--help', 'Show this message') do
+ puts opts
+ exit
+ end
+ opts.on_tail('--version',
+ 'Print the version') do
+ puts "ruby-debug #{Debugger::VERSION}"
+ exit
+ end
+ opts.on('--verbose', 'Turn on verbose mode') do
+ $VERBOSE = true
+ options.verbose_long = true
+ end
+ opts.on_tail('-v',
+ 'Print version number, then turn on verbose mode') do
+ puts "ruby-debug #{Debugger::VERSION}"
+ $VERBOSE = true
+ end
+ end
+ return opts
+end
+
+# What file is used for debugger startup commands.
+unless defined?(OPTS_INITFILE)
+ if RUBY_PLATFORM =~ /mswin/
+ # Of course MS Windows has to be different
+ OPTS_INITFILE = 'rdbopt.ini'
+ HOME_DIR = (ENV['HOME'] ||
+ ENV['HOMEDRIVE'].to_s + ENV['HOMEPATH'].to_s).to_s
+ else
+ OPTS_INITFILE = '.rdboptrc'
+ HOME_DIR = ENV['HOME'].to_s
+ end
+end
+begin
+ initfile = File.join(HOME_DIR, OPTS_INITFILE)
+ eval(File.read(initfile)) if
+ File.exist?(initfile)
+rescue
+end
+
+opts = process_options(options)
+begin
+ if not defined? Debugger::ARGV
+ Debugger::ARGV = ARGV.clone
+ end
+ rdebug_path = File.expand_path($0)
+ if RUBY_PLATFORM =~ /mswin/
+ rdebug_path += '.cmd' unless rdebug_path =~ /\.cmd$/i
+ end
+ Debugger::RDEBUG_SCRIPT = rdebug_path
+ Debugger::RDEBUG_FILE = __FILE__
+ Debugger::INITIAL_DIR = Dir.pwd
+ opts.parse! ARGV
+rescue StandardError => e
+ puts opts
+ puts
+ puts e.message
+ exit(-1)
+end
+
+if options.client
+ Debugger.start_client(options.host, options.port)
+else
+ if ARGV.empty?
+ exit if $VERBOSE and not options.verbose_long
+ puts opts
+ puts
+ puts 'Must specify a script to run'
+ exit(-1)
+ end
+
+ # save script name
+ prog_script = ARGV.shift
+ prog_script = whence_file(prog_script) unless File.exist?(prog_script)
+ Debugger::PROG_SCRIPT = File.expand_path prog_script
+
+ # install interruption handler
+ trap('INT') { Debugger.interrupt_last }
+
+ # set options
+ Debugger.wait_connection = options.wait
+ Debugger.keep_frame_binding = options.frame_bind
+
+ if options.server
+ # start remote mode
+ Debugger.start_remote(options.host, [options.port, options.cport],
+ options.post_mortem) do
+ # load initrc script
+ Debugger.run_init_script(StringIO.new) unless options.nx
+ end
+ debug_program(options)
+ else
+ # Set up trace hook for debugger
+ Debugger.start
+ # start control thread
+ Debugger.start_control(options.host, options.cport) if options.control
+
+ # load initrc script (e.g. .rdebugrc)
+ Debugger.run_init_script(StringIO.new) unless options.nx
+
+ # run restore-settings startup script if specified
+ if options.restart_script
+ require 'fileutils'
+ Debugger.run_script(options.restart_script)
+ FileUtils.rm(options.restart_script)
+ end
+
+ # run startup script if specified
+ if options.script
+ Debugger.run_script(options.script)
+ end
+
+ # activate post-mortem
+ Debugger.post_mortem if options.post_mortem
+ options.stop = false if options.tracing
+ Debugger.tracing = options.tracing
+
+ if !options.quit
+ if Debugger.started?
+ until Debugger.stop do end
+ end
+ begin
+ debug_program(options)
+ rescue SyntaxError
+ puts $!.backtrace.map{|l| "\t#{l}"}.join("\n")
+ puts "Uncaught Syntax Error\n"
+ rescue
+ print $!.backtrace.map{|l| "\t#{l}"}.join("\n"), "\n"
+ print "Uncaught exception: #{$!}\n"
+ end
+ print "The program finished.\n" unless
+ Debugger.annotate.to_i > 1 # annotate has its own way
+ interface = Debugger::LocalInterface.new
+ # Not sure if ControlCommandProcessor is really the right
+ # thing to use. CommandProcessor requires a state.
+ processor = Debugger::ControlCommandProcessor.new(interface)
+ processor.process_commands
+ else
+ debug_program(options)
+ end
+ end
+end
View
415 bin/rdebug
@@ -0,0 +1,415 @@
+#!/usr/bin/env ruby
+
+#=== Summary
+#
+#A command-line front-end to the Ruby debugger, <tt>ruby-debug</tt>, the
+#Fast Ruby Debugger.
+#
+#Command invocation:
+#
+# rdebug [options] [--] [script-options] ruby-script-to-debug
+# rdebug [options] [script-options] [--client]
+# rdebug [--version | --help]
+#
+#=== Options
+#
+#<tt>-A | --annotate</tt> <i>level</i>::
+# Set gdb-style annotation to <i>level</i>, a number. Additional
+# information is output automatically when program state is
+# changed. This can be used by front-ends such as GNU Emacs to post
+# this updated information without having to poll for it.
+#
+#<tt>--client</tt>::
+# Connect to a remote debugger. Used with another rdebug invocation
+# using <tt>--server</tt>. See also <tt>--host</tt> and
+# <tt>--cport</tt> options
+#
+#<tt>--cport=</tt><i>port</i>::
+# Use port <i>port</i> for access to debugger control.
+#
+#<tt>-d | --debug</tt>::
+# Set $DEBUG true.
+#
+#<tt>--emacs</tt>::
+# Activates full GNU Emacs mode. Is the equivalent of setting the
+# options <tt>--emacs-basic --annotate=3 --no-stop --no-control
+# --post-mortem</tt>.
+#
+#<tt>--emacs-basic</tt>::
+# Activates GNU Emacs mode. Debugger prompts are prefaced with two
+# octal 032 characters.
+#
+#<tt>-h | --host=</tt><i>host</i>::
+# Use host name <i>host</i> for remote debugging.
+#
+#<tt>-I | --include</tt> <i>path</i>
+# Add <i>path</i> to <tt>$LOAD_PATH</tt>
+#
+#<tt>-m | --post-mortem</tt>::
+# Activate post-mortem mode.
+#
+#<tt>--no-control</tt>::
+# Do not automatically start control thread.
+#
+#<tt>--no-stop</tt>::
+# Do not stop when script is loaded.
+#
+#<tt>-p | --port=PORT</tt>::
+# Host name used for remote debugging.
+#
+#<tt>-r | --require</tt><i>script</i>::
+# Require the library, before executing your script.
+#
+#<tt>--script</tt> <i>file</i>::
+# Run debugger script file <i>file</i>
+#
+#<tt>-x | --trace</tt>::
+# Show lines before executing them.
+#
+#<tt>--no-quit</tt>::
+# Do not quit when script terminates. Instead rerun the
+# program.
+#
+#<tt>--version</tt>::
+# Show the version number and exit.
+#
+#<tt>--verbose</tt>::
+# Turn on verbose mode.
+#
+#<tt>--v</tt>::
+# Print the version number, then turn on verbose mode if
+# a script name is given. If no script name is given
+# just exit after printing the version number.
+#
+#<tt>--nx</tt>::
+# Don’t execute commands found in any initialization
+# files, e.g. <tt>.rdebugrc</tt>.
+#
+#<tt>--keep-frame-binding</tt>::
+# Keep frame bindings.
+#
+#<tt>--script=</tt><i>file</i>::
+# Name of the script file to run
+#
+#<tt>-s | --server</tt>::
+# Listen for remote connections. Another rdebug session
+# accesses using the <tt>--client</tt> option. See also the
+# <tt>--host</tt>, <tt>--port</tt> and <tt>--cport</tt> options
+#
+#<tt>-w | --wait</tt>::
+# Wait for a client connection; implies <tt>-s</tt> option.
+#
+#<tt>--help</tt>::
+# Show invocation help and exit.
+
+require 'rubygems'
+require 'optparse'
+require 'ostruct'
+require 'ruby-debug'
+
+def debug_program(options)
+ # Make sure Ruby script syntax checks okay.
+ # Otherwise we get a load message that looks like rdebug has
+ # a problem.
+ output = `ruby -c "#{Debugger::PROG_SCRIPT}" 2>&1`
+ if $?.exitstatus != 0 and RUBY_PLATFORM !~ /mswin/
+ puts output
+ exit $?.exitstatus
+ end
+ print "\032\032starting\n" if Debugger.annotate and Debugger.annotate > 2
+
+ # Record where we are we can know if the call stack has been
+ # truncated or not.
+ Debugger.start_sentinal=caller(0)[1]
+
+ bt = Debugger.debug_load(Debugger::PROG_SCRIPT, options.stop, false)
+ if bt
+ if options.post_mortem
+ Debugger.handle_post_mortem(bt)
+ else
+ print bt.backtrace.map{|l| "\t#{l}"}.join("\n"), "\n"
+ print "Uncaught exception: #{bt}\n"
+ end
+ end
+end
+
+# Do a shell-like path lookup for prog_script and return the results.
+# If we can't find anything return prog_script.
+def whence_file(prog_script)
+ if prog_script.index(File::SEPARATOR)
+ # Don't search since this name has path separator components
+ return prog_script
+ end
+ for dirname in ENV['PATH'].split(File::PATH_SEPARATOR) do
+ prog_script_try = File.join(dirname, prog_script)
+ return prog_script_try if File.exist?(prog_script_try)
+ end
+ # Failure
+ return prog_script
+end
+
+options = OpenStruct.new(
+ 'annotate' => Debugger.annotate,
+ 'client' => false,
+ 'control' => true,
+ 'cport' => Debugger::PORT + 1,
+ 'frame_bind' => false,
+ 'host' => nil,
+ 'quit' => true,
+ 'no_rewrite_program' => false,
+ 'stop' => true,
+ 'nx' => false,
+ 'port' => Debugger::PORT,
+ 'post_mortem' => false,
+ 'restart_script' => nil,
+ 'script' => nil,
+ 'server' => false,
+ 'tracing' => false,
+ 'verbose_long' => false,
+ 'wait' => false
+)
+
+def process_options(options)
+ program = File.basename($0)
+ opts = OptionParser.new do |opts|
+ opts.banner = <<EOB
+#{program} #{Debugger::VERSION}
+Usage: #{program} [options] <script.rb> -- <script.rb parameters>
+EOB
+ opts.separator ""
+ opts.separator "Options:"
+ opts.on("-A", "--annotate LEVEL", Integer, "Set annotation level") do
+ |annotate|
+ Debugger.annotate = annotate
+ end
+ opts.on("-c", "--client", "Connect to remote debugger") do
+ options.client = true
+ end
+ opts.on("--cport PORT", Integer, "Port used for control commands") do
+ |cport|
+ options.cport = cport
+ end
+ opts.on("-d", "--debug", "Set $DEBUG=true") {$DEBUG = true}
+ opts.on("--emacs LEVEL", Integer,
+ "Activates full Emacs support at annotation level LEVEL") do
+ |level|
+ Debugger.annotate = level.to_i
+ ENV['EMACS'] = '1'
+ ENV['COLUMNS'] = '120' if ENV['COLUMNS'].to_i < 120
+ options.control = false
+ options.quit = false
+ options.post_mortem = true
+ end
+ opts.on('--emacs-basic', 'Activates basic Emacs mode') do
+ ENV['EMACS'] = '1'
+ end
+ opts.on('-h', '--host HOST', 'Host name used for remote debugging') do
+ |host|
+ options.host = host
+ end
+ opts.on('-I', '--include PATH', String, 'Add PATH to $LOAD_PATH') do |path|
+ $LOAD_PATH.unshift(path)
+ end
+ opts.on('--keep-frame-binding', 'Keep frame bindings') do
+ options.frame_bind = true
+ end
+ opts.on('-m', '--post-mortem', 'Activate post-mortem mode') do
+ options.post_mortem = true
+ end
+ opts.on('--no-control', 'Do not automatically start control thread') do
+ options.control = false
+ end
+ opts.on('--no-quit', 'Do not quit when script finishes') do
+ options.quit = false
+ end
+ opts.on('--no-rewrite-program',
+ 'Do not set $0 to the program being debugged') do
+ options.no_rewrite_program = true
+ end
+ opts.on('--no-stop', 'Do not stop when script is loaded') do
+ options.stop = false
+ end
+ opts.on('-nx', 'Not run debugger initialization files (e.g. .rdebugrc') do
+ options.nx = true
+ end
+ opts.on('-p', '--port PORT', Integer, 'Port used for remote debugging') do
+ |port|
+ options.port = port
+ end
+ opts.on('-r', '--require SCRIPT', String,
+ 'Require the library, before executing your script') do |name|
+ if name == 'debug'
+ puts "ruby-debug is not compatible with Ruby's 'debug' library. This option is ignored."
+ else
+ require name
+ end
+ end
+ opts.on('--restart-script FILE', String,
+ 'Name of the script file to run. Erased after read') do
+ |restart_script|
+ options.restart_script = restart_script
+ unless File.exists?(options.restart_script)
+ puts "Script file '#{options.restart_script}' is not found"
+ exit
+ end
+ end
+ opts.on('--script FILE', String, 'Name of the script file to run') do
+ |script|
+ options.script = script
+ unless File.exists?(options.script)
+ puts "Script file '#{options.script}' is not found"
+ exit
+ end
+ end
+ opts.on('-s', '--server', 'Listen for remote connections') do
+ options.server = true
+ end
+ opts.on('-w', '--wait', 'Wait for a client connection, implies -s option') do
+ options.wait = true
+ end
+ opts.on('-x', '--trace', 'Turn on line tracing') {options.tracing = true}
+ opts.separator ''
+ opts.separator 'Common options:'
+ opts.on_tail('--help', 'Show this message') do
+ puts opts
+ exit
+ end
+ opts.on_tail('--version',
+ 'Print the version') do
+ puts "ruby-debug #{Debugger::VERSION}"
+ exit
+ end
+ opts.on('--verbose', 'Turn on verbose mode') do
+ $VERBOSE = true
+ options.verbose_long = true
+ end
+ opts.on_tail('-v',
+ 'Print version number, then turn on verbose mode') do
+ puts "ruby-debug #{Debugger::VERSION}"
+ $VERBOSE = true
+ end
+ end
+ return opts
+end
+
+# What file is used for debugger startup commands.
+unless defined?(OPTS_INITFILE)
+ if RUBY_PLATFORM =~ /mswin/
+ # Of course MS Windows has to be different
+ OPTS_INITFILE = 'rdbopt.ini'
+ HOME_DIR = (ENV['HOME'] ||
+ ENV['HOMEDRIVE'].to_s + ENV['HOMEPATH'].to_s).to_s
+ else
+ OPTS_INITFILE = '.rdboptrc'
+ HOME_DIR = ENV['HOME'].to_s
+ end
+end
+begin
+ initfile = File.join(HOME_DIR, OPTS_INITFILE)
+ eval(File.read(initfile)) if
+ File.exist?(initfile)
+rescue
+end
+
+opts = process_options(options)
+begin
+ if not defined? Debugger::ARGV
+ Debugger::ARGV = ARGV.clone
+ end
+ rdebug_path = File.expand_path($0)
+ if RUBY_PLATFORM =~ /mswin/
+ rdebug_path += '.cmd' unless rdebug_path =~ /\.cmd$/i
+ end
+ Debugger::RDEBUG_SCRIPT = rdebug_path
+ Debugger::RDEBUG_FILE = __FILE__
+ Debugger::INITIAL_DIR = Dir.pwd
+ opts.parse! ARGV
+rescue StandardError => e
+ puts opts
+ puts
+ puts e.message
+ exit(-1)
+end
+
+if options.client
+ Debugger.start_client(options.host, options.port)
+else
+ if ARGV.empty?
+ exit if $VERBOSE and not options.verbose_long
+ puts opts
+ puts
+ puts 'Must specify a script to run'
+ exit(-1)
+ end
+
+ # save script name
+ prog_script = ARGV.shift
+ prog_script = whence_file(prog_script) unless File.exist?(prog_script)
+ Debugger::PROG_SCRIPT = File.expand_path prog_script
+
+ # install interruption handler
+ trap('INT') { Debugger.interrupt_last }
+
+ # set options
+ Debugger.wait_connection = options.wait
+ Debugger.keep_frame_binding = options.frame_bind
+
+ if options.server
+ # start remote mode
+ Debugger.start_remote(options.host, [options.port, options.cport],
+ options.post_mortem) do
+ # load initrc script
+ Debugger.run_init_script(StringIO.new) unless options.nx
+ end
+ debug_program(options)
+ else
+ # Set up trace hook for debugger
+ Debugger.start
+ # start control thread
+ Debugger.start_control(options.host, options.cport) if options.control
+
+ # load initrc script (e.g. .rdebugrc)
+ Debugger.run_init_script(StringIO.new) unless options.nx
+
+ # run restore-settings startup script if specified
+ if options.restart_script
+ require 'fileutils'
+ Debugger.run_script(options.restart_script)
+ FileUtils.rm(options.restart_script)
+ end
+
+ # run startup script if specified
+ if options.script
+ Debugger.run_script(options.script)
+ end
+
+ # activate post-mortem
+ Debugger.post_mortem if options.post_mortem
+ options.stop = false if options.tracing
+ Debugger.tracing = options.tracing
+
+ if !options.quit
+ if Debugger.started?
+ until Debugger.stop do end
+ end
+ begin
+ debug_program(options)
+ rescue SyntaxError
+ puts $!.backtrace.map{|l| "\t#{l}"}.join("\n")
+ puts "Uncaught Syntax Error\n"
+ rescue
+ print $!.backtrace.map{|l| "\t#{l}"}.join("\n"), "\n"
+ print "Uncaught exception: #{$!}\n"
+ end
+ print "The program finished.\n" unless
+ Debugger.annotate.to_i > 1 # annotate has its own way
+ interface = Debugger::LocalInterface.new
+ # Not sure if ControlCommandProcessor is really the right
+ # thing to use. CommandProcessor requires a state.
+ processor = Debugger::ControlCommandProcessor.new(interface)
+ processor.process_commands
+ else
+ debug_program(options)
+ end
+ end
+end
View
2 cli/.svn/README.txt
@@ -0,0 +1,2 @@
+This is a Subversion working copy administrative directory.
+Visit http://subversion.tigris.org/ for more information.
View
0 cli/.svn/empty-file
No changes.
View
25 cli/.svn/entries
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wc-entries
+ xmlns="svn:">
+<entry
+ committed-rev="918"
+ name=""
+ committed-date="2009-04-04T08:42:45.368830Z"
+ url="svn://rubyforge.org/var/svn/ruby-debug/trunk/cli"
+ last-author="kent"
+ kind="dir"
+ uuid="453b2852-3d18-0410-866e-d09c099698e4"
+ revision="922"/>
+<entry
+ name="ruby-debug"
+ kind="dir"/>
+<entry
+ committed-rev="888"
+ name="ruby-debug.rb"
+ text-time="2009-07-22T04:17:38.000000Z"
+ committed-date="2008-11-14T15:32:22.855120Z"
+ checksum="b8bd9d628255a13adac7d9b5199b2619"
+ last-author="rockyb"
+ kind="file"
+ prop-time="2009-07-22T04:17:38.000000Z"/>
+</wc-entries>
View
1 cli/.svn/format
@@ -0,0 +1 @@
+4
View
1 cli/.svn/prop-base/ruby-debug.rb.svn-base
@@ -0,0 +1 @@
+END
View
1 cli/.svn/props/ruby-debug.rb.svn-work
@@ -0,0 +1 @@
+END
View
176 cli/.svn/text-base/ruby-debug.rb.svn-base
@@ -0,0 +1,176 @@
+require 'pp'
+require 'stringio'
+require 'socket'
+require 'thread'
+require 'ruby-debug-base'
+require 'ruby-debug/processor'
+
+module Debugger
+ self.handler = CommandProcessor.new
+
+ # the port number used for remote debugging
+ PORT = 8989 unless defined?(PORT)
+
+ # What file is used for debugger startup commands.
+ unless defined?(INITFILE)
+ if RUBY_PLATFORM =~ /mswin/
+ # Of course MS Windows has to be different
+ INITFILE = 'rdebug.ini'
+ HOME_DIR = (ENV['HOME'] ||
+ ENV['HOMEDRIVE'].to_s + ENV['HOMEPATH'].to_s).to_s
+ else
+ INITFILE = '.rdebugrc'
+ HOME_DIR = ENV['HOME'].to_s
+ end
+ end
+
+ class << self
+ # gdb-style annotation mode. Used in GNU Emacs interface
+ attr_accessor :annotate
+
+ # in remote mode, wait for the remote connection
+ attr_accessor :wait_connection
+
+ # If set, a string to look for in caller() and is used to see
+ # if the call stack is truncated.
+ attr_accessor :start_sentinal
+
+ attr_reader :thread, :control_thread
+
+ def interface=(value) # :nodoc:
+ handler.interface = value
+ end
+
+ #
+ # Starts a remote debugger.
+ #
+ def start_remote(host = nil, port = PORT, post_mortem = false)
+ return if @thread
+ return if started?
+
+ self.interface = nil
+ start
+ self.post_mortem if post_mortem