Debugger quits working in App Designer right after StartupFcn completes.

2 views (last 30 days)
After a week of struggling with the Serial callback not working I undated to Update 8 of 2023b and that finally resolved. (I think)
MATLAB Version: 23.2.0.2599560 (R2023b) Update 8
Now (and before too but I had other problem to deal with) my program runs with AppDesigner but the debugger stops after StartupFcn completes. I can step to here:
% Construct app
function app = MouseOdor4
runningApp = getRunningApp(app);
"blah blah blah
if nargout == 0
clear app
end
end % last line where debugger is still running
The next step the debugger stops (my app is still running) and the editor pops up this with cursor as classdef but no marker for what line we are on.
classdef AppManagementService < handle
% APPMANAGEMENTSERVICE Singleton object to manage running apps
Any clues anyone? I'd like to get this project done!
  3 Comments
Harsh
Harsh on 29 Jul 2024
Hi @Alessandro Livi, is this function being called in the startup function or being used as a callback by any UI component?
Divyam
Divyam on 6 Aug 2024
Hi @Alessandro Livi, share your StartupFcn and ML App. Are you using 'dbstop'/ 'uiwait' functions or referring to any other class in the code as using them might be causing your debugger to pause.

Sign in to comment.

Answers (1)

Divyam
Divyam on 8 Aug 2024
Hi @Alessandro Livi, upon reaching the end of the callback function 'MouseOdor4' the debugger is out of the App Designer debug call stack. Since the app is no longer being debugged, your debug buttons will disappear from the App Designer.
The 'AppManagementService' code is the internal code upon which the App Designer is built on. During further execution, the debugger steps through the internal app designer code just like any debugger for an interpretted language. To skip/quit reviewing the internal files, either utilize the debugging controls in the MATLAB editor or use the Command Window commands like 'dbquit'. For more information on how to use 'dbquit', you can refer the following documentation: https://www.mathworks.com/help/matlab/ref/dbquit.html
In the 'runApp' function the debugger could stop due to two cases:
  1. The "evalin" function has stepped through an infinite loop. To resolve this issue, check the expression which the function is executing.
  2. The debugger has moved to evaluate the command in the "appFullFileName" file and the control for the debugger has been passed to the MATLAB editor. The debug controls of MATLAB Editor can be used to control the debugger in this case.

Categories

Find more on MATLAB in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!