# HG changeset patch # User jwe # Date 981181418 0 # Node ID e44ffad3d06cd3d7b9ad73aa0f059c6a742b0835 # Parent 0486ba746bc18b8ecb3bd9a1e82a736055100c09 [project @ 2001-02-03 06:23:38 by jwe] diff -r 0486ba746bc1 -r e44ffad3d06c src/ChangeLog --- a/src/ChangeLog Sat Feb 03 06:15:59 2001 +0000 +++ b/src/ChangeLog Sat Feb 03 06:23:38 2001 +0000 @@ -1,3 +1,16 @@ +2001-02-02 John W. Eaton + + * input.cc (get_user_input): Handle dbg_cont and dbg_step here. + * debug.cc (Fdbg_cont): Delete. + * pt-bp.h (MAYBE_DO_BREAKPOINT): Check tree::break_next here. + * pt.h (tree::break_next): New static member. + * pt.cc: Initialize it. + + * parse.h (feval (const octave_value_list&, int)): + Set default value for nargout. + (feval (const std::string&, const octave_value_list&, int)): + Set default values for args and nargout. + 2001-02-01 Ben Sapp * DLD-FUNCTIONS/debug.cc: New file. diff -r 0486ba746bc1 -r e44ffad3d06c src/input.cc --- a/src/input.cc Sat Feb 03 06:15:59 2001 +0000 +++ b/src/input.cc Sat Feb 03 06:23:38 2001 +0000 @@ -58,6 +58,7 @@ #include "pager.h" #include "parse.h" #include "pathlen.h" +#include "pt.h" #include "pt-const.h" #include "sighandlers.h" #include "symtab.h" @@ -540,14 +541,23 @@ } } - if (debug - && (match_sans_spaces ("exit", input_buf) + if (debug) + { + if (match_sans_spaces ("exit", input_buf) || match_sans_spaces ("quit", input_buf) - || match_sans_spaces ("return", input_buf))) - { - return retval; + || match_sans_spaces ("return", input_buf) + || match_sans_spaces ("dbg_cont", input_buf)) + { + return retval; + } + else if (match_sans_spaces ("dbg_step", input_buf)) + { + tree::break_next = true; + return retval; + } } - else if (read_as_string) + + if (read_as_string) { // XXX FIXME XXX -- fix gnu_readline and octave_gets instead! if (input_buf.length () == 1 && input_buf[0] == '\n') diff -r 0486ba746bc1 -r e44ffad3d06c src/parse.h --- a/src/parse.h Sat Feb 03 06:15:59 2001 +0000 +++ b/src/parse.h Sat Feb 03 06:23:38 2001 +0000 @@ -38,8 +38,8 @@ class tree_identifier; class symbol_record; class symbol_table; -class octave_value; -class octave_value_list; + +#include "oct-obj.h" // Temporary symbol table pointer used to cope with bogus function syntax. extern symbol_table *tmp_local_sym_tab; @@ -90,10 +90,12 @@ load_fcn_from_file (symbol_record *sym_rec, bool exec_script); extern octave_value_list -feval (const std::string& name, const octave_value_list& args, int nargout); +feval (const std::string& name, + const octave_value_list& args = octave_value_list (), + int nargout = 0); extern octave_value_list -feval (const octave_value_list& args, int nargout); +feval (const octave_value_list& args, int nargout = 0); extern octave_value_list eval_string (const std::string&, bool silent, int& parse_status, int hargout); diff -r 0486ba746bc1 -r e44ffad3d06c src/pt-bp.h --- a/src/pt-bp.h Sat Feb 03 06:15:59 2001 +0000 +++ b/src/pt-bp.h Sat Feb 03 06:23:38 2001 +0000 @@ -166,8 +166,9 @@ #define MAYBE_DO_BREAKPOINT \ do \ { \ - if (is_breakpoint ()) \ + if (tree::break_next || is_breakpoint ()) \ { \ + tree::break_next = false; \ octave_stdout << "line: " << line () << endl; \ do_keyboard (); \ } \ diff -r 0486ba746bc1 -r e44ffad3d06c src/pt.cc --- a/src/pt.cc Sat Feb 03 06:15:59 2001 +0000 +++ b/src/pt.cc Sat Feb 03 06:23:38 2001 +0000 @@ -35,6 +35,9 @@ #include "pt.h" #include "pt-pr-code.h" +// If true, stop executing at the next possible point. +bool tree::break_next = false; + // Hide the details of the string buffer so that we are less likely to // create a memory leak. diff -r 0486ba746bc1 -r e44ffad3d06c src/pt.h --- a/src/pt.h Sat Feb 03 06:15:59 2001 +0000 +++ b/src/pt.h Sat Feb 03 06:23:38 2001 +0000 @@ -67,6 +67,9 @@ virtual bool is_breakpoint (void) const { return break_point; } + // If true, stop executing at the next possible point. + static bool break_next; + private: // The input line and column where we found the text that was