1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
<html lang="en">
<head>
<title>Debug Mode - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Debugging.html#Debugging" title="Debugging">
<link rel="prev" href="Breakpoints.html#Breakpoints" title="Breakpoints">
<link rel="next" href="Call-Stack.html#Call-Stack" title="Call Stack">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Debug-Mode"></a>
Next: <a rel="next" accesskey="n" href="Call-Stack.html#Call-Stack">Call Stack</a>,
Previous: <a rel="previous" accesskey="p" href="Breakpoints.html#Breakpoints">Breakpoints</a>,
Up: <a rel="up" accesskey="u" href="Debugging.html#Debugging">Debugging</a>
<hr>
</div>
<h3 class="section">13.4 Debug Mode</h3>
<p>There are two additional support functions that allow the user to
interrogate where in the execution of a script Octave entered the debug
mode and to print the code in the script surrounding the point where
Octave entered debug mode.
<!-- debug.cc -->
<p><a name="doc_002ddbwhere"></a>
<div class="defun">
— Loadable Function: <b>dbwhere</b> ()<var><a name="index-dbwhere-698"></a></var><br>
<blockquote><p>Show where we are in the code
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002ddbclear.html#doc_002ddbclear">dbclear</a>, <a href="doc_002ddbstatus.html#doc_002ddbstatus">dbstatus</a>, <a href="doc_002ddbstop.html#doc_002ddbstop">dbstop</a>.
</p></blockquote></div>
<!-- debug.cc -->
<p><a name="doc_002ddbtype"></a>
<div class="defun">
— Loadable Function: <b>dbtype</b> ()<var><a name="index-dbtype-699"></a></var><br>
<blockquote><p>List script file with line numbers.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002ddbclear.html#doc_002ddbclear">dbclear</a>, <a href="doc_002ddbstatus.html#doc_002ddbstatus">dbstatus</a>, <a href="doc_002ddbstop.html#doc_002ddbstop">dbstop</a>.
</p></blockquote></div>
<p>You may also use <code>isdebugmode</code> to determine whether the debugger is
currently active.
<!-- debug.cc -->
<p><a name="doc_002disdebugmode"></a>
<div class="defun">
— Command: <b>isdebugmode</b> ()<var><a name="index-isdebugmode-700"></a></var><br>
<blockquote><p>Return true if debug mode is on, otherwise false.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002ddbstack.html#doc_002ddbstack">dbstack</a>, <a href="doc_002ddbclear.html#doc_002ddbclear">dbclear</a>, <a href="doc_002ddbstop.html#doc_002ddbstop">dbstop</a>, <a href="doc_002ddbstatus.html#doc_002ddbstatus">dbstatus</a>.
</p></blockquote></div>
<p>Debug mode also allows single line stepping through a function using
the commands <code>dbstep</code>.
<!-- debug.cc -->
<p><a name="doc_002ddbstep"></a>
<div class="defun">
— Command: <b>dbstep</b><var> n<a name="index-dbstep-701"></a></var><br>
— Command: <b>dbstep</b><var> in<a name="index-dbstep-702"></a></var><br>
— Command: <b>dbstep</b><var> out<a name="index-dbstep-703"></a></var><br>
<blockquote><p>In debugging mode, execute the next <var>n</var> lines of code. If <var>n</var> is
omitted execute the next line of code. If the next line of code is itself
defined in terms of an m-file remain in the existing function.
<p>Using <code>dbstep in</code> will cause execution of the next line to step into
any m-files defined on the next line. Using <code>dbstep out</code> with cause
execution to continue until the current function returns.
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->
<p class="noindent"><strong>See also:</strong> <a href="doc_002ddbcont.html#doc_002ddbcont">dbcont</a>, <a href="doc_002ddbquit.html#doc_002ddbquit">dbquit</a>.
</p></blockquote></div>
</body></html>
|