How do I restore breakpoints in MATLAB files that were defined inside a package directory with MATLAB 7.6 (R2008a)?

1 view (last 30 days)
I am trying to restore breakpoints that were saved to a structure using DBSTATUS like so:
s = dbstatus;
However, when a breakpoint was set in an ordinary MATLAB file that was created inside a package directory (i.e. +mypack), the breakpoint is not restored and I do not receive an error message when I execute the following line:
dbstop(s);
The same issue occurs with MATLAB files in the package directory that contains a class definition. However, in addition to breakpoints not being restored, I also get the following error message: ERROR: ??? Error using ==> dbstop Cannot find function "myclass".
where "./+mypack/myclass.m" contains the class definition.
Another similar situation occurs when class methods are stored in @-directories. When trying to restore a breakpoint in a file ./@myClass/myMethod.m, the breakpoint is not restored and I get the following error message: ERROR: ??? Error using ==> dbstop Cannot find function "myClass.myMethod".

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Dec 2015
In order to restore the breakpoints that were set in MATLAB files that were organized into a package or methods in @-directories, the DBSTATUS structure must be created with the '-completenames' switch like so:
dbstatus('-completenames');
This results in the "name" field of the resulting structure to contain the full path information as well.
Note that in MATLAB R2015b and later releases, this error does no longer occur.

More Answers (0)

Categories

Find more on Debugging and Analysis in Help Center and File Exchange

Tags

Products


Release

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!