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,12 @@
1
+ AC_INIT(ruby-debug-extra, 0.10.4vc,)
2
+ AC_CONFIG_SRCDIR(doc/ruby-debug.texi)
3
+ AM_INIT_AUTOMAKE
4
+
5
+ ##
6
+ ## Find out where to install the debugger emacs lisp files
7
+ ##
8
+ AM_PATH_LISPDIR
9
+ AM_CONDITIONAL(INSTALL_EMACS_LISP, test "x$lispdir" != "x")
10
+
11
+ AC_CONFIG_FILES([doc/Makefile emacs/Makefile Makefile])
12
+ AC_OUTPUT
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require 'rubygems' unless defined? Gem
3
+ require File.dirname(__FILE__) + "/lib/debugger/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = %q{debugger}
7
+ s.version = Debugger::VERSION
8
+ s.authors = ["Kent Sibilev", "Mark Moseley", "Gabriel Horner"]
9
+ s.email = "gabriel.horner@gmail.com"
10
+ s.homepage = "http://github.com/cldwalker/debugger"
11
+ s.summary = %q{Fast Ruby debugger - base + cli}
12
+ s.description = %q{debugger is a fast implementation of the standard Ruby debugger debug.rb.
13
+ It is implemented by utilizing a new Ruby C API hook. The core component
14
+ provides support that front-ends can build on. It provides breakpoint
15
+ handling, bindings for stack frames among other things.
16
+ }
17
+ s.required_rubygems_version = ">= 1.3.6"
18
+ s.extra_rdoc_files = [ "README.md" ]
19
+ s.files = `git ls-files`.split("\n")
20
+ s.extensions << "ext/ruby_debug/extconf.rb"
21
+ s.add_dependency("columnize", ">= 0.3.1")
22
+ s.add_dependency("ruby_core_source", ">= 0.1.5")
23
+ s.add_dependency "debugger-linecache"
24
+ end
@@ -0,0 +1,42 @@
1
+ Makefile
2
+ Makefile.in
3
+ mdate-sh
4
+ missing
5
+ rdebug-emacs.aux
6
+ rdebug-emacs.cp
7
+ rdebug-emacs.cps
8
+ rdebug-emacs.fn
9
+ rdebug-emacs.fns
10
+ rdebug-emacs.html
11
+ rdebug-emacs.info
12
+ rdebug-emacs.ky
13
+ rdebug-emacs.log
14
+ rdebug-emacs.pdf
15
+ rdebug-emacs.pg
16
+ rdebug-emacs.pgs
17
+ rdebug-emacs.toc
18
+ rdebug-emacs.tp
19
+ rdebug-emacs.vr
20
+ rdoc
21
+ ruby-debug.aux
22
+ ruby-debug.cp
23
+ ruby-debug.cps
24
+ ruby-debug.fn
25
+ ruby-debug.fns
26
+ ruby-debug.html
27
+ ruby-debug.info
28
+ ruby-debug.ky
29
+ ruby-debug.kys
30
+ ruby-debug.log
31
+ ruby-debug.pdf
32
+ ruby-debug.pg
33
+ ruby-debug.pgs
34
+ ruby-debug.toc
35
+ ruby-debug.tp
36
+ ruby-debug.vr
37
+ ruby-debug.vrs
38
+ stamp-1
39
+ stamp-vti
40
+ texinfo.tex
41
+ version-rdebug-emacs.texi
42
+ version.texi
@@ -0,0 +1,63 @@
1
+ ##############################################################################
2
+ # $Id: Makefile.am,v 1.3 2006/12/28 12:34:25 rockyb Exp $
3
+ # Copyright (C) 2007 Rocky Bernstein
4
+ # This program is free software; you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation; either version 2 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, write to the Free Software
16
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
+ ##############################################################################
18
+
19
+ EXT=1
20
+ man1_MANS = rdebug.$(EXT)
21
+
22
+ EXTRA_DIST = $(man1_MANS) \
23
+ hanoi.rb primes.rb test-tri2.rb tri3.rb triangle.rb \
24
+ ruby-debug.info ruby-debug.html ruby-debug.pdf
25
+
26
+ info_TEXINFOS = ruby-debug.texi rdebug-emacs.texi
27
+
28
+ all: $(INFO_DEPS) $(man1_MANS) html pdf
29
+
30
+ pdf: ruby-debug.pdf rdebug-emacs.pdf
31
+
32
+ txt: ruby-debug.txt rdebug-emacs.txt
33
+
34
+ ps: ruby-debug.ps rdebug-emacs.ps
35
+
36
+ man: $(man1_MANS)
37
+
38
+ html: ruby-debug.html rdebug-emacs.html
39
+
40
+ ruby-debug.html: ruby-debug.texi
41
+ texi2html $(srcdir)/ruby-debug.texi || true
42
+
43
+ rdebug-emacs.html: rdebug-emacs.texi
44
+ texi2html $(srcdir)/rdebug-emacs.texi || true
45
+
46
+ %.ps.gz: %.ps
47
+ gzip -9c $< > $@
48
+
49
+ # Our `texinfo.tex' must reside in the current directory, otherwise
50
+ # texi2dvi will use the default.
51
+ .texi.pdf:
52
+ $(TEXI2PDF) -I $(srcdir) $<
53
+
54
+ .texi.dvi:
55
+ $(TEXI2DVI) -I $(srcdir) $<
56
+
57
+ .dvi.ps:
58
+ test -d $(docdir) || mkdir $(docdir)
59
+ $(DVIPS) $< -o $@
60
+
61
+ all-formats: pdf dvi txt ps html
62
+
63
+ MOSTLYCLEANFILES = rubydb.tgs rubydb.ps.gz rubydb.pdf rubydb.html rubydb_toc.html rubydb_foot.html rubydb-man.html
@@ -0,0 +1,38 @@
1
+ * rdebug.el is loaded by the user when Emacs is launched. (Should
2
+ Rdebug ever be part of Emacs, this should be the items autoloaded by
3
+ Emacs.)
4
+
5
+ There is a command buffer which is the gud process. There are a number
6
+ of "secondary" buffers have in gud-comint-buffer the gud process. The
7
+ way we go the other direction from gud process to secondary buffer is
8
+ by buffer name. Source buffers don't seem to have a local
9
+ gud-comint-buffer variable set but use the global value. Perhaps
10
+ source buffer should have their own buffer-local value(s)?
11
+
12
+ For each secondary buffer we have things for that specific buffer. In particular:
13
+ * frames (rdebug-frames.el)
14
+ * output (rdebug-output.el)
15
+ * variables (rdebug-varbuf.el)
16
+ * watch or display-expressions - (rdebug-watch.el
17
+ * breakpoints (rdebug-breaks.el)
18
+
19
+ Each specific secondary buffer includes
20
+ - setting the buffer up,
21
+ - specific commands for that buffer
22
+ - the kinds of functions that buffer deals with (e.g. frame
23
+ things for the "frame" buffer or breakpoints for the "breakpoints" buffer.)
24
+
25
+ * rdebug-gud.el contains things that interface to gdb. Possibly also
26
+ things that interface to gdb-ui should be there as well.
27
+
28
+ * rdebug-shortkey.el has all the magic that needs to be done to make
29
+ shortkey mode work.
30
+
31
+ * rdebug-track is all the things to make rdebug-track mode work.
32
+
33
+ I have some additions, which deals with *when* certain files are loaded.
34
+
35
+ * rdebug-source.el is loaded when the first Ruby source file is loaded
36
+ Of course, the name rdebug-source.el is not important, we could rename
37
+ it to something else and reuse the name for other source-related
38
+ things.
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/ruby
2
+
3
+ def hanoi(n,a,b,c)
4
+ if n-1 > 0
5
+ hanoi(n-1, a, c, b)
6
+ end
7
+ puts "Move disk %s to %s" % [a, b]
8
+ if n-1 > 0
9
+ hanoi(n-1, c, b, a)
10
+ end
11
+ end
12
+
13
+ i_args=ARGV.length
14
+ if i_args > 1
15
+ puts "*** Need number of disks or no parameter"
16
+ exit 1
17
+ end
18
+
19
+ n=3
20
+
21
+ if i_args > 0
22
+ begin
23
+ n = ARGV[0].to_i
24
+ rescue ValueError, msg:
25
+ print "** Expecting an integer, got: %s" % ARGV[0].to_s
26
+ exit 2
27
+ end
28
+ end
29
+
30
+ if n < 1 or n > 100
31
+ puts "*** number of disks should be between 1 and 100"
32
+ exit 2
33
+ end
34
+
35
+ hanoi(n, :a, :b, :c)
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+ # Enumerator for primes
3
+ class SievePrime
4
+ @@odd_primes = []
5
+ def self.next_prime(&block)
6
+ candidate = 2
7
+ yield candidate
8
+ not_prime = false
9
+ candidate += 1
10
+ while true do
11
+ @@odd_primes.each do |p|
12
+ not_prime = (0 == (candidate % p))
13
+ break if not_prime
14
+ end
15
+ unless not_prime
16
+ @@odd_primes << candidate
17
+ yield candidate
18
+ end
19
+ candidate += 2
20
+ end
21
+ end
22
+ end
23
+ SievePrime.next_prime do |prime|
24
+ puts prime
25
+ break if prime > 10
26
+ end
27
+
28
+
@@ -0,0 +1,1030 @@
1
+ \input texinfo @c -*-texinfo-*-
2
+ @setfilename rdebug-emacs.info
3
+
4
+ @set DBG ruby-debug
5
+ @set ttrdebug @code{rdebug}
6
+ @set ttDBG @code{@value{DBG}}
7
+ @set Emacs @sc{gnu} Emacs
8
+
9
+ @set RDEBUG_EMACS_VERSION 0.1
10
+ @include version-rdebug-emacs.texi
11
+ @finalout
12
+
13
+ @c Karl Berry informs me that this will add straight quotes in
14
+ @c typewriter text.
15
+ @c See the "Inserting Quote Characters" node in the Texinfo manual
16
+ @set txicodequoteundirected
17
+ @set txicodequotebacktick
18
+
19
+ @c THIS MANUAL REQUIRES TEXINFO 4.0 OR LATER.
20
+
21
+ @c This is a dir.info fragment to support semi-automated addition of
22
+ @c manuals to an info tree.
23
+ @dircategory Programming & development tools.
24
+ @direntry
25
+ * ruby-debug-emacs: (ruby-debug). Ruby Debugger for GNU Emacs
26
+ @end direntry
27
+
28
+ @titlepage
29
+ @title Debugging with @code{ruby-debug} inside GNU Emacs Version @value{RDEBUG_EMACS_VERSION}
30
+ @sp 1
31
+ @subtitle @value{EDITION} Edition
32
+ @subtitle @value{UPDATED-MONTH}
33
+ @author Rocky Bernstein and Anders Lindgren
34
+ @page
35
+ @ifset WHERETO
36
+ @tex
37
+ {\parskip=0pt
38
+ \hfill (Send bugs and comments on ruby-debug to fill in...)\par
39
+ \hfill {\it Debugging with {\tt ruby-debug}\par
40
+ \hfill \TeX{}info \texinfoversion\par
41
+ }
42
+ @end tex
43
+ @end ifset
44
+ @end titlepage
45
+ @page
46
+
47
+ @node Top, Getting started, (dir), (dir)
48
+ @top Debugging with ruby-debug under GNU Emacs
49
+
50
+ @menu
51
+ * Getting started::
52
+ * The Multi-window Mode::
53
+ * Debugger Buffers::
54
+ * Emacs Debugger Commands:: Indexes (nodes containing large menus)
55
+ * Emacs Command Index:: An item for each GNU/Emacs command name.
56
+ * Emacs Function Index:: An item for each Emacs Function.
57
+ * Emacs Key Binding Index:: An item for each Emacs Debugger Command.
58
+
59
+ @detailmenu
60
+ --- The Detailed Node Listing ---
61
+
62
+ Getting started
63
+
64
+ * Installation:: How to install this package
65
+ * Emacs rdebug:: Invoke the ruby debugger initially
66
+ * Emacs shell tracking mode:: Entering rdebug from an existing shell buffer
67
+
68
+ Debugger Buffers
69
+
70
+ * Debugger Command Buffer::
71
+ * Emacs Source:: Commands from the source script
72
+
73
+ Emacs Debugger Commands
74
+
75
+ * Emacs Debugger Common Commands::
76
+ * Emacs Debugger Breakpoint Buffer Commands::
77
+ * Emacs Debugger Stack Buffer Commands::
78
+ * Emacs Debugger Variable Buffer Commands::
79
+ * Emacs Debugger Watch Buffer Commands::
80
+ * Emacs GUD Commands::
81
+
82
+ @end detailmenu
83
+ @end menu
84
+
85
+ This file describes ruby-debug, the Ruby Debugger,
86
+ version @value{RDEBUG_EMACS_VERSION}
87
+
88
+ This is the @value{EDITION} Edition, @value{UPDATED}
89
+ @c Copyright (C) 2007 ...
90
+
91
+ @c @node GNU Emacs
92
+ @c @chapter Using @code{ruby-debug} from GNU Emacs
93
+
94
+
95
+ @cindex @value{Emacs}
96
+ A special interface which comes with Ruby that allows you to use
97
+ @value{Emacs} to view (and edit) the source files for the program you
98
+ are debugging with @value{DBG}. However you must be using at least
99
+ version 21 of @value{Emacs}, but with @value{Emacs} version 22 or 23
100
+ there are even more debugging features available. @code{M-x
101
+ show-emacs-version} inside @value{Emacs} will tell you what version you
102
+ are running.
103
+
104
+ This package provide a full-fledged debugging environment, on par with
105
+ modern integrated development environments. Once the debugger has been
106
+ activated, the Emacs frame is divided into a number of dedicated
107
+ debugger windows.@footnote{If you are an @value{Emacs} traditionalist,
108
+ you can, of course, run this package with only a shell and source
109
+ buffer}
110
+
111
+ This package comes with a number of predefined window layouts. It is
112
+ fully customizable so you can create your own.
113
+
114
+ @c -------------------------------------------------------------------
115
+
116
+
117
+ @node Getting started, The Multi-window Mode, Top, Top
118
+ @chapter Getting started
119
+
120
+ @menu
121
+ * Installation:: How to install this package
122
+ * Emacs rdebug:: Invoke the ruby debugger initially
123
+ * Emacs shell tracking mode:: Entering rdebug from an existing shell buffer
124
+ * Configurating this package:: Introducing the configure system
125
+ @end menu
126
+
127
+ @node Installation, Emacs rdebug, Getting started, Getting started
128
+ @section Installation
129
+
130
+ To use this interface, load the file @code{rdebug.el}. This file is a
131
+ light-weight file, basically it only contains a handful of
132
+ @code{autoload} directives.
133
+
134
+ For example, you can place the following in your @code{~/.emacs} file:
135
+
136
+ @smallexample
137
+ (require 'rdebug)
138
+ @end smallexample
139
+
140
+ In addition, you must have Ruby and ruby-debug installed.
141
+
142
+
143
+ @node Emacs rdebug, Emacs shell tracking mode, Installation, Getting started
144
+ @section Emacs rdebug
145
+
146
+ Use the command @kbd{M-x rdebug} in @sc{gnu} Emacs to start debugging.
147
+ Give the executable file you want to debug as an argument. Make sure
148
+ to use the version that comes with this package as this is newer than
149
+ that supplied with @value{Emacs}.
150
+
151
+ The @kbd{rdebug} command starts @value{DBG} as a subprocess of Emacs,
152
+ with input and output through a newly created Emacs buffer.
153
+
154
+ Using @value{DBG} under Emacs is just like using @value{DBG}
155
+ normally except for two things:
156
+
157
+ @itemize @bullet
158
+ @item
159
+ All ``terminal'' input and output goes through the GNU Emacs buffer.
160
+ @end itemize
161
+
162
+ This applies both to @value{DBG} commands and their output, and to the input
163
+ and output done by the program you are debugging.
164
+
165
+ This is useful because it means that you can copy the text of previous
166
+ commands and input them again; you can even use parts of the output
167
+ in this way.
168
+
169
+ All the facilities of GNU Emacs' Shell mode are available for interacting
170
+ with your script. In particular, you can send signals the usual
171
+ way---for example, @kbd{C-c C-c} for an interrupt, @kbd{C-c C-z} for a
172
+ stop.
173
+
174
+ @node Emacs shell tracking mode, Configurating this package, Emacs rdebug, Getting started
175
+ @section Entering rdebug from an existing shell buffer
176
+
177
+ Many times it's not feasible to enter the debugger from the outset.
178
+ Instead a call to the debugger is put inside the program.
179
+
180
+ @c See @xref{Unit Testing Session}.
181
+
182
+ It is also possible in GNU emacs to use a (``comint'') shell and set a
183
+ mode to watch for @value{DBG} prompts and track the source code in
184
+ another window. @xref{Interactive Shell, , Shell, Emacs, The @value{Emacs}
185
+ Manual}.
186
+
187
+ To enable, this run @kbd{M-x turn-on-rdebug-track-mode}. There is some
188
+ overhead involved in scanning output, so if you are not debugging Ruby
189
+ programs you probably want to turn this off which can be done via the
190
+ @code{M-x turn-off-rdebugtrack} command.
191
+
192
+
193
+ @node Configurating this package, , Emacs shell tracking mode, Getting started
194
+ @section Configurating this package
195
+
196
+ In this manual we present a number of @value{Emacs} lisp variables and
197
+ functions that you can use to configure the debugger interface. In
198
+ addition, you can use the @value{Emacs} @emph{customize} system, see the
199
+ @kbd{<menu-bar> <debugger> <options> <customize>} menu item.
200
+
201
+ @c -------------------------------------------------------------------
202
+
203
+ @node The Multi-window Mode, Debugger Buffers, Getting started, Top
204
+ @chapter Multi-window
205
+
206
+ In the multi-window debugger mode, a number of buffers are visible when
207
+ the debugger starts. This chapter will describe each of them, in
208
+ addition it will describe the features associated with the multi-window
209
+ mode.
210
+
211
+ The default multi-window layout looks like the following:
212
+
213
+ @verbatim
214
+ +----------------------------------------------------------------------+
215
+ | Toolbar |
216
+ +-----------------------------------+----------------------------------+
217
+ | | |
218
+ | Debugger shell | Variables buffer |
219
+ | | |
220
+ +-----------------------------------+----------------------------------+
221
+ | | |
222
+ | Source buffer | Output buffer |
223
+ | | |
224
+ +-----------------------------------+----------------------------------+
225
+ | | |
226
+ | Stack buffer | Breakpoints buffer |
227
+ | | |
228
+ +-----------------------------------+----------------------------------+
229
+ @end verbatim
230
+
231
+ @section Activating Multi-window mode
232
+
233
+ The variable @code{rdebug-many-windows} controls if multi-window mode
234
+ should be used, it is enabled by default. When starting the debugger
235
+ using the @code{M-x rdebug} mode the command line option @code{--emacs
236
+ 3} must be specified (this is also the default).
237
+
238
+ When attaching to an already running debugger process, you must give the
239
+ debugger command @kbd{set annotate 3}.
240
+
241
+ @section Window Layouts
242
+
243
+ When the debugger is started, the original window layout of
244
+ @value{Emacs} is replaced with the window layout of the debugger. You
245
+ can switch back and forth between the original window layout and the
246
+ debugger layout using
247
+ @kbd{M-x rdebug-display-original-window-configuration} and
248
+ @kbd{M-x rdebug-display-debugger-window-configuration}.
249
+
250
+ If, for some reason, the debugger layout has been garbled you can
251
+ restore it to the original state using @kbd{M-x
252
+ rdebug-restore-debugger-window-layout}.
253
+
254
+ The debugger provides a number of different window layouts. The easies
255
+ way to try them out is to use the menu @kbd{<menu-bar> <debugger>
256
+ <layout>} and select any in the section starting with @code{Standard}.
257
+
258
+
259
+ @section The buffers
260
+
261
+ All buffers in this section share a set of commands for common debugger
262
+ operations and for switching between buffers. In addition, each buffer
263
+ has got a set of dedicated commands.
264
+
265
+ All debugger buffers, with the exception of source and the debugger
266
+ shell window, are called @emph{secondary buffers}.
267
+
268
+ @subsection Keybindings for all Debugger Windows
269
+
270
+ The debugger provides key-bindings that work in all debugger windows,
271
+ including Ruby source buffers. The key bindings are designed to match
272
+ keys of commonly used debugger environments.
273
+
274
+ The variable @code{rdebug-populate-common-keys-function} can be assigned
275
+ to a function that should bind the keys use. Three functions are
276
+ provided @code{rdebug-populate-common-keys-standard},
277
+ @code{...-eclipse}, and @code{...-netbeans}.
278
+
279
+ @multitable @columnfractions 0.4 0.2 0.2 0.2
280
+ @headitem Command @tab Standard @tab Eclipse @tab Netbeans
281
+ @item Run @tab f5 @tab @tab
282
+ @item Quit @tab S-f5 @tab @tab
283
+ @item Toggle Breakpoint @tab f9 @tab @tab
284
+ @item Enable/Disable Breakpoint @tab C-f9 @tab S-C-b @tab S-f8
285
+ @item Step over @tab f10 @tab f6 @tab f8
286
+ @item Step into @tab f11 @tab f5 @tab f7
287
+ @item Step out @tab S-f11 @tab f7 @tab M-S-f7
288
+
289
+ @end multitable
290
+
291
+
292
+
293
+ @subsection Keybindings for Secondary Buffers
294
+
295
+ The following commands are available in all secondary windows.
296
+
297
+ Capital letters move between secondary buffers as mentioned above (jump
298
+ to if visible or replace a secondary if not).
299
+
300
+ @table @kbd
301
+ @item SPACE
302
+ step (edebug compatible)
303
+ @item <
304
+ Up in the stack trace
305
+ @item >
306
+ Down in the stack trace
307
+ @item ?
308
+ Help
309
+ @item B
310
+ Display breakpoints buffer
311
+ @item C
312
+ Display command buffer
313
+ @item O
314
+ Display program output
315
+ @item S
316
+ Display source window
317
+ @item T
318
+ Display stack trace buffer
319
+ @item V
320
+ display variables buffer
321
+ @item W
322
+ display watch buffer
323
+ @item b
324
+ Set breakpoint
325
+ @item c
326
+ Continue (i.e. run)
327
+ @item d
328
+ Remove breakpoint
329
+ @item f
330
+ Finish (i.e. step out of the current function)
331
+ @item n
332
+ Next (i.e. step into function)
333
+ @item p
334
+ print
335
+ @item q
336
+ Quit
337
+ @item r
338
+ Restart
339
+ @item s
340
+ Step (i.e. step over function)
341
+ @end table
342
+
343
+ You can use the same commands in the source buffer if you enable
344
+ @code{rdebug-short-key-mode}. The best way to do this is to add the
345
+ following to your init file:
346
+
347
+ @smallexample
348
+ (add-hook 'rdebug-mode-hook 'rdebug-turn-on-short-key-mode)
349
+ @end smallexample
350
+
351
+
352
+
353
+ @subsection The Debugger Shell Buffer
354
+
355
+ The @emph{debugger shell window} is the main communication channel
356
+ between @value{DBG} and @value{Emacs}. You can use the shell to issue
357
+ debugger commands directly. In addition, any @value{Emacs} debugger
358
+ command you issue will be translated into shell commands, and the output
359
+ will be parsed.
360
+
361
+ It is the ambition that the @value{Emacs} debugger interface should be
362
+ in a state where the debugger shell window would not need to be visible.
363
+
364
+ @subsection The Source Buffer
365
+
366
+ The @emph{source buffers} (or buffers) contains the actual Ruby source
367
+ code that is being debugged. A small arrow in the left fringe displays
368
+ the current line. Active breakpoints are displayed as red dots and
369
+ passive as grey.
370
+
371
+ @subsection The Output Buffer
372
+
373
+ The @emph{output buffer} displays any output the debugged program emits.
374
+
375
+ The option @code{rdebug-use-separate-io-buffer} controls if the output
376
+ buffer should be used, or if the output would go into the debugger shell
377
+ buffer.
378
+
379
+ @subsection The Variables Buffer
380
+
381
+ In this buffer, local and object variables are displayed. The values of
382
+ the variables can be edited.
383
+
384
+ @table @kbd
385
+ @item RET
386
+ Edit the value
387
+ @item e
388
+ Print the value
389
+ @item x
390
+ Pretty-print the value
391
+ @end table
392
+
393
+ @subsection The Stack Trace Buffer
394
+
395
+ The @emph{stack trace} buffer displays the function that is currently
396
+ being debugger, the function that called it, etc., all the way up to the
397
+ originally called function.
398
+
399
+ You can navigate in the stack trace buffer in order to see the source of
400
+ any function in the call chain. The Variables buffer will also be
401
+ updated to reflect the local variables of that function.
402
+
403
+ @table @kbd
404
+ @item RET
405
+ Select a function to display
406
+ @item <digits>
407
+ Go to a stack frame
408
+ @end table
409
+
410
+ @subsection The Watch Buffer
411
+
412
+ The @emph{Watch Buffer} can display arbitrary expressions, including,
413
+ but not limited to, global variables.
414
+
415
+ @table @kbd
416
+ @item a
417
+ Add a watch expression
418
+ @item C-d, d
419
+ Delete a watch expression
420
+ @item RET, e
421
+ Edit a watch expression
422
+ @item <digits>
423
+ Go to the expression
424
+ @end table
425
+
426
+ @subsection The Breakpoints Buffer
427
+
428
+ The @emph{Breakpoints Buffer} displays all breakpoints that currently are
429
+ defined and shows if they are enabled or disabled.
430
+
431
+ @table @kbd
432
+ @item t
433
+ Toggle a breakpoint between enabled and disabled
434
+ @item i
435
+ Add a breakpoint condition
436
+ @item ret
437
+ Goto a breakpoint
438
+ @item C-d
439
+ Delete a breakpoint
440
+ @item <digits>
441
+ Go to the expression
442
+ @end table
443
+
444
+ @subsection The Help Buffer
445
+
446
+ The @emph{Help Buffer} is displayed whenever you press @code{?}. It will
447
+ display a help text on the available debugger commands and commands to
448
+ navigate between the buffers.
449
+
450
+
451
+ @c -------------------------------------------------------------------
452
+
453
+ @node Debugger Buffers, Emacs Debugger Commands, The Multi-window Mode, Top
454
+ @chapter Debugger Buffers
455
+
456
+ @menu
457
+ * Debugger Command Buffer::
458
+ * Emacs Source:: Commands from the source script
459
+ @end menu
460
+
461
+ @node Debugger Command Buffer, Emacs Source, Debugger Buffers, Debugger Buffers
462
+ @section Emacs Debugger Command buffer
463
+
464
+ Each time @value{DBG} displays a stack frame, Emacs automatically finds the
465
+ source file for that frame and puts an arrow (@samp{=>}) at the
466
+ left margin of the current line. Emacs uses a separate buffer for
467
+ source display, and splits the screen to show both your @value{DBG} session
468
+ and the source.
469
+
470
+ Explicit @value{DBG} @code{list} or search commands still produce output as
471
+ usual, but you probably have no reason to use them from GNU Emacs.
472
+
473
+ @quotation
474
+ @emph{Warning:} If the directory where your script resides is not your
475
+ current directory, it can be easy to confuse Emacs about the location of
476
+ the source files, in which case the auxiliary display buffer does not
477
+ appear to show your source. @value{DBG} can find programs by searching your
478
+ environment's @code{PATH} variable, so the @value{DBG} input and output
479
+ session proceeds normally; but Emacs does not get enough information
480
+ back from @value{DBG} to locate the source files in this situation. To
481
+ avoid this problem, either start @value{DBG} mode from the directory where
482
+ your script resides, or specify an absolute file name when prompted for the
483
+ @kbd{M-x gdb} argument.
484
+
485
+ A similar confusion can result if you use the @value{DBG} @code{file} command to
486
+ switch to debugging a program in some other location, from an existing
487
+ @value{DBG} buffer in Emacs.
488
+ @end quotation
489
+
490
+ @noindent
491
+ (preceded by @kbd{M-:} or @kbd{ESC :}, or typed in the @code{*scratch*} buffer, or
492
+ in your @file{.emacs} file).
493
+
494
+ In the @value{DBG} I/O buffer, you can use the Emacs commands listed
495
+ below in addition to the standard Shell mode commands. The I/O buffer
496
+ name name is usually @code{*gud-}@emph{script-name}@code{*}, where
497
+ @emph{script-name} is the name of the script you are debugging.
498
+
499
+ Many of the commands listed below are also bound to a second key
500
+ sequence which also can be used in the also be used in the source
501
+ script. These are listed in @ref{Emacs Source}.
502
+
503
+ In secondary buffers many commands are available the corresponding
504
+ final keystroke. For example @code{C-c n} in a secondary buffer is
505
+ @code{n}.
506
+
507
+ @table @kbd
508
+ @item C-h m
509
+ Describe the features of Emacs' @value{DBG} Mode.
510
+
511
+ @item C-x C-a C-b (gud-break)
512
+ @pindex C-x C-a C-b (gud-break)
513
+ Set breakpoint at current line.
514
+
515
+ @item C-x C-a C-d (gud-remove)
516
+ @pindex C-x C-a C-d (gud-remove)
517
+ Remove breakpoint at current line.
518
+
519
+ @item C-x C-a C-l (gud-refresh)
520
+ @pindex C-x C-a C-d (gud-refresh)
521
+ Fix up a possibly garbled display, and redraw the arrow.
522
+
523
+ @item C-c RET (comint-copy-old-input)
524
+ @pindex C-c RET (comint-copy-old-input)
525
+ Insert after prompt old input at point as new input to be edited.
526
+ Calls `comint-get-old-input' to get old input.
527
+
528
+ @item C-c n (gud-next)
529
+ @pindex C-c n (gud-next)
530
+ Step one line, skipping functions. (Step over).
531
+
532
+ @item C-x C-a C-o (comint-delete-output)
533
+ @pindex C-c n (comint-delete-output)
534
+ Delete all output from interpreter since last input. Does not delete
535
+ the prompt.
536
+
537
+ @item C-x C-a C-r (gud-cont)
538
+
539
+ @item C-c SPC (gud-step @var{arg})
540
+ @pindex C-c SPC (gud-step @var{arg})
541
+ @itemx C-x C-a C-s (gud-step @var{arg})
542
+ @pindex C-x C-a C-s (gud-step @var{arg})
543
+ Step one source line. Same as @value{DBG} @code{step} command. The
544
+ @value{Emacs} command name is @code{gud-step} and @code{C-x C-a C-s}
545
+ is an alternate binding which can be used in the source
546
+ script.
547
+ @c @xref{Step}.
548
+
549
+ With a numeric argument, run that many times.
550
+ @xref{Arguments, , Numeric Arguments, Emacs, The @value{Emacs}
551
+ Manual}.
552
+
553
+
554
+ @item C-x C-a C-t (gud-tbreak @var{arg})
555
+ Set temporary breakpoint at current line.
556
+
557
+ @item C-x C-a C-w (backward-kill-word)
558
+ @item C-x C-a C-x (comint-get-next-from-history)
559
+ @item C-x C-a C-z (comint-stop-subjob)
560
+ Stop the current subjob.
561
+ This command also kills the pending input
562
+ between the process mark and point.
563
+
564
+ WARNING: if there is no current subjob, you can end up suspending
565
+ the top-level process running in the buffer. If you accidentally do
566
+ this, use M-x comint-continue-subjob to resume the process. (This
567
+ is not a problem with most shells, since they ignore this signal.)
568
+
569
+ @item C-x C-a C-\ (comint-quit-subjob)
570
+ Send quit signal to the current subjob.
571
+ This command also kills the pending input
572
+ between the process mark and point.
573
+
574
+ @item C-c + (gud-step-plus)
575
+ Run @code{step+}.
576
+
577
+ @item C-c . (comint-insert-previous-argument @var{index})
578
+ Insert the @emph{index-th} argument from the previous Comint command-line at point.
579
+ Spaces are added at beginning and/or end of the inserted string if
580
+ necessary to ensure that it's separated from adjacent arguments.
581
+ Interactively, if no prefix argument is given, the last argument is inserted.
582
+ Repeated interactive invocations will cycle through the same argument
583
+ from progressively earlier commands (using the value of index specified
584
+ with the first command).
585
+
586
+ @item C-c < (gud-up)
587
+ Go up a stack frame. With a numeric argument, go up that many
588
+ stack frames. Same @value{DBG} @code{up} command.
589
+ @xref{Arguments, , Numeric Arguments, Emacs, The @value{Emacs}
590
+ Manual}.
591
+
592
+ @item C-c > (gud-down)
593
+ Go down a stack frame. Same as @value{DBG} @code{down}.
594
+ With a numeric argument, go down that many stack frames.
595
+ @xref{Arguments, , Numeric Arguments, Emacs, The @value{Emacs}
596
+ Manual}.
597
+
598
+ @item C-c ? (rdebug-display-secondary-window-help-buffer)
599
+ Display the rdebug help buffer.
600
+
601
+ @item C-c B (rdebug-display-breakpoints-buffer)
602
+ Display the rdebug breakpoints buffer.
603
+
604
+ @item C-x C-a C (rdebug-display-cmd-buffer)
605
+ Display the rdebug command buffer.
606
+
607
+ @item C-c O (rdebug-display-output-buffer)
608
+ Display the rdebug output buffer.
609
+
610
+ @item C-c R (gud-run)
611
+ @itemx C-c r (gud run)
612
+ Restart or run the script. Same as @value{DBG} @code{run} command.
613
+
614
+ @item C-c S (gud-source-resync)
615
+ @item C-c T (rdebug-display-stack-buffer)
616
+ Display the rdebug stack buffer.
617
+ @item C-c V (rdebug-display-variables-buffer)
618
+ Display the rdebug variables buffer.
619
+
620
+ @item C-c W (rdebug-display-watch-buffer)
621
+ Display the rdebug watch buffer.
622
+
623
+ @item C-c f (gud-finish @var{arg})
624
+ @pindex C-c f (gud-finish @var{arg})
625
+ Finish executing current function.
626
+
627
+ @itemx C-x C-a C-f (gud-finish)
628
+ @pindex C-x C-a C-f (gud-finish)
629
+ Finish executing current function. The same as @value{DBG}
630
+ @code{finish} command.
631
+ @c @xref{Finish}.
632
+
633
+ @item C-c n (gud-next)
634
+ @pindex C-c n (gud-next)
635
+ Execute to next source line in this function, skipping all function
636
+ calls. Same as @value{DBG} @code{next} command.
637
+ @c @xref{Next}.
638
+
639
+ With a numeric argument, run that many times.
640
+ @c @xref{Arguments, , Numeric Arguments, Emacs, The @value{Emacs} Manual}.
641
+
642
+ @item C-c q (gud-quit)
643
+
644
+ @item C-x C-a C-l
645
+ Resynchronize the current position with the source window. The
646
+ @value{Emacs} command name is @code{gud-refresh} and @code{C-x C-a
647
+ C-l} is an alternate binding which also can be used in the source script.
648
+
649
+ @item C-c a
650
+ Shows argument variables (e.g.@: @code{$1}, @code{$2}) of the current
651
+ stack frame. Same as @value{DBG} @code{info args} command. The
652
+ @value{Emacs} command name is @code{gud-args} and @code{C-x C-a a} is
653
+ an alternate binding which also can be used in the source script.
654
+
655
+ @item C-c T
656
+ Show stack trace. Same as @value{DBG} @code{where} command. The
657
+ @value{Emacs} command name is @code{gud-where} and @code{C-x C-a T} is
658
+ an alternate binding which can be used in the source
659
+ script.
660
+ @c @xref{Backtrace}.
661
+
662
+ @end table
663
+
664
+ In any source file, the Emacs command @kbd{C-x SPC} (@code{gud-break})
665
+ tells @value{DBG} to set a breakpoint on the source line point is on.
666
+
667
+ If you accidentally delete the source-display buffer, an easy way to get
668
+ it back is to type the command @code{frame} in the @value{DBG} buffer, to
669
+ request a frame display; when you run under Emacs, this recreates
670
+ the source buffer if necessary to show you the context of the current
671
+ frame.
672
+
673
+ The source files displayed in Emacs are in ordinary Emacs buffers
674
+ which are visiting the source files in the usual way. You can edit
675
+ the files with these buffers if you wish; but keep in mind that @value{DBG}
676
+ communicates with Emacs in terms of line numbers. If you add or
677
+ delete lines from the text, the line numbers that @value{DBG} knows cease
678
+ to correspond properly with the code.
679
+
680
+ @xref{Debugger Operation, , , Emacs, The @value{Emacs}
681
+ Manual}.
682
+
683
+ @node Emacs Source, , Debugger Command Buffer, Debugger Buffers
684
+ @section Commands from the source script
685
+
686
+ @table @kbd
687
+ @item C-x SPC
688
+
689
+ tells @value{DBG} to set a breakpoint on the source
690
+ line point is on. (@code{gud-break})
691
+
692
+ @item C-x C-a t
693
+
694
+ @code{gud-linetrace}
695
+
696
+ @item C-x C-a C-f
697
+ Restart or run the script. Same as @value{DBG} @code{run} command. The
698
+ @value{Emacs} command name is @code{gud-finish}. In the corresponding
699
+ I/O buffer, @code{C-c R} is an alternate binding.
700
+
701
+ @item C-x C-a T
702
+ Show stack trace. Same as @value{DBG} @code{where} command. In the
703
+ corresponding I/O buffer, @code{C-c T} is an alternate
704
+ binding.
705
+ @c @xref{Backtrace}.
706
+
707
+ @item C-x C-a <
708
+
709
+ Go up a stack frame. With a numeric argument, go up that many
710
+ stack frames. Same @value{DBG} @code{up} command.
711
+ @xref{Arguments, , Numeric Arguments, Emacs, The @value{Emacs} Manual}.
712
+
713
+ The @value{Emacs} command name is @code{gud-up}. In the corresponding
714
+ I/O buffer, @code{C-c <} is an alternate binding.
715
+
716
+ @item C-x C-a >
717
+
718
+ Go down a stack frame. Same as @value{DBG} @code{down}.
719
+ With a numeric argument, go down that many stack frames.
720
+ @xref{Arguments, , Numeric Arguments, Emacs, The @value{Emacs}
721
+ Manual}.
722
+
723
+ The @value{Emacs} command name is @code{gud-down}. In the
724
+ corresponding I/O buffer, @code{C-c >} is an alternate binding.
725
+
726
+ @item C-x C-a C-t
727
+
728
+ @code{gud-tbreak}
729
+
730
+ @item C-x C-a C-s
731
+
732
+ Step one source line. Same as @value{DBG} @code{step}
733
+ command.
734
+ @c @xref{Step}.
735
+
736
+ With a numeric argument, run that many times.
737
+ @xref{Arguments, , Numeric Arguments, Emacs, The @value{Emacs}
738
+ Manual}.
739
+
740
+ The @value{Emacs} command name is @code{gud-step}. In the
741
+ corresponding I/O buffer, @code{C-x C-a C-s} is an alternate binding.
742
+
743
+ @item C-x C-a C-e
744
+
745
+ @code{gud-statement}
746
+
747
+ @item C-x C-a R
748
+ Restart or run the script. Same as @value{DBG} @code{run} command. The
749
+ @value{Emacs} command name is @code{gud-run}. In the corresponding I/O
750
+ buffer, @code{C-c R} is an alternate binding.
751
+
752
+ @item C-x C-a C-d
753
+ Delete breakpoint. @code{gud-remove}
754
+
755
+ @item C-x C-a C-p
756
+
757
+ @code{gud-print}
758
+
759
+ @item C-x C-a C-n
760
+
761
+ Execute to next source line in this function, skipping all function
762
+ calls. Same as @value{DBG} @code{next} command. With a numeric
763
+ argument, run that many times. @xref{Arguments, , Numeric Arguments,
764
+ Emacs, The @value{Emacs} Manual}.
765
+
766
+ The @value{Emacs} command name is @code{gud-next}. In the
767
+ corresponding I/O buffer, @code{C-x C-a C-n} is an alternate binding.
768
+
769
+ @item C-x C-a f C-f
770
+
771
+ @code{gud-finish}
772
+
773
+ @item C-x C-a C-r
774
+ Continue execution of your script Same as @value{DBG} @code{continue}
775
+ command. The @value{Emacs} command name is @code{gud-cont}. In the
776
+ corresponding I/O buffer, @code{C-x C-a C-r} is an alternate binding.
777
+ @c See @ref{Continue}.
778
+
779
+ @item C-x C-a C-b
780
+
781
+ @code{gud-break}
782
+
783
+ @item C-x C-a a
784
+
785
+ @code{gud-args}
786
+ Shows argument variables (e.g.@: @code{$1}, @code{$2}) of the current
787
+ stack frame. Same as @value{DBG} @code{info args} command. The
788
+ @value{Emacs} command name is @code{gud-args}. In the corresponding
789
+ I/O buffer, @code{C-c a} is an alternate binding which also can be
790
+ used in the source script.
791
+
792
+ @item C-x C-a C-l
793
+ Move to current position in this source window. The @value{Emacs}
794
+ command name is @code{gud-refresh}. In the corresponding I/O buffer,
795
+ @code{C-x C-a C-l} is an alternate binding.
796
+
797
+ @end table
798
+
799
+ @node Emacs Debugger Commands, Emacs Command Index, Debugger Buffers, Top
800
+ @chapter Emacs Debugger Commands
801
+
802
+ @menu
803
+ * Emacs Debugger Common Commands::
804
+ * Emacs Debugger Breakpoint Buffer Commands::
805
+ * Emacs Debugger Stack Buffer Commands::
806
+ * Emacs Debugger Variable Buffer Commands::
807
+ * Emacs Debugger Watch Buffer Commands::
808
+ * Emacs GUD Commands::
809
+ @end menu
810
+
811
+ @node Emacs Debugger Common Commands, Emacs Debugger Breakpoint Buffer Commands, Emacs Debugger Commands, Emacs Debugger Commands
812
+ @section Emacs Debugger Common Commands
813
+
814
+ The commands in this section are used to make a secondary buffer
815
+ visible. If the buffer doesn't exist, nothing is done.
816
+ The way the buffer is made visible is follows the following
817
+ rules tried in order:
818
+
819
+ @enumerate
820
+ @item
821
+ If the buffer doesn't exist, do nothing.
822
+ @item
823
+ If the buffer is already displayed, switch to it.
824
+ @item
825
+ If the current buffer is a
826
+ secondary buffer, bury it replacing with the requested
827
+ buffer.
828
+ @item
829
+ If there is secondary buffer visible, that
830
+ is replaced instead.
831
+ @item
832
+ Just pick a visible buffer to bury and replace.
833
+ @end enumerate
834
+
835
+ The commands are also have key bindings that end in an uppercase
836
+ letter. This letter is given in parenthesis. When in one of the
837
+ secondary buffers, the uppercase letter is bound to the command as well.
838
+
839
+ @table @kbd
840
+
841
+ @item (rdebug-display-breakpoints-buffer) (@kbd{B})
842
+ @findex rdebug-display-breakpoints-buffer (@kbd{B})
843
+ Display the rdebug breakpoints buffer. Bound to: @kbd{C-x C-a B},
844
+ @kbd{<menu-bar> <debugger> <view> <breakpoints>}. Secondary buffers:
845
+ @kbd{O}.
846
+
847
+ @item (rdebug-display-cmd-buffer) (@kbd{C})
848
+ @findex rdebug-display-cmd-buffer (@kbd{C})
849
+ Display the debugger command buffer.
850
+
851
+ Bound to: @kbd{C-x C-a C}, @kbd{<menu-bar> <debugger> <view> <shell>}.
852
+
853
+ @item (rdebug-display-output-buffer) (@kbd{O})
854
+ @findex rdebug-display-output-buffer (@kbd{?})
855
+ Display the debugger output buffer.
856
+
857
+ Bound to: @kbd{C-x C-a O}, @kbd{<menu-bar> <debugger> <view>
858
+ <output>}. Secondary buffers: @kbd{O}.
859
+
860
+ @item (rdebug-display-secondary-window-help-buffer) (@kbd{?})
861
+ @findex rdebug-display-secondary-window-help-buffer (@kbd{?})
862
+
863
+ @item (rdebug-display-stack-buffer) (@kbd{T})
864
+ @findex rdebug-display-stack-buffer (@kbd{T})
865
+ Display the debugger stack buffer. Bound to: @kbd{C-x C-a T},
866
+ @kbd{<menu-bar> <debugger> <view> <stack>}. Secondary buffers: @kbd{T}.
867
+
868
+ @item (rdebug-display-variables-buffer) (@kbd{V})
869
+ @findex rdebug-display-variables-buffer (@kbd{V})
870
+ Display the debugger variables buffer. Bound to: @kbd{C-x C-a V},
871
+ @kbd{<menu-bar> <debugger> <view> <variables>}. Secondary buffers:
872
+ @kbd{V}.
873
+
874
+ @item (rdebug-display-watch-buffer) (@kbd{W})
875
+ @findex rdebug-display-watch-buffer (@kbd{W})
876
+ Display the debugger variables buffer. Bound to: @kbd{C-x C-a W},
877
+ @kbd{<menu-bar> <debugger> <view> <watch>}. Secondary buffers: @kbd{V}.
878
+
879
+ @item (rdebug-display-debugger-window-configuration)
880
+ @findex rdebug-display-debugger-window-configuration
881
+ Display the current layout of windows of the rdebug Ruby debugger.
882
+ @item (rdebug-display-original-window-configuration)
883
+ @findex rdebug-display-original-window-configuration
884
+ Display the layout of windows prior to starting the rdebug Ruby
885
+ debugger. This function is called upon quitting the debugger and
886
+ @var{rdebug-many-windows} is not nil.
887
+ @item (rdebug-goto-entry-n)
888
+ @findex rdebug-goto-entry-n
889
+ Breakpoints, Display expressions and Stack Frames all have
890
+ numbers associated with them which are distinct from line
891
+ numbers. In a secondary buffer, this function is usually bound to
892
+ a numeric key. which will position you at that entry number. To
893
+ go to an entry above 9, just keep entering the number. For
894
+ example, if you press 1 and then 9, you should jump to entry
895
+ 1 (if it exists) and then 19 (if that exists). Entering any
896
+ non-digit will start entry number from the beginning again.
897
+ @item (rdebug-quit) - q
898
+ @findex rdebug-quit (q)
899
+ Kill the debugger process associated with the buffer.
900
+
901
+ When @var{rdebug-many-windows} is active, the original window layout is
902
+ restored.
903
+ @item (rdebug-restore-windows)
904
+ @findex rdebug-restore-windows
905
+ Display the initial ruby debugger window layout.
906
+
907
+ @end table
908
+
909
+
910
+ @node Emacs Debugger Breakpoint Buffer Commands, Emacs Debugger Stack Buffer Commands, Emacs Debugger Common Commands, Emacs Debugger Commands
911
+ @section Emacs Debugger Breakpoint Buffer Commands
912
+
913
+ @table @kbd
914
+ @item (rdebug-goto-breakpoint)
915
+ @findex rdebug-goto-breakpoint
916
+ @item (rdebug-goto-breakpoint-mouse)
917
+ @findex rdebug-goto-breakpoint-mouse
918
+ @item (rdebug-breakpoints-mode)
919
+ @findex rdebug-breakpoints-mode
920
+ Major mode for displaying breakpoints in a secondary window. Uses
921
+ @var{rdebug-breakpoints-mode-map}.
922
+ @end table
923
+
924
+ @node Emacs Debugger Stack Buffer Commands, Emacs Debugger Variable Buffer Commands, Emacs Debugger Breakpoint Buffer Commands, Emacs Debugger Commands
925
+ @section Emacs Debugger Stack Buffer Commands
926
+
927
+ @table @kbd
928
+ @item (rdebug-goto-stack-frame)
929
+ @findex rdebug-goto-stack-frame
930
+ @item (rdebug-frames-mode)
931
+ @findex rdebug-frames-mode
932
+ Major mode for displaying the stack trace. Uses
933
+ @var{rdebug-frames-mode-map}.
934
+ @end table
935
+
936
+ @node Emacs Debugger Variable Buffer Commands, Emacs Debugger Watch Buffer Commands, Emacs Debugger Stack Buffer Commands, Emacs Debugger Commands
937
+ @section Emacs Debugger Variable Buffer Commands
938
+
939
+ @table @kbd
940
+ @item (rdebug-variables-edit)
941
+ @findex rdebug-variables-edit
942
+ @end table
943
+
944
+ @node Emacs Debugger Watch Buffer Commands, Emacs GUD Commands, Emacs Debugger Variable Buffer Commands, Emacs Debugger Commands
945
+ @section Emacs Debugger Watch Buffer Commands
946
+
947
+ @table @kbd
948
+ @item (rdebug-watch-add)
949
+ @findex rdebug-watch-add
950
+ Add a display expression.
951
+ @item (rdebug-watch-delete)
952
+ @findex rdebug-watch-delete
953
+ Delete a display expression.
954
+ @item (rdebug-watch-edit)
955
+ @findex rdebug-watch-edit
956
+ Edit a display expression.
957
+ @item (rdebug-watch-mode)
958
+ @findex rdebug-watch-mode
959
+ Major mode for displaying the display expressions. Uses
960
+ @var{rdebug-watch-mode-map}.
961
+ @end table
962
+
963
+ @node Emacs GUD Commands, , Emacs Debugger Watch Buffer Commands, Emacs Debugger Commands
964
+ @section Emacs Debugger GUD Commands
965
+
966
+ @table @kbd
967
+ @item (comint-copy-old-input)
968
+ @findex comint-copy-old-input
969
+ Insert after prompt old input at point as new input to be edited.
970
+ Calls `comint-get-old-input' to get old input.
971
+ @item (comint-delete-output)
972
+ @findex comint-delete-output
973
+ Delete all output from interpreter since last input.
974
+ Does not delete the prompt.
975
+ @item (gud-break)
976
+ @findex gud-break
977
+ Set a breakpoint on the source line point is on.
978
+ @item (gud-cont) - c
979
+ @findex gud-cont (c)
980
+ Continue execution.
981
+ @item (gud-next) - n
982
+ @findex gud-next (n)
983
+ Step one line, skipping functions. (Step over).
984
+ @item (gud-refresh)
985
+ @findex gud-refresh
986
+ Fix up a possibly garbled display, and redraw the arrow.
987
+ @item (gud-remove)
988
+ @findex gud-remove
989
+ Remove breakpoint at current line.
990
+ @item (gud-step) - s
991
+ @findex gud-step (s)
992
+ Step one statement. (Step into)
993
+ @item (gud-step-plus) - +
994
+ @findex gud-step-plus (+)
995
+ Run @code{step+}---like @code{gud-step} but ensure we go to a new
996
+ line.
997
+ @item (gud-tbreak @var{arg})
998
+ @findex gud-tbreak
999
+ Set temporary breakpoint at current line.
1000
+ @end table
1001
+
1002
+ @node Emacs Command Index, Emacs Function Index, Emacs Debugger Commands, Top
1003
+ @unnumbered Emacs Command Index
1004
+ @printindex pg
1005
+
1006
+ @node Emacs Function Index, Emacs Key Binding Index, Emacs Command Index, Top
1007
+ @unnumbered Emacs Function Index
1008
+ @printindex fn
1009
+
1010
+ @node Emacs Key Binding Index, , Emacs Function Index, Top
1011
+ @unnumbered Key Binding Index
1012
+ @printindex ky
1013
+
1014
+ @tex
1015
+ % I think something like @colophon should be in texinfo. In the
1016
+ % meantime:
1017
+ \long\def\colophon{\hbox to0pt{}\vfill
1018
+ \centerline{The body of this manual is set in}
1019
+ \centerline{\fontname\tenrm,}
1020
+ \centerline{with headings in {\bf\fontname\tenbf}}
1021
+ \centerline{and examples in {\tt\fontname\tentt}.}
1022
+ \centerline{{\it\fontname\tenit\/},}
1023
+ \centerline{{\bf\fontname\tenbf}, and}
1024
+ \centerline{{\sl\fontname\tensl\/}}
1025
+ \centerline{are used for emphasis.}\vfill}
1026
+ \page\colophon
1027
+ % Blame: doc@cygnus.com, 1991.
1028
+ @end tex
1029
+
1030
+ @bye