From: Mikhail Kurinnoi Date: Mon, 3 Jun 2024 16:54:34 +0000 (+0300) Subject: Fix `pathto` SOS command. (#4706) X-Git-Tag: accepted/tizen/unified/20241231.014852~40^2~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=06f2679cee97d53eec81db35eb13b44e14d48641;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Fix `pathto` SOS command. (#4706) Fix `pathto` SOS command arguments parsing logic. Current status: ``` > pathto 0x1234 ERROR: Could not parse argument 'source': 4660 > pathto 0x4444 ERROR: Could not parse argument 'source': 17476 ``` With this changes: ``` > pathto 0x003f1d1182d8 ERROR: Could not parse argument 'target': 0 > pathto 0x003f1d1182d8 0x003f1d1182d8 ERROR: Object reference not set to an instance of an object. > pathto 0x003f1d1182d8 0x003b7180bfc0 Could not find a path from 3f1d1182d8 to 3b7180bfc0 ``` CC @clamp03 @wscho77 @HJLeee @gbalykov --- diff --git a/src/Microsoft.Diagnostics.ExtensionCommands/PathToCommand.cs b/src/Microsoft.Diagnostics.ExtensionCommands/PathToCommand.cs index ac0975b85..2e6ab6a8c 100644 --- a/src/Microsoft.Diagnostics.ExtensionCommands/PathToCommand.cs +++ b/src/Microsoft.Diagnostics.ExtensionCommands/PathToCommand.cs @@ -21,14 +21,14 @@ namespace Microsoft.Diagnostics.ExtensionCommands public override void Invoke() { - if (TryParseAddress(SourceAddress, out ulong source)) + if (!TryParseAddress(SourceAddress, out ulong source)) { throw new ArgumentException($"Could not parse argument 'source': {source}"); } - if (TryParseAddress(TargetAddress, out ulong target)) + if (!TryParseAddress(TargetAddress, out ulong target)) { - throw new ArgumentException($"Could not parse argument 'source': {target}"); + throw new ArgumentException($"Could not parse argument 'target': {target}"); } ClrHeap heap = Runtime.Heap;