From: Steve MacLean Date: Thu, 19 Mar 2020 16:12:48 +0000 (-0400) Subject: Fix cross-dac Runtime::CreateInstance() (#928) X-Git-Tag: submit/tizen_5.5/20200504.045052~11^2^2~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d097a4a9d8b000d466dc3dea55b50855d6a648f2;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Fix cross-dac Runtime::CreateInstance() (#928) --- diff --git a/src/SOS/Strike/runtime.cpp b/src/SOS/Strike/runtime.cpp index 94afc1fd0..a84ea2fad 100644 --- a/src/SOS/Strike/runtime.cpp +++ b/src/SOS/Strike/runtime.cpp @@ -57,6 +57,15 @@ HRESULT Runtime::CreateInstance(bool isDesktop, Runtime **ppRuntime) if (*ppRuntime == nullptr) { hr = g_ExtSymbols->GetModuleByModuleName(runtimeModuleName, 0, &moduleIndex, &moduleAddress); +#ifndef FEATURE_PAL + // On Windows, support loading a Linux core dump by checking for NETCORE_RUNTIME_MODULE_NAME_UNIX_A too + if (!SUCCEEDED(hr) && !isDesktop) + { + runtimeModuleName = NETCORE_RUNTIME_MODULE_NAME_UNIX_A; + + hr = g_ExtSymbols->GetModuleByModuleName(runtimeModuleName, 0, &moduleIndex, &moduleAddress); + } +#endif // !FEATURE_PAL if (SUCCEEDED(hr)) { #ifdef FEATURE_PAL diff --git a/src/SOS/Strike/runtime.h b/src/SOS/Strike/runtime.h index 169320198..fdae98432 100644 --- a/src/SOS/Strike/runtime.h +++ b/src/SOS/Strike/runtime.h @@ -24,6 +24,8 @@ #else +#define NETCORE_RUNTIME_MODULE_NAME_UNIX_A "libcoreclr" + #define NETCORE_RUNTIME_MODULE_NAME_W W("coreclr") #define NETCORE_RUNTIME_MODULE_NAME_A "coreclr" #define NETCORE_RUNTIME_DLL_NAME_W MAKEDLLNAME_W(NETCORE_RUNTIME_MODULE_NAME_W)