| Index: pkg/dartino_compiler/lib/cli_debugger.dart
|
| diff --git a/pkg/dartino_compiler/lib/cli_debugger.dart b/pkg/dartino_compiler/lib/cli_debugger.dart
|
| index d8340662e69956b1e925a2f43090020a814e5c72..3be29bc1dbd46c533bb8254bcd414eda59fdc4ec 100644
|
| --- a/pkg/dartino_compiler/lib/cli_debugger.dart
|
| +++ b/pkg/dartino_compiler/lib/cli_debugger.dart
|
| @@ -77,6 +77,7 @@ class CommandLineDebugger {
|
| bool verbose = true;
|
|
|
| String previousLine = '';
|
| + bool quitDebugger = false;
|
|
|
| int processPagingCount = 10;
|
| int processPagingCurrent = 0;
|
| @@ -386,6 +387,7 @@ class CommandLineDebugger {
|
| case 'q':
|
| case 'quit':
|
| await vmContext.terminate();
|
| + quitDebugger = true;
|
| break;
|
| case 'r':
|
| case 'run':
|
| @@ -444,7 +446,6 @@ class CommandLineDebugger {
|
| break;
|
| }
|
| previousLine = line;
|
| - if (!vmContext.terminated) printPrompt();
|
| }
|
|
|
| bool toggleVerbose() => verbose = !verbose;
|
| @@ -498,9 +499,14 @@ class CommandLineDebugger {
|
| Future<int> run(SessionState state, {Uri snapshotLocation}) async {
|
| await vmContext.initialize(state, snapshotLocation: snapshotLocation);
|
| writeStdoutLine(BANNER);
|
| - printPrompt();
|
| StreamIterator streamIterator = new StreamIterator(stream);
|
| - while (await streamIterator.moveNext()) {
|
| +
|
| + Future<bool> getNext() async {
|
| + printPrompt();
|
| + return await streamIterator.moveNext();
|
| + }
|
| +
|
| + while (!quitDebugger && await getNext()) {
|
| try {
|
| await handleLine(streamIterator);
|
| } catch (e, s) {
|
| @@ -511,11 +517,10 @@ class CommandLineDebugger {
|
| await cancel;
|
| return new Future.error(e, s);
|
| }
|
| - if (vmContext.terminated) {
|
| - await streamIterator.cancel();
|
| - }
|
| }
|
| - if (!vmContext.terminated) await vmContext.terminate();
|
| + if (!vmContext.terminated) {
|
| + await vmContext.terminate();
|
| + }
|
| return vmContext.interactiveExitCode;
|
| }
|
|
|
|
|