Questions about debugging techniques, using the built-in debugger, and/or the Wolfram Workbench debugger.

learn more… | top users | synonyms

25
votes
2answers
2k views

Debugging memory leaks

I've written my incredibly complex, incredibly elegant analysis function, that works great on small test data. But when I run it on my real (bigger) data set it keeps running out of memory. It turns ...
42
votes
2answers
2k views

Mathematica Debuggability

One of the things that I really dislike about Mathematica is its lack of debuggability compared to many other programming languages. Some of the problems arises from the functional nature of ...
21
votes
7answers
3k views

Wolfram Workbench - Mathematica Development Alternatives

Are there any alternatives (IDE or other workflow) to Wolfram Workbench for development and debugging? Elaboration: An open source alternative.
18
votes
2answers
2k views

Debugging Mathematica Code

In various integrated development environments, such as Microsoft Visual Studio, there is an integrated debugger where you can step through code sections, examine the state of variables and figure out ...
19
votes
2answers
671 views

Is it possible to Print expressions in reverse order?

Let's say I'm debugging a program step by step and want to Print some expressions (using ShowIt, for example). Is there a way to output the result of ...
2
votes
1answer
5k views

How do I identify the source of a “Tag times protected” error?

I have some code that looks like Table[ a = 1; b = {2, 3} c = i;, {i, 2} ] which gives an error: Set::write: Tag Times in c {2,3} is ...
15
votes
1answer
590 views

A debug utility to print or extract intermediate data from a program

Is there a way to print variables using their names, or to extract the corresponding information for later analysis ?
16
votes
1answer
339 views

How does the built-in debugger decide what to highlight?

How does the built-in debugger decide which definition to highlight in the notebook when Break on messages" is enabled? Here's an example to illustrate what I mean. First, enable the debugger ...
3
votes
1answer
40 views

Issue with the debug tools window [duplicate]

I have an issue with the debug tools window. It appears on its own periodically. I have turned it off in the Evaluation menu, and have gone to "Debugger Controls" and deselected "Show Debugger Tools ...
28
votes
1answer
487 views

which is better, using Assert[] or manual checks on arguments and other computations?

I never used Asserts in Mathematica, but trying to see what advantage they have over just argument check and additional definitions of the function to capture unwanted input. For example, which one ...
15
votes
2answers
894 views

Debugging with Breakpoints

re: Version 9. I typically write concise code and make a real effort to refactor. As such debugging has tended to take care of itself. Recently, I've needed to assemble applications of more ...
11
votes
1answer
193 views

Inspecting non-variable state from a breakpoint in Workbench

Suppose I'm stopped at a breakpoint in Workbench, say at one of the y = ... lines in: ...
3
votes
2answers
581 views

Unexpected result of summation

I wrote a small module that gives me an incorrect output-set. It should be a single number! I don't understand what went wrong. This is the form of summation used: $$\frac{1}{2} (b-a) \sum_{i=1}^n ...
5
votes
0answers
124 views

Is there a package or canonical way for writing test harnesses in Mathematica?

I've written a complicated function foo.1 I'd now like to simplify this function's code, and later enhance it with more features. With each change, however, I'd ...
16
votes
0answers
504 views

How can I trace a functional expression's evaluation visually?

Ok, so the goal is to visualize the execution of this expression foo /@ {3 + 1, bar /@ {1 + 2, {4 + 7}}} in the following fashion using nested rectangles with ...
5
votes
1answer
691 views

Catching and debugging numerical errors in compiled functions

I have a compiled function (that was created using the second method of this question). Basically it's using a compiled closure. The problem is that for some parameter values it does not evaluate. ...
2
votes
0answers
72 views

Does anyone have a debugger that works in version 10.+?

The debugger from mma version 10.0 to 10.1.0 is broken for me. I have Windows 8.1 64-bit. When I step through a function using the debugger then the function is run several times. This problem didn't ...
5
votes
1answer
209 views

How to find the name of the current function

I would like to know the name of the current function from within that function. For example, consider the following code ...
5
votes
3answers
977 views

Solution for equation system with piece-wise defined functions

As I could swear this worked just yesterday, I am probably just doing something stupid here and I am sorry to bother you :) I am trying to find the point where a curve crosses a line. In this case, ...
6
votes
1answer
87 views

Debugging a $RecursionLimit error?

I sometimes encounter bugs that involve a recursion limit. It's often very hard to find the origin of the problem. Would there be a way to copy the stack somewhere and abort the evaluation in order ...
5
votes
1answer
367 views

What is missing in this Mathematica Journal Article?

So I had been looking to solve a little tiling problem and Google turned up this Mathematica Journal Article and I noticed the code was both incomplete and incorrect, so... My Question is, What is ...
4
votes
1answer
129 views

Dealing with errors and resuming the code after one

How can I write my Mathematica code so that it resumes at a specific place if any Message is displayed during the execution of an expression? For example, in Visual ...
1
vote
1answer
93 views

How to know at which point of a calculation I am while using Table

If I use a code of this type: Table[foo[i], {i, 0, 10}] Mathematica won't output anything until it is done: is it possible to know at which point of the ...
0
votes
0answers
31 views

How to close the debugger window [duplicate]

So this thing just popped out of nowhere X.x ... I tried getting rid of it yesterday following suggestions in this post and I could've sworn it went away. But today I opened my laptop and the damn ...
-2
votes
2answers
243 views

Mathematica not assigning variable correctly

So I have been fiddling with this the last hour and I just can't get it to work. I have 3 matrices of the same size which contain nothing but 0's in a list, I also have 3 matrices of the same size ...