From: Hyungju Lee Date: Tue, 13 Sep 2022 05:09:12 +0000 (+0900) Subject: [Tizen] Fix ArgumentOutOfRangeException X-Git-Tag: accepted/tizen/unified/20221103.165810~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9cbeb508fbb94a61a160df5289e1e73a4fdc5be6;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git [Tizen] Fix ArgumentOutOfRangeException [root@localhost tmp]# dotnet dump analyze core_19700108_100550 Loading core dump: core_19700108_100550 ... Ready to process analysis commands. Type 'help' to list available commands or 'help [command]' to get detailed help on a command. Type 'quit' or 'exit' to exit the session. Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension. (Parameter 'top') Actual value was -1. at System.Console.SetCursorPosition(Int32 left, Int32 top) at System.Console.set_CursorLeft(Int32 value) at Microsoft.Diagnostics.Repl.ConsoleProvider.ClearLine() at Microsoft.Diagnostics.Repl.ConsoleProvider.RefreshLine() at Microsoft.Diagnostics.Repl.ConsoleProvider.AppendNewText(String text) at Microsoft.Diagnostics.Repl.ConsoleProvider.ProcessKeyInfo(ConsoleKeyInfo keyInfo, Action`2 dispatchCommand) at Microsoft.Diagnostics.Repl.ConsoleProvider.Start(Action`2 dispatchCommand) at Microsoft.Diagnostics.Tools.Dump.Analyzer.Analyze(FileInfo dump_path, String[] command) --- End of inner exception stack trace --- --- diff --git a/src/Microsoft.Diagnostics.Repl/ConsoleService.cs b/src/Microsoft.Diagnostics.Repl/ConsoleService.cs index fa4687bae..7145a79af 100644 --- a/src/Microsoft.Diagnostics.Repl/ConsoleService.cs +++ b/src/Microsoft.Diagnostics.Repl/ConsoleService.cs @@ -274,7 +274,7 @@ namespace Microsoft.Diagnostics.Repl Console.Write(m_clearLine); - if (!m_outputRedirected) { + if (!m_outputRedirected && Console.CursorTop >= 0) { Console.CursorLeft = 0; } } @@ -320,7 +320,7 @@ namespace Microsoft.Diagnostics.Repl Console.Write("{0}{1}", prompt, text); - if (!m_outputRedirected) { + if (!m_outputRedirected && Console.CursorTop >= 0) { Console.CursorLeft = prompt.Length + (m_cursorPosition - m_scrollPosition); } }