Why does the Editor/Debugger not stop on breakpoints set in my MATLAB file function that is called from a script?
1 回表示 (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2010 年 5 月 19 日
コメント済み: Walter Roberson
2016 年 6 月 19 日
I have breakpoints set before I run my code. However, when I run the code, the debugger does not stop at the breakpoints, and the breakpoints are removed.
Also, I notice that after I stop my script, the breakpoints are cleared. So, if something is clearing the breakpoints, why is the editor not reflecting this clearing immediately?
採用された回答
MathWorks Support Team
2010 年 5 月 19 日
Check for a CLEAR ALL commands anywhere before the breakpoint. As documented in the help for the CLEAR function:
clear all
clears all of the debug breakpoints.
You can resolve the breakpoint issue by commenting out all lines of code that refer to any incarnation of CLEAR that encompasses CLEAR ALL. There are a few CLEAR commands that encompass CLEAR ALL such as CLEAR JAVA. See the following URL for more information on the CLEAR command:
<http://www.mathworks.com/access/helpdesk/help/techdoc/ref/clear.html>
Concerning the delayed update of the editor window to reflect that breakpoints have been cleared, it is not possible to have an immediate update of the editor when breakpoints are cleared in the editor.
2 件のコメント
Walter Roberson
2016 年 6 月 19 日
clear all should only ever be used when you want to effectively reset your MATLAB session without bothering to quit MATLAB and restart it. When you are doing that, it does not make sense to keep breakpoints. You should be looking at clearvars instead of clear all
If you really need to keep breakpoints but want all files unloaded from memory and so on, then assign the output of dbstatus() to a variable, save that variable, clear all, load the file, pass the loaded variable to dbstop . You could create a script for this purpose. But again, chances are high you are overusing clear all
clear all should have been named illudium q-36 because it should be thought of as blowing your session to smithereens.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Language Support についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!