diff libinterp/corefcn/debug.cc @ 29674:fc8d0a32d840

Accept 0 as an argument to dbstack for Matlab compatibility. * debug.cc (do_dbstack): Check number of skipped frames < 0 before emitting error. * debug.cc (Fdbstack): Remove incorrectly documented fields in debug stack frame which are no longer returned. Clarify that arguments N and "-completenames" can both appear in any order.
author Rik <rik@octave.org>
date Fri, 14 May 2021 18:31:34 -0700
parents 0181e1e5ec67
children 08104b0629d5
line wrap: on
line diff
--- a/libinterp/corefcn/debug.cc	Fri May 14 18:13:58 2021 -0700
+++ b/libinterp/corefcn/debug.cc	Fri May 14 18:31:34 2021 -0700
@@ -853,7 +853,7 @@
           else
             n = arg.int_value ();
 
-          if (n <= 0)
+          if (n < 0)
             error ("dbstack: N must be a non-negative integer");
         }
 
@@ -952,8 +952,8 @@
 Although accepted, the argument @var{-completenames} is silently ignored.
 Octave always returns absolute filenames.
 
-The arguments @var{n} and @var{-completenames} can be both specified in any
-order.
+The arguments @var{n} and @var{-completenames} can both be specified and may
+appear in any order.
 
 The optional return argument @var{stack} is a struct array with the
 following fields:
@@ -971,11 +971,6 @@
 @item column
 The column number of the line where the breakpoint begins.
 
-@item scope
-Undocumented.
-
-@item context
-Undocumented.
 @end table
 
 The return argument @var{idx} specifies which element of the @var{stack}