annotate scripts/miscellaneous/debug.m @ 7817:31fb919ba0c0

Add the debug function
author David Bateman <dbateman@free.fr>
date Sun, 25 May 2008 16:32:30 +0200
parents
children 1bf0ce0930be
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7817
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
1 ## Copyright (C) 2008 David Bateman
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
2 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
3 ## This file is part of Octave.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
4 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
8 ## your option) any later version.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
9 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
13 ## General Public License for more details.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
14 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
18
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
19 ## -*- texinfo -*-
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
20 ## @deftypefn {Function File} {} debug ()
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
21 ## Summary of the debugging commands. The debugging commands that are
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
22 ## available in Octave are
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
23 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
24 ## @table @code
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
25 ## @item keyboard
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
26 ## Force entry into debug mode.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
27 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
28 ## @item dbstop
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
29 ## Add a breakpoint.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
30 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
31 ## @item dbclear
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
32 ## Remove a breakpoint.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
33 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
34 ## @item dbstatus
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
35 ## List all breakpoints.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
36 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
37 ## @item dbcont
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
38 ## Continue execution from the debug prompt.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
39 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
40 ## @item dbstack
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
41 ## Print a backtrace of the execution stack.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
42 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
43 ## @item dbstep
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
44 ## Execute one or more lines and re-enter debug mode
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
45 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
46 ## @item dbtype
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
47 ## List the function where execution is currently stopped, enumerating
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
48 ## the lines.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
49 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
50 ## @item dbup
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
51 ## The workspace up the execution stack.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
52 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
53 ## @item dbdown
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
54 ## The workspace down the execution stack.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
55 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
56 ## @item dbquit
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
57 ## Quit debugging mode and return to the main prompt.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
58 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
59 ## @item debug_on_error
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
60 ## Flag whether to enter debug mode in case Octave encounters an error.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
61 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
62 ## @item debug_on_warning
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
63 ## Flag whether to enter debug mode in case Octave encounters a warning.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
64 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
65 ## @item debug_on_interrupt
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
66 ## Flag whether to enter debug mode in case Octave encounters an interupt.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
67 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
68 ## @end table
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
69 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
70 ## @noindent
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
71 ## when Octave encounters a breakpoint or other reason to enter debug
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
72 ## mode, the prompt changes to @code{"debug>"}. The workspace of the function
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
73 ## where the breakpoint was encountered becomes available and any Octave
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
74 ## command that works within that workspace may be executed.
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
75 ##
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
76 ## @seealso{dbstop, dbclear, dbstatus, dbcont, dbstack, dbstep, dbtype,
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
77 ## dbup, dbdown, dbquit, debug_on_error, debug_on_warning,
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
78 ## debug_on_interrupt}
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
79 ## @end deftypefn
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
80
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
81 function debug ()
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
82 help ("debug");
31fb919ba0c0 Add the debug function
David Bateman <dbateman@free.fr>
parents:
diff changeset
83 endfunction