Message Boards Message Boards

9
|
10093 Views
|
2 Replies
|
12 Total Likes
View groups...
Share
Share this post:

Wolfram Debugger: how does it work?

Posted 10 years ago
**Update: still bugged in V10.1.0**

**Update: still bugged in V10.0.2**

After visit this wolfram site page about Debugger I tryed to give a second change to it. The page says:

Mathematica includes a powerful integrated source-level debugger that allows immediate inspection and control of Mathematica programs. Mathematica's symbolic architecture--combined with its notebook document paradigm--makes possible a unique level of flexibility in analyzing and validating programs, shortening the cycle for application development.

The above marketing assertion appears to has a big disconnection with reality. Well, as far as I know, as you can see in ex01ex02 and ex03, the users experience on debugger are a terrible one. 

Unfortunatelly, Mathematica docs on Debugger are as simple as that:



With no practical example on how to use it.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I tried this toy case. Let's see how we find errors on that, executing with Debugger activated:
f[n_]:=Module[{l},
l=Range@10;
l[[n]]="X";
l
]
Table[f@i,{i,1,20}]



it stops at error message, OK until now... Now let's try to abort it, and stop evaluate the rest of the expression, using Abort button:


As you can see, the button does not work, and we continue to get the next errors, because expression does not stop to evaluate. The Abort button works just like Finish button.
For bigger codes, I just can't stop after an error (Abort Menu do not work either), and have to wait a lot of error streams. The only solution I know is to quit the Kernel!
This is just an example, buttons like "Run to Selection"  and options like WatchPoints inside show Breakpoints window do not work either.

I'm doing something wrong?
There is some "Missing Guide into Debugger" page??
I believe Wolfram Language deserves more attention into this aspect.
POSTED BY: Rodrigo Murta
2 Replies
Posted 8 years ago

I found that at least in this case if you press the Abort button twice, the expression will stop evaluating. I'm on v9.0.1.

BTW I believe I've figured out the usage of the debugger, and just write an answer here: http://mathematica.stackexchange.com/a/119916/1871

POSTED BY: xzczd  
To solve the Abort Button problem, @Rojo from stack exchange suggest the use of:
ExitDialog@Unevaluated@Abort[]
I defined a function into my pack, to make it short:
myAbort[]:=ExitDialog@Unevaluated@Abort[]
and worked nicely.
My tks to @Rojo
POSTED BY: Rodrigo Murta
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract