# HG changeset patch # User David Bateman # Date 1211725950 -7200 # Node ID 31fb919ba0c08df58a6c8e9008ee730d6deef4c1 # Parent ddecf2eb1910b5070e1e74c90a4dddbb50a6c2a3 Add the debug function diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,5 +1,8 @@ 2008-06-02 David Bateman + * miscellaneous/debug.m: New file.. + * Makefile.in (SOURCES): Add it to the list. + * general/interp1q.m: Remove spaces between functions and args in []. Fix test code to actually test interp1q. diff --git a/scripts/miscellaneous/Makefile.in b/scripts/miscellaneous/Makefile.in --- a/scripts/miscellaneous/Makefile.in +++ b/scripts/miscellaneous/Makefile.in @@ -34,7 +34,7 @@ INSTALL_DATA = @INSTALL_DATA@ SOURCES = ans.m bincoeff.m bug_report.m bunzip2.m cast.m comma.m \ - compare_versions.m computer.m copyfile.m \ + compare_versions.m computer.m copyfile.m debug.m \ delete.m dir.m doc.m dos.m dump_prefs.m edit.m \ fileattrib.m fileparts.m flops.m fullfile.m getfield.m gunzip.m gzip.m \ info.m inputname.m ismac.m ispc.m isunix.m license.m list_primes.m ls.m \ diff --git a/scripts/miscellaneous/debug.m b/scripts/miscellaneous/debug.m new file mode 100644 --- /dev/null +++ b/scripts/miscellaneous/debug.m @@ -0,0 +1,83 @@ +## Copyright (C) 2008 David Bateman +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## -*- texinfo -*- +## @deftypefn {Function File} {} debug () +## Summary of the debugging commands. The debugging commands that are +## available in Octave are +## +## @table @code +## @item keyboard +## Force entry into debug mode. +## +## @item dbstop +## Add a breakpoint. +## +## @item dbclear +## Remove a breakpoint. +## +## @item dbstatus +## List all breakpoints. +## +## @item dbcont +## Continue execution from the debug prompt. +## +## @item dbstack +## Print a backtrace of the execution stack. +## +## @item dbstep +## Execute one or more lines and re-enter debug mode +## +## @item dbtype +## List the function where execution is currently stopped, enumerating +## the lines. +## +## @item dbup +## The workspace up the execution stack. +## +## @item dbdown +## The workspace down the execution stack. +## +## @item dbquit +## Quit debugging mode and return to the main prompt. +## +## @item debug_on_error +## Flag whether to enter debug mode in case Octave encounters an error. +## +## @item debug_on_warning +## Flag whether to enter debug mode in case Octave encounters a warning. +## +## @item debug_on_interrupt +## Flag whether to enter debug mode in case Octave encounters an interupt. +## +## @end table +## +## @noindent +## when Octave encounters a breakpoint or other reason to enter debug +## mode, the prompt changes to @code{"debug>"}. The workspace of the function +## where the breakpoint was encountered becomes available and any Octave +## command that works within that workspace may be executed. +## +## @seealso{dbstop, dbclear, dbstatus, dbcont, dbstack, dbstep, dbtype, +## dbup, dbdown, dbquit, debug_on_error, debug_on_warning, +## debug_on_interrupt} +## @end deftypefn + +function debug () + help ("debug"); +endfunction