MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Debugger

  • To: mathgroup at smc.vnet.net
  • Subject: [mg91875] Re: Debugger
  • From: David Bailey <dave at Remove_Thisdbailey.co.uk>
  • Date: Thu, 11 Sep 2008 06:15:19 -0400 (EDT)
  • References: <g9qiep$4bk$1@smc.vnet.net> <g9r4c4$cf8$1@smc.vnet.net>

magma wrote:
> Welcome to the club!
> I gave up on debugger a long time ago.
> WRI has developed a (supposedly) good functionality, but they did not
> bother to document it well.
> Why should we, the users, waste time trying to figure out how it
> works?
> You will find some explanations (by WRI people) on this group about
> Debug, but not much.
> I suggest you use ON[] and Off[] and sprinkle the code you are testing
> with Print commands to see the value of variables.
> This way you clearly see the behind-the-scenes actions of your code.
> Trace gives you the same information, but the output is not so well
> formatted and is difficult to read.
> Workbench is supposed to be the Integrated development environment
> (IDE) for Mathematica, but well-known mathgroupers have told me that - at the
> moment - it is more an headhache, rather than an Aspirin.
> 
I too gave up on the debugger a long time ago for all the reasons 
mentioned so far! The amusing thing is that years ago, I wrote a little 
debugger based on TraceScan, and described it at a  developer 
conference. Because it had to execute many Mathematica steps for every 
step of the program, it was unfortunately rather slow, but it had more 
features than the built-in offering, and was used by quite a few people. 
Among other extra features:

1)  It recognised that certain 'steps' should be skipped. For example, 
rather than stopping on a complicated CompoundExpression construct, it 
skipped that step and went to the first part of the CE. This made it 
much more practical to use.

2)  It kept a step count, which it would print out in various 
circumstances. The idea was, that if you performed one debug session and 
got too far, you could note the step count, and debug the program again 
up to, say count-100. Again, this made it feasible to debug far more 
complicated examples.

3)   There were various tools to let the user hide certain parts of the 
code from the debugger. For example, you could specify that the debugger 
should not step into code that was not in Global` context.

I hope WRI make the notebook debugger into a real feature for the next 
release. I don't really want to use the Workbench just to get a better 
version of the debugger that is meant to be present in the notebook 
interface!

David Bailey
http://www.dbaileyconsultancy.co.uk


  • Prev by Date: Alternating sums of large numbers
  • Next by Date: Simulate a finite-state markov process
  • Previous by thread: Re: Debugger
  • Next by thread: Re: Debugger