diff doc/interpreter/debug.txi @ 7984:bbaa5d7d0143

Some documentation updates
author David Bateman <dbateman@free.fr>
date Mon, 28 Jul 2008 15:47:40 +0200
parents 6b521b1e3631
children aaccb1362347
line wrap: on
line diff
--- a/doc/interpreter/debug.txi	Sun Jul 27 02:42:57 2008 +0200
+++ b/doc/interpreter/debug.txi	Mon Jul 28 15:47:40 2008 +0200
@@ -114,6 +114,32 @@
 dbclear ("asind", dbstatus ("asind"));
 @end example
 
+A breakpoint can be set in a subfunction. For example if a file contains
+the functions
+
+@example
+function y = func1 (x)
+  y = func2 (x);
+endfunction
+function y = func2 (x)
+  y = x + 1;
+endfunction
+@end example
+
+@noindent
+then a breakpoint can be set at the start of the subfunction directly
+with
+
+@example
+@group
+dbstop (["func1", filemarker(), "func2"])
+@result{} 5
+@end group
+@end example
+
+Note that @code{filemarker} returns a character that marks the
+subfunctions from the file containing them.
+
 Another simple means of setting a breakpoint in an Octave script is the
 use of the @code{keyboard} function.