Feature request: Breakpoint stop on errors in non Mathworks code
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I like to use the "stop on errors" function. This allows me to run and test my stuff, and whenever some error occurs, I have instantly access to inspect variables and figuring out what went wrong.
But whenever my code calls functions written by Mathworks, I get a more or less deep breakpoint into code that I did not write and do not care about. Also, my editor fills up with irrelevant files.
Would it be possible to break execution at the latest "user contributed file" (i.e. trace the call-stack backwards until such a file is found) while displaying the error message in the Command window?
Also, if this setting could be persistent from Matlab session to session, it would be greatly appreciated. Thank you.
-k
2 Kommentare
Walter Roberson
am 7 Jan. 2016
dbstop on error automatically opens the deepest .m code that it can if you are running the MATLAB Desktop (which is most people.) This can be a nuisance.
Antworten (4)
Ilham Hardy
am 7 Jan. 2016
As far as I can remember, you can trace the stack based on the scary red text on matlab command window (when error took place).
You can click the underlined part of the text on the "user contributed file", to focus on the specific line that caused the error.
0 Kommentare
Walter Roberson
am 7 Jan. 2016
At the moment about all you can do is to go into Preferences -> Editor/Debugger and turn off "Automatically open files when MATLAB reaches a breakpoint".
I know this is not what you are asking for.
0 Kommentare
Image Analyst
am 8 Jan. 2016
On the Editor tab/tool ribbon, when it stops, you should see a "Function call stack" drop down list. You can drop that down, then find the first function you recognize (the one you wrote) and select it to go there. Then quit debugging and set a break point there. Next time it will stop there.
1 Kommentar
Knut
am 8 Jan. 2016
Bearbeitet: Knut
am 8 Jan. 2016
1 Kommentar
Walter Roberson
am 8 Jan. 2016
This is why you would turn off automatically opening the files. You would go to the console and dbstack or dbup until you found the routine you wanted, without having those other files opened.
Not as convenient as what you are asking for, but this is what is available at the moment.
Siehe auch
Kategorien
Mehr zu Debugging and Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!