When does DBSTOP not apply to callbacks?

I find (in R2013b, R2014b) that when I make the debugger active with
>> dbstop if error
that errors in certain callback functions fail to trigger debug mode. In particular, when I run the test() mfunction below and place a datatip in the figure it generates, the datatip text shows "Error in custom datatip string function".
function test
X=rand(100);
imagesc(X);
hdt = datacursormode(gcf);
set(hdt,'UpdateFcn',@tipcallback);
figure(gcf);
datacursormode on
function output_txt = tipcallback(obj,event_obj)
output_txt=whatever; %<--Debug mode should trigger here
I do expect an error to occur at the line indicated in tipcallback() because a non-existent variable "whatever" is referenced there. However, because I have used DBSTOP, I expect to get the K>> prompt at the indicated line. Yet, debug mode is never triggered. Is it due to some special behavior of callback functions? If so, why do I see this problem only in the datacursormode's 'UpdateFcn' callback?

 Respuesta aceptada

Sean de Wolski
Sean de Wolski el 12 de Dic. de 2014

2 votos

Does dbstop if caught error trigger it? It's likely there's a try/catch catching the original exception and thus not throwing one to be stopped on. dbstop if caught error will catch this too.

Más respuestas (0)

Categorías

Más información sobre Debugging and Analysis en Centro de ayuda y File Exchange.

Preguntada:

el 12 de Dic. de 2014

Comentada:

el 12 de Dic. de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by