summaryrefslogtreecommitdiff
path: root/devdocs/elisp/source-breakpoints.html
blob: 64b894a2fb4180d9f4781c55f76d4017317dc66c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
 <h4 class="subsubsection">Source Breakpoints</h4>   <p>All breakpoints in a definition are forgotten each time you reinstrument it. If you wish to make a breakpoint that won’t be forgotten, you can write a <em>source breakpoint</em>, which is simply a call to the function <code>edebug</code> in your source code. You can, of course, make such a call conditional. For example, in the <code>fac</code> function, you can insert the first line as shown below, to stop when the argument reaches zero: </p> <div class="example"> <pre class="example">(defun fac (n)
  (if (= n 0) (edebug))
  (if (&lt; 0 n)
      (* n (fac (1- n)))
    1))
</pre>
</div> <p>When the <code>fac</code> definition is instrumented and the function is called, the call to <code>edebug</code> acts as a breakpoint. Depending on the execution mode, Edebug stops or pauses there. </p> <p>If no instrumented code is being executed when <code>edebug</code> is called, that function calls <code>debug</code>. </p><div class="_attribution">
  <p class="_attribution-p">
    Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
    <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Source-Breakpoints.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Source-Breakpoints.html</a>
  </p>
</div>