From: Steve MacLean Date: Tue, 24 Mar 2020 01:40:50 +0000 (-0400) Subject: Fix dotnet-dump analyze clrmd CreateRuntime (#940) X-Git-Tag: submit/tizen_5.5/20200504.045052~11^2^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3f4f433029b85d5b9503b49d76052fca3ec6803;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Fix dotnet-dump analyze clrmd CreateRuntime (#940) --- diff --git a/src/Tools/dotnet-dump/Analyzer.cs b/src/Tools/dotnet-dump/Analyzer.cs index d630392ad..ead2bad85 100644 --- a/src/Tools/dotnet-dump/Analyzer.cs +++ b/src/Tools/dotnet-dump/Analyzer.cs @@ -201,7 +201,7 @@ namespace Microsoft.Diagnostics.Tools.Dump // Ignore the DAC version mismatch that can happen on Linux because the clrmd ELF dump // reader returns 0.0.0.0 for the runtime module that the DAC is matched against. This // will be fixed in clrmd 2.0 but not 1.1. - runtime = clrInfo.CreateRuntime(dacFilePath, ignoreMismatch: RuntimeInformation.IsOSPlatform(OSPlatform.Linux)); + runtime = clrInfo.CreateRuntime(dacFilePath, ignoreMismatch: clrInfo.ModuleInfo.BuildId != null); } catch (DllNotFoundException ex) { @@ -241,6 +241,14 @@ namespace Microsoft.Diagnostics.Tools.Dump KeyTypeFlags.ClrKeys, clrInfo.ModuleInfo.FileName, clrInfo.ModuleInfo.BuildId, symbolFile: false, symbolFileName: null); key = keys.SingleOrDefault((k) => Path.GetFileName(k.FullPathName) == dacFileName); + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + // We are opening a Linux dump on Windows + // We need to use the Windows index and filename + key = new SymbolStoreKey(key.Index.Replace("libmscordaccore.so", "mscordaccore.dll"), + key.FullPathName.Replace("libmscordaccore.so", "mscordaccore.dll")); + } } else {