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

learn more… | top users | synonyms

5
votes
1answer
249 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
1answer
156 views

how to print stack trace when TimeConstrained times out

According to the documentation, TimeConstrained generates an interrupt which interrupts the computation. This interrupt is treated just like an abort, at least in ...
21
votes
1answer
237 views

Why Trace[] shows some internal warnings on a standard Plot command in V9?

For fun, I like to use Trace with option TraceInternal->True to see if I figure how some of the commands work internally. I ...
7
votes
1answer
564 views

How to Debug Missing[NotAvailable] error for Social Media Data

I get a Missing[NotAvailable] error message when trying to access Social Media Data using SocialMediaData["Facebook", "Friends"] ...
19
votes
1answer
764 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 ?
4
votes
1answer
169 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 ...
5
votes
1answer
965 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. ...
3
votes
1answer
237 views

Debugging graphics

All the examples I am seeing on internet are related to normal functions that carry out loops and assignments but I have not seen one example where I can see a graphics based program being debugged. ...
13
votes
3answers
9k 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 ...
7
votes
3answers
171 views

Metaquestion: how to find out why (e.g.) MatchQ[42, _?Function[x, True]] is False?

Suppose you run into a bewildering Mathematica result (which happens to me several times per Mathematica session, even after a 20-year acquaintance), such as, for example: ...
0
votes
1answer
471 views

(N)Solve does not solve equation

I am trying to calculate where a beam hits a mirror. The mirror is described by this curve (two facing spherical mirrors): ...
5
votes
1answer
258 views

Help with Permutations

I am currently trying to generate a list of permutations of length 2 of elements of a list of strings. For example: ...
28
votes
3answers
894 views

Prepend Information to Warning Messages

I have a function running within a Do loop that sometimes issues a warning. I'd like to prepend the warning with the loop ctr so that I can go back and debug that instance later. Basically, I would ...
3
votes
2answers
730 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 ...
20
votes
0answers
626 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
3answers
1k 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, ...
28
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 ...
6
votes
1answer
180 views

MUnit test debug breakpoints in Workbench not working

When I create a breakpoint in Workbench 2 for an MUnit test, and run a debug build, the breakpoints are not breaking execution. The MUnit output is updated like a normal run without breakpoints. Why ...
27
votes
7answers
4k 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.
7
votes
1answer
87 views

How can I get TracePrint to treat certain functions as atomic?

Consider the following example: ...
19
votes
2answers
724 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 ...
14
votes
1answer
1k views

Finding a Specific Line in a Package

In a package I am developing, I accidentally left this line Protect[ uncompleted prior to running the package. Mathematica produced this error message ...
19
votes
2answers
3k 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 ...
52
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 ...
12
votes
1answer
211 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: ...
31
votes
1answer
657 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 ...