Skip to content

Commit 44c44e9

Browse files
committed
Disable pause-on-exception during hot restarts
Fixes #3448.
1 parent 0cae3f7 commit 44c44e9

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎src/debug/flutter_debug_impl.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@ export class FlutterDebugSession extends DartDebugSession {
272272

273273
this.isReloadInProgress = true;
274274
const restartType = hotRestart ? "hot-restart" : "hot-reload";
275+
276+
// To avoid issues with hot restart pausing on exceptions during the restart, we remove
277+
// exception-pause behaviour here, and it will be re-added as part of the startup code
278+
// when the new isolate appears.
279+
if (hotRestart)
280+
await this.threadManager.setExceptionPauseMode("None", false);
281+
275282
try {
276283
await this.runDaemon.restart(this.currentRunningAppId, !this.noDebug, hotRestart, args);
277284
} catch (e) {

‎src/debug/threads.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ export class ThreadManager {
7777
return this.threads.map((thread: ThreadInfo) => new Thread(thread.num, thread.ref.name));
7878
}
7979

80-
public async setExceptionPauseMode(mode: VmExceptionMode) {
81-
this.exceptionMode = mode;
80+
public async setExceptionPauseMode(mode: VmExceptionMode, persist = true) {
81+
if (persist) {
82+
this.exceptionMode = mode;
83+
}
8284
if (!this.debugSession.vmService)
8385
return;
8486

0 commit comments

Comments
 (0)