Mercurial > octave-nkf
comparison 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 |
comparison
equal
deleted
inserted
replaced
20616:fd0efcdb3718 | 20617:ba2b07c13913 |
---|---|
1415 | 1415 |
1416 if (nargin > 1) | 1416 if (nargin > 1) |
1417 print_usage (); | 1417 print_usage (); |
1418 else if (nargin == 1) | 1418 else if (nargin == 1) |
1419 { | 1419 { |
1420 if (args(0).is_string ()) | 1420 std::string arg = args(0).string_value ("dbstep: input argument must be a string"); |
1421 { | 1421 |
1422 std::string arg = args(0).string_value (); | 1422 if (arg == "in") |
1423 | 1423 { |
1424 if (arg == "in") | 1424 Vdebugging = false; |
1425 | |
1426 tree_evaluator::dbstep_flag = -1; | |
1427 } | |
1428 else if (arg == "out") | |
1429 { | |
1430 Vdebugging = false; | |
1431 | |
1432 tree_evaluator::dbstep_flag = -2; | |
1433 } | |
1434 else | |
1435 { | |
1436 int n = atoi (arg.c_str ()); | |
1437 | |
1438 if (n > 0) | |
1425 { | 1439 { |
1426 Vdebugging = false; | 1440 Vdebugging = false; |
1427 | 1441 |
1428 tree_evaluator::dbstep_flag = -1; | 1442 tree_evaluator::dbstep_flag = n; |
1429 } | |
1430 else if (arg == "out") | |
1431 { | |
1432 Vdebugging = false; | |
1433 | |
1434 tree_evaluator::dbstep_flag = -2; | |
1435 } | 1443 } |
1436 else | 1444 else |
1437 { | 1445 error ("dbstep: invalid argument"); |
1438 int n = atoi (arg.c_str ()); | 1446 } |
1439 | |
1440 if (n > 0) | |
1441 { | |
1442 Vdebugging = false; | |
1443 | |
1444 tree_evaluator::dbstep_flag = n; | |
1445 } | |
1446 else | |
1447 error ("dbstep: invalid argument"); | |
1448 } | |
1449 } | |
1450 else | |
1451 error ("dbstep: input argument must be a string"); | |
1452 } | 1447 } |
1453 else | 1448 else |
1454 { | 1449 { |
1455 Vdebugging = false; | 1450 Vdebugging = false; |
1456 | 1451 |