From 06f2679cee97d53eec81db35eb13b44e14d48641 Mon Sep 17 00:00:00 2001 From: Mikhail Kurinnoi Date: Mon, 3 Jun 2024 19:54:34 +0300 Subject: [PATCH] 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 --- .../PathToCommand.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.34.1