diff libinterp/corefcn/debug.cc @ 20617:ba2b07c13913

use new string_value method to handle value extraction errors * __dispatch__.cc, balance.cc, colloc.cc, conv2.cc, data.cc, debug.cc, graphics.cc, input.cc, matrix_type.cc, oct-hist.cc, schur.cc, spparms.cc, symtab.cc, sysdep.cc, toplev.cc, utils.cc: Use new string_value method.
author John W. Eaton <jwe@octave.org>
date Fri, 09 Oct 2015 10:06:39 -0400
parents b10432a40432
children
line wrap: on
line diff
--- a/libinterp/corefcn/debug.cc	Thu Oct 08 19:00:51 2015 -0400
+++ b/libinterp/corefcn/debug.cc	Fri Oct 09 10:06:39 2015 -0400
@@ -1417,38 +1417,33 @@
         print_usage ();
       else if (nargin == 1)
         {
-          if (args(0).is_string ())
+          std::string arg = args(0).string_value ("dbstep: input argument must be a string");
+
+          if (arg == "in")
             {
-              std::string arg = args(0).string_value ();
+              Vdebugging = false;
 
-              if (arg == "in")
-                {
-                  Vdebugging = false;
+              tree_evaluator::dbstep_flag = -1;
+            }
+          else if (arg == "out")
+            {
+              Vdebugging = false;
 
-                  tree_evaluator::dbstep_flag = -1;
-                }
-              else if (arg == "out")
+              tree_evaluator::dbstep_flag = -2;
+            }
+          else
+            {
+              int n = atoi (arg.c_str ());
+
+              if (n > 0)
                 {
                   Vdebugging = false;
 
-                  tree_evaluator::dbstep_flag = -2;
+                  tree_evaluator::dbstep_flag = n;
                 }
               else
-                {
-                  int n = atoi (arg.c_str ());
-
-                  if (n > 0)
-                    {
-                      Vdebugging = false;
-
-                      tree_evaluator::dbstep_flag = n;
-                    }
-                  else
-                    error ("dbstep: invalid argument");
-                }
+                error ("dbstep: invalid argument");
             }
-          else
-            error ("dbstep: input argument must be a string");
         }
       else
         {