| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
<html> |
| 3 |
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ --> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6 |
<title>Source Level Debugging in Emacs (GCL SI Manual)</title> |
| 7 |
|
| 8 |
<meta name="description" content="Source Level Debugging in Emacs (GCL SI Manual)"> |
| 9 |
<meta name="keywords" content="Source Level Debugging in Emacs (GCL SI Manual)"> |
| 10 |
<meta name="resource-type" content="document"> |
| 11 |
<meta name="distribution" content="global"> |
| 12 |
<meta name="Generator" content="makeinfo"> |
| 13 |
<link href="index.html" rel="start" title="Top"> |
| 14 |
<link href="Function-and-Variable-Index.html" rel="index" title="Function and Variable Index"> |
| 15 |
<link href="Function-and-Variable-Index.html#SEC_Contents" rel="contents" title="Table of Contents"> |
| 16 |
<link href="Debugging.html" rel="up" title="Debugging"> |
| 17 |
<link href="Low-Level-Debug-Functions.html" rel="next" title="Low Level Debug Functions"> |
| 18 |
<link href="Debugging.html" rel="prev" title="Debugging"> |
| 19 |
<style type="text/css"> |
| 20 |
<!-- |
| 21 |
a.summary-letter {text-decoration: none} |
| 22 |
blockquote.indentedblock {margin-right: 0em} |
| 23 |
div.display {margin-left: 3.2em} |
| 24 |
div.example {margin-left: 3.2em} |
| 25 |
div.lisp {margin-left: 3.2em} |
| 26 |
kbd {font-style: oblique} |
| 27 |
pre.display {font-family: inherit} |
| 28 |
pre.format {font-family: inherit} |
| 29 |
pre.menu-comment {font-family: serif} |
| 30 |
pre.menu-preformatted {font-family: serif} |
| 31 |
span.nolinebreak {white-space: nowrap} |
| 32 |
span.roman {font-family: initial; font-weight: normal} |
| 33 |
span.sansserif {font-family: sans-serif; font-weight: normal} |
| 34 |
ul.no-bullet {list-style: none} |
| 35 |
--> |
| 36 |
</style> |
| 37 |
|
| 38 |
|
| 39 |
</head> |
| 40 |
|
| 41 |
<body lang="en"> |
| 42 |
<span id="Source-Level-Debugging-in-Emacs"></span><div class="header"> |
| 43 |
<p> |
| 44 |
Next: <a href="Low-Level-Debug-Functions.html" accesskey="n" rel="next">Low Level Debug Functions</a>, Previous: <a href="Debugging.html" accesskey="p" rel="prev">Debugging</a>, Up: <a href="Debugging.html" accesskey="u" rel="up">Debugging</a> [<a href="Function-and-Variable-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> |
| 45 |
</div> |
| 46 |
<hr> |
| 47 |
<span id="Source-Level-Debugging-in-Emacs-1"></span><h3 class="section">18.1 Source Level Debugging in Emacs</h3> |
| 48 |
|
| 49 |
<p>In emacs load (load "dbl.el") from the gcl/doc directory. |
| 50 |
[ It also requires gcl.el from that directory. Your system |
| 51 |
administrator should do make in the doc directory, so that |
| 52 |
these files are copied to the standard location.] |
| 53 |
</p> |
| 54 |
<p>OVERVIEW: |
| 55 |
</p> |
| 56 |
<p>Lisp files loaded with si::nload will have source line information about |
| 57 |
them recorded. Break points may be set, and functions stepped. Source code |
| 58 |
will be automatically displayed in the other window, with a little arrow beside |
| 59 |
the current line. The backtrace (command :bt) will show line information and |
| 60 |
you will get automatic display of the source as you move up and down the stack. |
| 61 |
</p> |
| 62 |
<p>FUNCTIONS: |
| 63 |
break points which have been set. |
| 64 |
si::nload (file) |
| 65 |
load a lisp file collecting source line information. |
| 66 |
</p> |
| 67 |
<p>si::break-function (function &optional line absolute) |
| 68 |
set up a breakpoint for FUNCTION at LINE relative to start or ABSOLUTE |
| 69 |
</p> |
| 70 |
<p>EMACS COMMANDS: |
| 71 |
M-x dbl makes a dbl buffer, suitable for running an inferior gcl. |
| 72 |
It has special keybindings for stepping and viewing sources. You may |
| 73 |
start your favorite gcl program in the dbl shell buffer. |
| 74 |
</p> |
| 75 |
<p>Inferior Dbl Mode: |
| 76 |
Major mode for interacting with an inferior Dbl process. |
| 77 |
The following commands are available: |
| 78 |
</p> |
| 79 |
<p>C-c l dbl-find-line |
| 80 |
</p> |
| 81 |
<p>ESC d dbl-:down |
| 82 |
ESC u dbl-:up |
| 83 |
ESC c dbl-:r |
| 84 |
ESC n dbl-:next |
| 85 |
ESC i dbl-:step |
| 86 |
ESC s dbl-:step |
| 87 |
</p> |
| 88 |
|
| 89 |
<p>M-x dbl-display-frame displays in the other window |
| 90 |
the last line referred to in the dbl buffer. |
| 91 |
</p> |
| 92 |
<p>ESC i and ESC n in the dbl window, |
| 93 |
call dbl to step and next and then update the other window |
| 94 |
with the current file and position. |
| 95 |
</p> |
| 96 |
<p>If you are in a source file, you may select a point to break |
| 97 |
at, by doing C-x SPC. |
| 98 |
</p> |
| 99 |
<p>Commands: |
| 100 |
Many commands are inherited from shell mode. |
| 101 |
Additionally we have: |
| 102 |
</p> |
| 103 |
<p>M-x dbl-display-frame display frames file in other window |
| 104 |
ESC i advance one line in program |
| 105 |
ESC n advance one line in program (skip over calls). |
| 106 |
M-x send-dbl-command used for special printing of an arg at the current point. |
| 107 |
C-x SPACE sets break point at current line. |
| 108 |
</p> |
| 109 |
<p>—————————- |
| 110 |
</p> |
| 111 |
<p>When visiting a lisp buffer (if gcl.el is loaded in your emacs) the command |
| 112 |
c-m-x evaluates the current defun into the process running in the other window. |
| 113 |
Line information will be kept. This line information allows you to set break |
| 114 |
points at a given line (by typing C-x \space on the line in the source file |
| 115 |
where you want the break to occur. Once stopped within a function you may |
| 116 |
single step with M-s. This moves one line at a time in the source code, |
| 117 |
displaying a little arrow beside your current position. M-c is like M-s, |
| 118 |
except that function invocations are skipped over, rather than entered into. |
| 119 |
M-c continues execution. |
| 120 |
</p> |
| 121 |
<p>Keywords typed at top level, in the debug loop have |
| 122 |
a special meaning: |
| 123 |
</p><ul class="no-bullet"> |
| 124 |
<li> :delete [n1] [n2] .. – delete all break points or just n1,n2 |
| 125 |
</li><li> :disable [n1] [n2] .. – disable all break points or just n1,n2 |
| 126 |
</li><li> :enable [n1] [n2] .. – enable all break points or just n1,n2 |
| 127 |
</li><li> :info [:bkpt] –print information about |
| 128 |
</li><li> :break [fun] [line] – break at the current location, or if |
| 129 |
fun is supplied in fun. Break at the beginning unless a |
| 130 |
line offset from the beginning of fun is supplied. |
| 131 |
</li><li> :fr [n] go to frame n When in frame n, if the frame is interpreted, |
| 132 |
typing the name of locals, will print their values. If it is compiled |
| 133 |
you must use (si::loc j) to print ‘locj’. Autodisplay of the source |
| 134 |
will take place if it is interpreted and the line can be determined. |
| 135 |
</li><li> :up [n] go up n frames from the current frame. |
| 136 |
</li><li> :down [n] go down n frames |
| 137 |
</li><li> :bt [n] back trace starting at the current frame and going to top level |
| 138 |
If n is specified show only n frames. |
| 139 |
</li><li> :r If stopped in a function resume. If at top level in the dbl |
| 140 |
loop, exit and resume an outer loop. |
| 141 |
</li><li> :q quit the computation back to top level dbl loop. |
| 142 |
</li><li> :step step to the next line with line information |
| 143 |
</li><li> :next step to the next line with line information skipping over function |
| 144 |
invocations. |
| 145 |
|
| 146 |
</li></ul> |
| 147 |
<p>Files: debug.lsp dbl.el gcl.el |
| 148 |
</p> |
| 149 |
<hr> |
| 150 |
<div class="header"> |
| 151 |
<p> |
| 152 |
Next: <a href="Low-Level-Debug-Functions.html" accesskey="n" rel="next">Low Level Debug Functions</a>, Previous: <a href="Debugging.html" accesskey="p" rel="prev">Debugging</a>, Up: <a href="Debugging.html" accesskey="u" rel="up">Debugging</a> [<a href="Function-and-Variable-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> |
| 153 |
</div> |
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
</body> |
| 158 |
</html> |