diff --git a/src/SOS/Strike/util.cpp b/src/SOS/Strike/util.cpp index 0c6be1383a..805f2f34bc 100644 --- a/src/SOS/Strike/util.cpp +++ b/src/SOS/Strike/util.cpp @@ -2858,7 +2858,7 @@ void DumpTieredNativeCodeAddressInfo(struct DacpTieredVersionData * pTieredVersi ExtOut(" ReJIT ID: %d\n", rejitID); DMLOut(" IL Addr: %s\n", DMLIL(ilAddr)); - if (IsRuntimeVersion(3)) { + if (IsRuntimeVersionAtLeast(3)) { for(int i = cTieredVersionData - 1; i >= 0; --i) { const char *descriptor = NULL; @@ -3345,6 +3345,43 @@ bool IsRuntimeVersion(VS_FIXEDFILEINFO& fileInfo, DWORD major) return false; } +bool IsRuntimeVersionAtLeast(DWORD major) +{ + VS_FIXEDFILEINFO fileInfo; + if (GetEEVersion(&fileInfo, nullptr, 0)) + { + return IsRuntimeVersionAtLeast(fileInfo, major); + } + return false; +} + +bool IsRuntimeVersionAtLeast(VS_FIXEDFILEINFO& fileInfo, DWORD major) +{ + switch (major) + { + case 3: + if (HIWORD(fileInfo.dwFileVersionMS) == 4 && LOWORD(fileInfo.dwFileVersionMS) == 700) + { + return true; + } + // fall through + + case 5: + if (HIWORD(fileInfo.dwFileVersionMS) >= 5) + { + return true; + } + // fall through + + break; + + default: + _ASSERTE(FALSE); + break; + } + return false; +} + #ifndef FEATURE_PAL BOOL GetSOSVersion(VS_FIXEDFILEINFO *pFileInfo) diff --git a/src/SOS/Strike/util.h b/src/SOS/Strike/util.h index 6c2fde13e0..7a487cb13b 100644 --- a/src/SOS/Strike/util.h +++ b/src/SOS/Strike/util.h @@ -1550,6 +1550,8 @@ ULONG DisplayILOperation(const UINT indentCount, BYTE* pBuffer, ULONG position, BOOL GetEEVersion(VS_FIXEDFILEINFO* pFileInfo, char* fileVersionBuffer, int fileVersionBufferSizeInBytes); bool IsRuntimeVersion(DWORD major); bool IsRuntimeVersion(VS_FIXEDFILEINFO& fileInfo, DWORD major); +bool IsRuntimeVersionAtLeast(DWORD major); +bool IsRuntimeVersionAtLeast(VS_FIXEDFILEINFO& fileInfo, DWORD major); #ifndef FEATURE_PAL BOOL IsRetailBuild (size_t base); BOOL GetSOSVersion(VS_FIXEDFILEINFO *pFileInfo);