You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document & Review differences between Run and Debug modes #4876
VS Code has first-class actions for running in Debug and "noDebug" modes. Our current distinction is:
Run - does not connect the debug adapter to the VM Service
Debug - does connect the debug adapter to the VM Service
This means in noDebug, anything that uses the VM Service will be unavailable:
breakpoints
break on exception
(expression eval??)
dart:developerlog()
navigating to files from ToolEvents
This distinction is not clear/obvious, and to confuse things further in the legacy debug adapters we did connect the VM Service in noDebug mode but only for Flutter.
The reason for doing more than just disabling breakpoints/break-on-exception in noDebug mode is that these are trivially toggleable in the UI anyway (users can easily do this, including changing it while the session is running, and VS Code could also just do this by not sending those settings to the debugger when you run if this was the intention).
However, we may have gone too far the other way. For example although we route ToolEvents through the VM Service, it's not obvious that this functionality would be unavailable in Run mode.
#4956 describes an issue that might be caused by starting paused. It's likely that before the workaround here that this issue would only have occurred in Debug mode.
Getting back to not needing to start paused in Run mode might address that issue (as well as perhaps improve startup time).. however, it could also introduce races if we decide we want to retain some of the functionality above in Run mode (for example capturing inspect() events that might be sent at startup).
Another consideration.. If we can't attach the debugger for any reason (for ex. flutter/flutter#144999) using Run is no longer a way to possibly get further.
Activity
DanTup commentedon Dec 4, 2023
Also worth checking:
And if we change this, should it change for both Dart and Flutter, or only Flutter?
Force debug mode on for Flutter apps to enable inspector navigation
Force debug mode on for Flutter apps to enable inspector navigation
Force debug mode on for Flutter apps to enable inspector navigation
Force debug mode on for Flutter apps to enable inspector navigation
Force debug mode on for Flutter apps to enable inspector navigation
Force debug mode on for Flutter apps to enable inspector navigation
Force debug mode on for Flutter apps to enable inspector navigation
Force debug mode on for Flutter apps to enable inspector navigation
DanTup commentedon Jan 24, 2024
#4956 describes an issue that might be caused by starting paused. It's likely that before the workaround here that this issue would only have occurred in Debug mode.
Getting back to not needing to start paused in Run mode might address that issue (as well as perhaps improve startup time).. however, it could also introduce races if we decide we want to retain some of the functionality above in Run mode (for example capturing
inspect()events that might be sent at startup).DanTup commentedon Mar 14, 2024
Another consideration.. If we can't attach the debugger for any reason (for ex. flutter/flutter#144999) using Run is no longer a way to possibly get further.