From: Steve MacLean Date: Wed, 18 Mar 2020 20:45:22 +0000 (-0400) Subject: Fix dotnet-dump analyze -c exit (#924) X-Git-Tag: submit/tizen_5.5/20200504.045052~11^2^2~56 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=422684970d7dba46df6ee1f195aecf144876fa9a;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Fix dotnet-dump analyze -c exit (#924) * Fix dotnet-dump analyze -c exit The exit command would fail to exit the analyze process when executed from the command line. * Move fix to ConsoleProvider per feedback, simplify --- diff --git a/src/Microsoft.Diagnostics.Repl/Console/ConsoleProvider.cs b/src/Microsoft.Diagnostics.Repl/Console/ConsoleProvider.cs index 2083ec063..d59f74336 100644 --- a/src/Microsoft.Diagnostics.Repl/Console/ConsoleProvider.cs +++ b/src/Microsoft.Diagnostics.Repl/Console/ConsoleProvider.cs @@ -50,6 +50,7 @@ namespace Microsoft.Diagnostics.Repl { m_history = new List(); m_activeLine = new StringBuilder(); + m_shutdown = false; m_consoleConverter = new CharToLineConverter(text => { NewOutput(text); @@ -77,7 +78,6 @@ namespace Microsoft.Diagnostics.Repl public async Task Start(Func dispatchCommand) { m_lastCommandLine = null; - m_shutdown = false; m_interactiveConsole = !Console.IsInputRedirected; RefreshLine(); @@ -115,6 +115,8 @@ namespace Microsoft.Diagnostics.Repl } } + public bool Shutdown { get { return m_shutdown; } } + /// /// Stop input processing/dispatching /// diff --git a/src/Tools/dotnet-dump/Analyzer.cs b/src/Tools/dotnet-dump/Analyzer.cs index 500cfb965..d630392ad 100644 --- a/src/Tools/dotnet-dump/Analyzer.cs +++ b/src/Tools/dotnet-dump/Analyzer.cs @@ -100,6 +100,9 @@ namespace Microsoft.Diagnostics.Tools.Dump foreach (string cmd in command) { await _commandProcessor.Parse(cmd); + + if (_consoleProvider.Shutdown) + break; } }