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

learn more… | top users | synonyms

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: ...
3
votes
0answers
43 views

Issues with methods of FindMinimum

I'm trying to use the function FindMinimum for portfolio optimization in stead of NMinimize, since the latter is a lot slower. Also because the variance function of my portfolio is convex, locally ...
10
votes
1answer
161 views

Memory leak with NDSolve

Edit The technical team confirms the memory leak in NDSolve and has forwarded an incident report to the developers. This is not the first time the question in ...
3
votes
0answers
116 views

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

Bug introduced in 10.0.2 and fixed in 10.2.0 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 ...
16
votes
4answers
2k 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 ...
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 ...
10
votes
2answers
109 views

Is it possible to attach a debugger to a dynamically linked library on the supported OS?

Recently, I discovered that LibraryLink technique is a very useful tool to improve the performance of function. Firstly, I need to use LibraryLink template to write C/C++ program. Then compiling the ...
4
votes
4answers
138 views

Automatically add debug contents to a program

Sometimes I'll use Print[1] or Print[n] to debug in a long loop, but it's really a boring job to add these sentence by sentence ...
11
votes
3answers
569 views

How to debug the C code for LibraryLink?

Recently, I use the C to rewrite a Mathematica function NonzeroBasis[], please see here for fully descriptions. Here, ...
8
votes
0answers
45 views

How to setup logging levels?

I was wondering what tools exist out there for doing logging in Mathematica? The Echo functions is nice, but I'd like to set various severity levels and other ...
1
vote
0answers
47 views

Is it possible improve the code scanning beyond what SyntaxQ does? [closed]

Please, consider this package (* ::Package:: *) BeginPackage["HelloWorld`"]; a::usage="A"; b::usage="B"; Begin["`Private`"]; a=1; b= End[]; EndPackage[]; ...
2
votes
0answers
60 views
2
votes
1answer
58 views

How to determine where a variable got assigned a value?

I have a Mathematica notebook that includes some dynamic structures (with Manipulate). Sometimes, I discover that x has been ...
19
votes
1answer
761 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 ?
0
votes
0answers
66 views

How to determine side-effects in parallel computation? Possibly associated to Kernel not closing reliably

I have written a bunch of code to simulate some measurements. To speed things up, I intended to obtain the measurement values via a ParallelTable. However, it turns ...
14
votes
1answer
448 views

How to report a bug in Mathematica

I found two bugs in Mathematica (10.3 and 10.1) and I need to report it. Is there any tools to do that or section on Wolfram website?
0
votes
0answers
22 views

Why doesn't replace and evaluate? [duplicate]

The small example shows ReplaceAll doesn't replace and Evaluate doesn't evaluate. ...
0
votes
0answers
38 views

Inspecting the evaluation stack on computation abort [duplicate]

It happens often that a computation starts consuming more memory or time when it encounters an expression with elements in the input that are in some unexpected form. Is there some way to abort ...
7
votes
1answer
426 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 ...
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.
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 ...
1
vote
1answer
76 views

How can get rid of this window? [closed]

Actually, I don't know what happened and the bellow window appeared in Mathematica v10 and I can't get rid of this, Although I went to Evaluation Quit Kernel Local, it temporarily disappears but again ...
19
votes
2answers
335 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
729 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 ...
3
votes
1answer
96 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
65 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
656 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 ...
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 ...
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 ...
12
votes
2answers
322 views

How to find out where an error occurs?

I got this error when using Mathematica: ...
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 ...
7
votes
1answer
144 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
159 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 ...
4
votes
2answers
306 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 ...
0
votes
0answers
36 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
261 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 ...
2
votes
1answer
349 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 ...
3
votes
0answers
66 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
131 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 can'...
6
votes
0answers
108 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
84 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
155 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
90 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
141 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
16 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
57 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 ...
1
vote
1answer
153 views

Animated gif form parametric plot

I need to create an animated gif for the following function. ...
2
votes
0answers
115 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
99 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
120 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 ...