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 CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by