Why does the Editor/Debugger not stop on breakpoints set in my MATLAB file function that is called from a script?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 19 Mag 2010
Commentato: Walter Roberson
il 19 Giu 2016
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?
Risposta accettata
MathWorks Support Team
il 19 Mag 2010
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 Commenti
Walter Roberson
il 19 Giu 2016
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.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Language Support in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!