changeset 16771:d8a719ccd464

doc: Improve documentation for command debugger. * doc/interpreter/debug.txi: Correct line numbers in examples. * libinterp/interpfcn/debug.cc(dbstop, dbclear): Add new calling forms to docstring to clarify behavior.
author Rik <rik@octave.org>
date Tue, 18 Jun 2013 17:58:00 -0700
parents 2b86cb4e172b
children 7eff3032d144
files doc/interpreter/debug.txi libinterp/interpfcn/debug.cc
diffstat 2 files changed, 16 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/debug.txi	Tue Jun 18 11:10:57 2013 -0700
+++ b/doc/interpreter/debug.txi	Tue Jun 18 17:58:00 2013 -0700
@@ -91,32 +91,33 @@
 @example
 @group
 dbstop ("asind", 1)
-@result{} 28
+@result{} 29
 @end group
 @end example
 
 @noindent
-Note that the return value of @code{27} means that the breakpoint was
-effectively set to line 27.  The status of breakpoints in a function can
+Note that the return value of @code{29} means that the breakpoint was
+effectively set to line 29.  The status of breakpoints in a function can
 be queried with the @code{dbstatus} function.
 
 @DOCSTRING(dbstatus)
 
 @noindent
-Taking the above as an example, @code{dbstatus ("asind")} should return
-28.  The breakpoints can then be cleared with the @code{dbclear} function
+Reusing the previous example, @code{dbstatus ("asind")} will return
+29.  The breakpoints listed can then be cleared with the @code{dbclear}
+function.
 
 @DOCSTRING(dbclear)
 
 @noindent
-These functions can be used to clear all the breakpoints in a function.  For
-example:
+These functions can be used together to clear all the breakpoints in a
+particular function.  For example:
 
 @example
 dbclear ("asind", dbstatus ("asind"));
 @end example
 
-A breakpoint can be set in a subfunction.  For example if a file contains
+A breakpoint may also be set in a subfunction.  For example, if a file contains
 the functions
 
 @example
@@ -151,7 +152,7 @@
 
 @noindent
 The @code{keyboard} function is typically placed in a script at the
-point where the user desires that the execution is stopped.  It
+point where the user desires that the execution be stopped.  It
 automatically sets the running script into the debug mode.
 
 @node Debug Mode
@@ -172,7 +173,7 @@
 @DOCSTRING(isdebugmode)
 
 Debug mode also allows single line stepping through a function using
-the commands @code{dbstep}.
+the command @code{dbstep}.
 
 @DOCSTRING(dbstep)
 
--- a/libinterp/interpfcn/debug.cc	Tue Jun 18 11:10:57 2013 -0700
+++ b/libinterp/interpfcn/debug.cc	Tue Jun 18 17:58:00 2013 -0700
@@ -609,7 +609,8 @@
 DEFUN (dbstop, args, ,
   "-*- texinfo -*-\n\
 @deftypefn  {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\")\n\
-@deftypefnx {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\", @var{line}, @dots{})\n\
+@deftypefnx {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\", @var{line})\n\
+@deftypefnx {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\", @var{line1}, @var{line2}, @dots{})\n\
 Set a breakpoint in function @var{func}.\n\
 \n\
 Arguments are\n\
@@ -654,6 +655,7 @@
   "-*- texinfo -*-\n\
 @deftypefn  {Built-in Function} {} dbclear (\"@var{func}\")\n\
 @deftypefnx {Built-in Function} {} dbclear (\"@var{func}\", @var{line}, @dots{})\n\
+@deftypefnx {Built-in Function} {} dbclear (@var{line}, @dots{})\n\
 Delete a breakpoint in the function @var{func}.\n\
 \n\
 Arguments are\n\
@@ -661,7 +663,8 @@
 @table @var\n\
 @item func\n\
 Function name as a string variable.  When already in debug\n\
-mode this should be left out and only the line should be given.\n\
+mode this argument should be omitted and only the line number should be\n\
+given.\n\
 \n\
 @item line\n\
 Line number from which to remove a breakpoint.  Multiple\n\