Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

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 (Evaluation -> Debugger), then define a function that issues a message:

f::boo:="Boo!!!";
f[]:=Module[{a,b,c,d},
  a=1;
  b=a;
  Message[f::boo];
  c=b;
  d=c;
  a+b+c+d
]

When running f[], evaluation will pause on the message and the point where the break occurred will be highlighted:

Now let's re-assign its own DownValues to f, and re-run it. Now this second definition will be highlighted, but not the original one.

The question: How does the debugger know what to highlight and can we influence this somehow? I would like the definition printed by this spelunking toolthis spelunking tool to be highlighted, if possible.

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 (Evaluation -> Debugger), then define a function that issues a message:

f::boo:="Boo!!!";
f[]:=Module[{a,b,c,d},
  a=1;
  b=a;
  Message[f::boo];
  c=b;
  d=c;
  a+b+c+d
]

When running f[], evaluation will pause on the message and the point where the break occurred will be highlighted:

Now let's re-assign its own DownValues to f, and re-run it. Now this second definition will be highlighted, but not the original one.

The question: How does the debugger know what to highlight and can we influence this somehow? I would like the definition printed by this spelunking tool to be highlighted, if possible.

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 (Evaluation -> Debugger), then define a function that issues a message:

f::boo:="Boo!!!";
f[]:=Module[{a,b,c,d},
  a=1;
  b=a;
  Message[f::boo];
  c=b;
  d=c;
  a+b+c+d
]

When running f[], evaluation will pause on the message and the point where the break occurred will be highlighted:

Now let's re-assign its own DownValues to f, and re-run it. Now this second definition will be highlighted, but not the original one.

The question: How does the debugger know what to highlight and can we influence this somehow? I would like the definition printed by this spelunking tool to be highlighted, if possible.

Tweeted twitter.com/#!/StackMma/status/309023606212542464
Source Link
Szabolcs
  • 236.5k
  • 31
  • 641
  • 1.3k

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 (Evaluation -> Debugger), then define a function that issues a message:

f::boo:="Boo!!!";
f[]:=Module[{a,b,c,d},
  a=1;
  b=a;
  Message[f::boo];
  c=b;
  d=c;
  a+b+c+d
]

When running f[], evaluation will pause on the message and the point where the break occurred will be highlighted:

Now let's re-assign its own DownValues to f, and re-run it. Now this second definition will be highlighted, but not the original one.

The question: How does the debugger know what to highlight and can we influence this somehow? I would like the definition printed by this spelunking tool to be highlighted, if possible.