help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave debugging (emacs)


From: CdeMills
Subject: Re: Octave debugging (emacs)
Date: Wed, 16 Jun 2010 23:58:53 -0700 (PDT)

Hello,
I mostly use an approach where the level of debugging is governed by two
global variables. My scripts usually start with 

global DEBUG TRACE
if !exist("DEBUG", "var"), DEBUG = 0; endif
if !exist("TRACE", "var"), TRACE = 0; endif

then, at problematic spots, I have some code like

if TRACE > 0 then draw some graph of the intermediate values; endif
if DEBUG > 0
  printf('File XXX line YYY: value of variable z is %6.2g\n', z);
  if DEBUG > 1, disp('File XXX line NNN: check for value of MMM ');
keyboard; endif
endif

This way, from the main prompt, I can tailor the function/script behaviour
as needed during the setup phase. Also, constructs like try/catch permit to
spot an error inside a loop without interrupting it at each iteration.

Regards

Pascal
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/Octave-debugging-emacs-tp2257972p2258272.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]