@@ -46,6 +46,10 @@ class ChromeProxyService implements VmServiceInterface {
46
46
Future <void > get isInitialized => _initializedCompleter.future;
47
47
Completer <void > _initializedCompleter = Completer <void >();
48
48
49
+ /// Signals when isolate starts.
50
+ Future <void > get isStarted => _startedCompleter.future;
51
+ Completer <void > _startedCompleter = Completer <void >();
52
+
49
53
/// Signals when expression compiler is ready to evaluate.
50
54
Future <void > get isCompilerInitialized => _compilerCompleter.future;
51
55
Completer <void > _compilerCompleter = Completer <void >();
@@ -252,6 +256,7 @@ class ChromeProxyService implements VmServiceInterface {
252
256
253
257
unawaited (appConnection.onStart.then ((_) async {
254
258
await debugger.resumeFromStart ();
259
+ _startedCompleter.complete ();
255
260
}));
256
261
257
262
final isolateRef = inspector.isolateRef;
@@ -301,6 +306,7 @@ class ChromeProxyService implements VmServiceInterface {
301
306
final isolateRef = inspector.isolateRef;
302
307
303
308
_initializedCompleter = Completer <void >();
309
+ _startedCompleter = Completer <void >();
304
310
_compilerCompleter = Completer <void >();
305
311
_streamNotify (
306
312
'Isolate' ,
@@ -573,12 +579,13 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
573
579
574
580
/// Returns the current stack.
575
581
///
576
- /// Returns null if the corresponding isolate is not paused.
582
+ /// Throws RPCError the corresponding isolate is not paused.
577
583
///
578
584
/// The returned stack will contain up to [limit] frames if provided.
579
585
@override
580
586
Future <Stack > getStack (String isolateId, {int ? limit}) async {
581
587
await isInitialized;
588
+ await isStarted;
582
589
_checkIsolate ('getStack' , isolateId);
583
590
return (await debuggerFuture).getStack (limit: limit);
584
591
}
@@ -718,6 +725,7 @@ ${globalLoadStrategy.loadModuleSnippet}("dart_sdk").developer.invokeExtension(
718
725
if (inspector.appConnection.isStarted) {
719
726
return captureElapsedTime (() async {
720
727
await isInitialized;
728
+ await isStarted;
721
729
_checkIsolate ('resume' , isolateId);
722
730
return await (await debuggerFuture)
723
731
.resume (step: step, frameIndex: frameIndex);
0 commit comments