# HG changeset patch # User John W. Eaton # Date 1347935878 14400 # Node ID 2b8d9eac2c2ec8533d7423fdf67c0c506d01dcf9 # Parent 66e17621f99a132b0c3c1d3fce1a8d8c52723742 provide debug functions * debug.h, debug.cc (debug_continue, debug_step, debug_quit): New functions. diff --git a/libinterp/interpfcn/debug.cc b/libinterp/interpfcn/debug.cc --- a/libinterp/interpfcn/debug.cc +++ b/libinterp/interpfcn/debug.cc @@ -1201,6 +1201,17 @@ DEFALIAS (dbnext, dbstep); +void +debug_step (const std::string& what) +{ + octave_value_list args; + + if (! what.empty ()) + args(0) = what; + + Fdbstep (args); +} + DEFUN (dbcont, args, , "-*- texinfo -*-\n\ @deftypefn {Command} {} dbcont\n\ @@ -1225,6 +1236,12 @@ return octave_value_list (); } +void +debug_continue (void) +{ + Fdbcont (); +} + DEFUN (dbquit, args, , "-*- texinfo -*-\n\ @deftypefn {Command} {} dbquit\n\ @@ -1252,6 +1269,12 @@ return octave_value_list (); } +void +debug_quit (void) +{ + Fdbquit (); +} + DEFUN (isdebugmode, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isdebugmode ()\n\ diff --git a/libinterp/interpfcn/debug.h b/libinterp/interpfcn/debug.h --- a/libinterp/interpfcn/debug.h +++ b/libinterp/interpfcn/debug.h @@ -129,6 +129,12 @@ bool do_have_breakpoints (void) { return (! bp_set.empty ()); } }; -std::string get_file_line (const std::string& fname, size_t line); +extern std::string get_file_line (const std::string& fname, size_t line); + +extern void OCTINTERP_API debug_continue (void); + +extern void OCTINTERP_API debug_step (const std::string& what = std::string ()); + +extern void OCTINTERP_API debug_quit (void); #endif