How do you set a breakpoint on multiple lines at once?
6 次查看(过去 30 天)
显示 更早的评论
I have a long code, and the error handling options are not respected most likely because the code I am using is part of a software package. Breakpoints are respected but the code is around 700 lines long and I don't want to have to set a breakpoint manually for each line everytime I restart matlab.
Yes I know its not efficient, but the code is a black box, I have no control over the inner workings, and this is the only way I can debug the process.
0 个评论
回答(1 个)
Steven Lord
2021-3-15
Breakpoints are respected but the code is around 700 lines long and I don't want to have to set a breakpoint manually for each line everytime I restart matlab.
Why do you need to set a breakpoint manually for each line? I would set a breakpoint on the first line then step through the code from there.
If you need to restore the breakpoints, call dbstatus to create a struct array with information about the location of the breakpoints and pass that struct array into dbstop to restore those breakpoints.
If somewhere in the "black box" code you're running or in your code, if you're calling clear all then that would clear the debugging state. Try removing that and see if the error breakpoints functionality does what you need.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Debugging and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!