Why I can't add breakpoints while paused in debugger inside a timer callback function

1 回表示 (過去 30 日間)
If I've a function "test":
function test(callerObj,callerEvent)
pause(0.001);
justToDoSomething = 1;
end
and I create a timer to call it:
ctimer = timer('TimerFcn', @test,...
'Period', 5,...
'ExecutionMode', 'fixedSpacing',...
'BusyMode', 'drop');
start(ctimer)
If I set a breakpoint in "test" the execution pauses correctly, but then if try to
  • remove current breakpoint
  • add more breakpoints
by clicking near to line number in the editor window, those changes does not appear in the editor until the function does not return. Breakpoints additions/removals appear in the editor only at next execution of the timer callback. The only way I have to set or remove breakpoint immediately is by using "dbstop" and "dbclear" commands: in this case changes take effects immediately without having to wait for next function call. But this is very unconfortable.
This happens with Matlab 2016b but not with version 2012a.
What can I do to be able to add/remove brakpoints (with mouse clicks) while paused in debugger?

採用された回答

Roberto Olmi
Roberto Olmi 2017 年 3 月 22 日
I made a support request to Mathworks and they told me that this is a known bug. It seems that it has been introduced since version 2016a.
Here is what they wrote to me:
They are working on fixing it for a future release but we have no time line for when it will be fixed. Your workaround of setting breakpoint explicitly in the command window is the best we can offer for now.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by