How can I get a cross-platform dbstop statement where a file separator is needed?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I need to insert a breakpoint into a class method at the beginning of a specific while loop. The position of this loop is subject to change over time, so I've put it in a function that I can reference. The class method is in its own file within a class folder that starts with '@'.
I can set the breakpoint on my Linux system with dbstop in @myClass/myFun>mainLoop, but this won't work on a Windows system where the command has to be dbstop in @myClass\myFun>mainLoop. I can reference a line number and get away without using the class prefix (e.g. dbstop in myFun.m at 30) but can't do the same with the function name (dbstop in myFun.m at mainLoop or dbstop in myFun at mainLoop).
I also tried putting this in an eval statement where the file separator was inserted into the command at run time, but eval interprets the file separator as an operator and gives me an error saying it's an invalid use of an operator.
0 commentaires
Réponse acceptée
Jan
le 21 Sep 2021
Modifié(e) : Jan
le 21 Sep 2021
Do I understand correctly that you want to run
dbstop in @myClass/myFun>mainLoop
in Linux and under Windows:
dbstop in @myClass\myFun>mainLoop
? Then:
dbstop(fullfile('@myClass', 'myFun>mainLoop'))
% Or:
dbstop(['@myClass', filesep, 'myFun>mainLoop'])
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Debugging and Analysis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!