When does DBSTOP not apply to callbacks?
Show older comments
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?
Accepted Answer
More Answers (0)
Categories
Find more on Debugging and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!