Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Debugging Mathematica Code (Mathematica 7)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg95665] Re: Debugging Mathematica Code (Mathematica 7)
  • From: "m.g." <mg at michaelgamer.de>
  • Date: Sat, 24 Jan 2009 06:19:34 -0500 (EST)
  • References: <gl1okn$dpb$1@smc.vnet.net> <gl4a7r$gi7$1@smc.vnet.net>

On 22 Jan., 12:57, Jens-Peer Kuska <ku... at informatik.uni-leipzig.de>
wrote:
> Hi,
>
> I have never had such a problem but you should open the
> debugger controls always before you send a
> code piece to the kernel.
>
> I really suggest the Wolfram Workbench debugger !
> It works more like one would expect it
> if one use a compiled language like C++.
>
> Have a look athttp://www.wolfram.com/broadcast/screencasts/workbench/debu=
gging/
>
> BTW We have stopped to make bugs in
> in the programs we wrote, because it turns
> out not to be useful at all ;-)
>
> Regards
>    Jens
>
> m.g. wrote:
> > On 20 Jan., 12:57, Jens-Peer Kuska <ku... at informatik.uni-leipzig.de>
> > wrote:
> >> Hi,
>
> >> the Wolfram Workbench has an excellent debugger
> >> and there are situations where you need it.
>
> >> BTW: What is so complicated ?
> >> - go to the Evaluation Menu and open the Debugger
> >> - now type into a notebook
>
> >> foo[0] = 1
> >> foo[n_Integer] /; n > 0 := n*foo[n - 1]
>
> >> use the mouse and mark in
> >> foo[n_Integer] /; n > 0 := n*foo[n - 1]
> >> the "foo[n - 1]" expression.
>
> >> Go to the debugger window and use
> >> "Break at selection" Now the "foo[n - 1]"
> >> has a red frame.
>
> >> Finally go to the notebook window and enter
>
> >> foo[4]
>
> >> as an input. And ... ta ta ta
> >> The Stack window show the stack
> >> and all is as it should. Now press "Continue"
> >> ind the debugger menu to see the next
> >> step in the recursion ...
>
> >> Regards
> >>    Jens
>
> >> magma wrote:
> >>> No, there isn't a decent explanation.
> >>> You can check prior posts by me and others on debugging, but this is
> >>> the conclusion, basically.
> >>> Anyway, the general feeling among knowledgeable users is that you do
> >>> not really need a debugger.
> >>> These users just sprinkle print statements here and there to see
> >>> intermediate results.
> >>> I additionally also use On[] and Off[] which help me see clearly the
> >>> code flow.
> >>> You don't really need much more.
> >>> hth
> >>> On Jan 19, 12:36 pm, "m.g." <m... at michaelgamer.de> wrote:
> >>>> Hello Experts,
> >>>>   I made my fist steps with the Mathematica (so called) debugger a=
nd=
> >  st=
> >>> umbled
> >>>> immediately. Is there anywhrere a documentation of this tool that is
> >>>> worth it's name (a criterion which the Mathematica 7 documentatin on=
 d=
> > ebu=
> >>> g
> >>>> surely fails). I've tried a lot, but I'm still at the stage "trial a=
n
> >>>> error".
> >>>> Greetings
> >>>> Mike
>
> > Hi Jens,
>
> >  thanks for the fast reply. I did exactly this what you described,
> > but: Sometimes it works, sometimes not. I used "step" and "step in",
> > to see waht the code does, but it seems that frequent swithceing
> > breakpoint on and of "irritates" the debugger and it's behavior gets a
> > bit, say, probabilisitc, and therefore I was looking for documentation
> > (for it could be my fault in missusing the tool without knowing there
> > is a missuse). So I returned to the insertion of Print-Statements.
>
> > But I would like more to have a debugger which works well - it's more
> > easy and comfortable like the print-statement workaround.
>
> > Greetings
>
> > Mike

Thanks Jens for the information, I=B4m going to have a closer look at
workbench (which up to now I do not own or use - but it seems to be a
good tool). But first... I=B4m now going to a one week vacation (Toscana
in winter could be good, too :-) )

Greetings

Mike


  • Prev by Date: Re: Dynamic, UpdateInterval and global variable
  • Next by Date: Re: Re: 0^0 = 1?
  • Previous by thread: Re: Debugging Mathematica Code (Mathematica 7)
  • Next by thread: Re: ntdvmm error