4
$\begingroup$

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 message is generated.

Example

Let us create the following function for testing. Because this definition contains a message and the debugger behaves strangely when you use it to define a message, let us define it with the debugger disabled.

debugTest::testMsg = "stop it!";
debugTest[] :=
 (
  global = 0;
  While[
   True,
   global++;
   1[[1]];
   Message[debugTest::testMsg]
   ]
  )

Now with the debugger enabled, as well as the option to break at messages, when I evaluate the following

Dynamic@global
debugTest[]

the counter global just keeps running. It stops for none of the messages that are generated.

An example where it kind of works is this

(Message[debugTest3::testMsg]; global = 0;)

However, after the debugger stops, I am unable to prevent that global=0 is evaluated.

Considerations

The behaviour is somewhat similar in Mathematica 9.0.1. There, the debugger does actually stop evaluation when the message is generated in the for loop and the most essential part of the functionality works. However, the Abort button does not seem to really abort evaluation.

I also had some trouble with getting the debugger to stop at breakpoints in this version in some specific scenarios. I realise the debugger can be a bit tricky to use and many people don't take it seriously, but for me it had quite some value.

Question: Why does the debugger not stop when a message is generated, is this a bug?


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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.