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

learn more… | top users | synonyms

17
votes
2answers
275 views

Where is the old option TraceInternal->True?

Already at least in version 2 (I think), the function Solve calls the function Roots. At that time, I had a rather dirty trick, that still works, to verify this: ...
3
votes
2answers
611 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 ...
2
votes
1answer
79 views

Recursive computation using Piecewise

I am trying to create an array using a series of equations using Piecewise. I am stuck in one of them. I am just putting a simplified version of code as below. I ...
4
votes
1answer
53 views

InstallJava on a parallel kernel while debugging in Wolfram Workbench

Here's my problem. I need to create a link between a client that is a parallel Wolfram kernel and a server through a Java API. I'm using Wolfram Workbench in debugging mode (like most of the time ...
31
votes
1answer
530 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 ...
44
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 ...
13
votes
1answer
849 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 ...
9
votes
2answers
164 views

How to find out where an error occurs?

I got this error when using Mathematica: ...
4
votes
1answer
141 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 ...
7
votes
1answer
120 views

How to debug this failing pattern-matching expression?

NB: this question is primarily about troubleshooting and debugging, and only secondarily about pattern-matching. IOW, I'm far less interested in getting an explanation for the situation described ...
5
votes
3answers
108 views

How can one debug a module more elegant than just with Print?

This question is interesting mainly for beginners, but the answer i wrote to my own question could be also interesting for advanced users. Introduction: While writing huge blocks of code, especially ...
22
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.
15
votes
1answer
605 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
2answers
254 views

Why does having many Print statements slow down my code?

I have a code that I need to debug. I have put a Print[] into it that should give about 10^4 prints for table entries. I know that 10^4 is large, and this exposes ...
6
votes
1answer
103 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 ...
0
votes
0answers
32 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 ...
6
votes
0answers
129 views

Is there a way to update Workbench 2.0 to recognize Mathematica 9, 10 and 10.1 functions?

Is there a way to add newer functions to a configuration file so that Workbench 2.0 is useable for development with 10.1? Also, are there changes that can be made so that Workbench 2.0 can be used to ...
1
vote
1answer
334 views

Usage of Piecewise/RSolve to solve an equation based on condition

I am trying to compute price of call option on a stock using the finite difference method. I have a VBA code for it, and I am trying to find out how I can use Mathematica memoization functions and ...
0
votes
0answers
34 views

Debug package with command line arguments

I'm creating a package that takes as arguments input from the command line using $ScriptCommandLine. What's unclear to me is how to best debug this package. How do others perform these tasks? I ...
3
votes
0answers
50 views

Why does the debugger not stop when a message is generated?

I am on version 10.1. I have enabled the debugger and I have checked the box in front of "Break at Messages" in the Debugger Tools Window. However most the time the debugger does not stop when a ...
2
votes
0answers
75 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 ...
2
votes
0answers
66 views

How to debug an existing notebook in Workbench

I have an existing notebook that I want to debug in workbench. This notebook is a self contained program that does not use any .m files. From what I can tell from the Workbench documentation you ...
4
votes
0answers
67 views

RuntimeTools insight?

Does anyone happen to have some more complete insight into the RuntimeTools package that is used by Debug and Workbench? I ask ...
4
votes
1answer
44 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 ...
7
votes
2answers
110 views

Can Trace[] output during evaluation (and not only after)?

I'm trying to debug a function that goes into an endless loop. I tried to Trace[] some expressions inside the the function, but apparently Trace[] outputs its information only after the expression has ...
0
votes
0answers
81 views

Can I reach a breakpoint when I press a button and call a function?

I have a function and inside it I put a breakpoint on the first instruction in the function. I made a Button which calls the ...
5
votes
0answers
126 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 ...
0
votes
0answers
12 views

Watching variables during Notebook work session [duplicate]

One feature that I have always wanted but could not find out if it was supported and that is to actively watch variables and their values while working in a Notebook session. In fact, there are two ...
0
votes
0answers
13 views

Encountering a Tag times Protected error, but cannot find the source [duplicate]

I am very new to using mathematica, and I have seen these errors frequently. Usually I can find a solution to my issues by stumbling around, but this is my first time defining a function like sp[t_], ...
1
vote
0answers
53 views

Is it possible to pipe the output of EvaluationMonitor to Excel?

I have an EvaluationMonitor setup to capture the points processed by NIntegrate. This is a case where the same function, integrated over the same region in cartesian coordinates yields a dramatically ...
0
votes
0answers
51 views

Path must include /TypeSystemLoader.m?

I have encountered a number of odd issues using the Wolfram Workbench 3.0 Debugger. Whenever I try to step into a Switch[] statement, I get the following error message: "Problem Occurred - Debug ...
1
vote
1answer
122 views

Animated gif form parametric plot

I need to create an animated gif for the following function. ...
2
votes
0answers
83 views

Find where an error occurred in a bunch of command line scripts

I have been using my intuition to solve errors in my Mathematica scripts. But when calculations got more complex and I started getting errors involving code in more participating scripts (a script ...
1
vote
1answer
94 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 ...
2
votes
0answers
110 views

Debuging in Mathematica [duplicate]

Description I have using Mathematica to solve all kinds of problems that encountered in my study. However, the function that I define to solve specific problem is not always right, in other words, it ...
15
votes
2answers
960 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 ...
2
votes
1answer
307 views

See Local Variable at breakpoint within MODULE?

Within the debugger, can we watch local variables within a Module? As the screenshot shows, the ā€œiā€ only display its global value (12) upon a message breakpoint. Is there a way to show its local ...
5
votes
1answer
706 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. ...
5
votes
1answer
370 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
0answers
198 views

Syntax error for optional pattern, but only in debugger

This expression (explained here by Leonid) evaluates fine unless Evaluation->Debugger is enabled: h[x : (_Integer) : 1] := x Syntax::sntxf: "x:" cannot be ...
0
votes
0answers
57 views

What are ways to debug while Mathematica is running? [duplicate]

I would like to know if we can "watch some values" during running time of Mathematica. I remember that C and Pascal compiler ...
9
votes
0answers
91 views

How to capture implicit fails in Plot or Show? [duplicate]

How can I make a construct similar to C++ functions: try{} catch{} I want to use it to avoid showing a lot of errors in the plot area when for example one of the ...
10
votes
1answer
156 views

Is there a way to find out who is importing a package?

After calling some functions, if I look into $ContextPath, I can see that JLink` is in there. Is there a way to find out what ...
1
vote
2answers
461 views

How to debug error triggered by replacement rule?

The second line below produces the errors shown: ...
-2
votes
2answers
247 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 ...
5
votes
1answer
111 views

How can I execute a sequence of statements interactively?

I'm fairly new to Mathematica. Suppose I have the following function: f[x_Integer] := Module[{y, z, r}, y = 5; z = 10; r = x + y + z; r ]; and I ...
3
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 ...
16
votes
1answer
347 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 ...
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 ...