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

1 visualización (últimos 30 días)
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?

Respuesta aceptada

Roberto Olmi
Roberto Olmi el 22 de Mzo. de 2017
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.

Más respuestas (0)

Categorías

Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by