MATLAB-extension-for-vscode
MATLAB-extension-for-vscode copied to clipboard
Debugging only working when startDebuggerAutomatically is true
Describe the bug VS Code drops into debugging mode only when the setting "startDebuggerAutomatically" is true.
To Reproduce Steps to reproduce the behavior:
-
set startDebuggerAutomatically false
-
create matlab file and add a breakpoint
-
press "Run and Debug"
-
file is not debugged, no stopping at breakpoint
-
set startDebuggerAutomatically true
-
run the file
-
debugging works
Expected behavior Debugging should also work when startDebuggerAutomatically is false.
Useful Information
- OS Version: Windows
- VS Code Version: 1.97.1
Hi @ju-w , thanks for reaching out!
Are you referring to the "Run and Debug" button which is present in the "Run and Debug" side panel?
I do not believe this is currently hooked up to the MATLAB: Run File command in VS Code. Instead, this simply starts the VS Code debugger. After clicking this button (or selecting "Start Debugging" from the "Run" menu), try clicking the run button for the MATLAB file:
Does the debugger stop at your breakpoint then?
Hi @dklilley , thanks for the quick reply!
Yes, the "Run and Debug" button in the "Run and Debug" side panel is what I refer to.
They way you explained does indeed work. So 1) we have to "arm" the debugger by clicking "Run and Debug" and then 2) run the file to make the debugger break at the break points.
If this is intended way, then there is no bug. However, I think making this procedure more clear in the README would help, as it was not intuitively obvious to me.
Thanks for checking! I'll leave this issue open as it sounds like there are improvements which may be possible in this area!
Hello there,
Yes, I have grappled with the same issue -- it would be awesome to clarify this in the README.
Also, I think it would be great if you guys could adopt this to how we normally use the debugger in vs code (e.g., while debugging python code, etc.)
I believe things would be much more easy/intuitive that way to many people.
Thank you!
Thanks @ju-w for creating this post and @dklilley for clarifying.
I was wondering why the debugging does not work and starting the debugging session before running does solve the problem. Just want to support the idea of adding this instruction to README or somewhere obvious.