Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/SOS/SOS.UnitTests/Scripts/OtherCommands.script
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,12 @@ VERIFY:\s*Class Name:\s+SymbolTestApp.Program\s+
VERIFY:\s*File:\s+.*SymbolTestApp\.(dll|exe)\s+

# Verify DumpMT
!IFDEF:MAJOR_RUNTIME_VERSION_GE_7
# https://github.com/dotnet/diagnostics/issues/3516
SOSCOMMAND:DumpMT <POUT>\s*Method Table:\s+(<HEXVAL>)\s+<POUT>
VERIFY:\s*Name:\s+SymbolTestApp.Program\s+
VERIFY:\s*File:\s+.*SymbolTestApp\.(dll|exe)\s+
ENDIF:MAJOR_RUNTIME_VERSION_GE_7

SOSCOMMAND:FinalizeQueue
VERIFY:\s*SyncBlocks to be cleaned up:\s+<DECVAL>\s+
Expand Down
30 changes: 25 additions & 5 deletions src/SOS/Strike/strike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ DECLARE_API(DumpMT)
}

EnableDMLHolder dmlHolder(dml);
TableOutput table(2, 16, AlignLeft, false);
TableOutput table(2, 20, AlignLeft, false);

if (nArg == 0)
{
Expand Down Expand Up @@ -1326,6 +1326,26 @@ DECLARE_API(DumpMT)
}
}

ReleaseHolder<ISOSDacInterface8> sos8;
if (IsRuntimeVersionAtLeast(7) // Prior to .NET 7, a bug existed that made ALC queries fail.
&& SUCCEEDED(Status = g_sos->QueryInterface(__uuidof(ISOSDacInterface8), &sos8)))
{
CLRDATA_ADDRESS assemblyLoadContext = 0;
Status = sos8->GetAssemblyLoadContext(TO_CDADDR(dwStartAddr), &assemblyLoadContext);
if (SUCCEEDED(Status))
{
const char* title = "AssemblyLoadContext:";
if (assemblyLoadContext != 0)
{
table.WriteRow(title, ObjectPtr(assemblyLoadContext));
}
else
{
table.WriteRow(title, "Default ALC - The managed instance of this context doesn't exist yet.");
}
}
}

table.WriteRow("BaseSize:", PrefixHex(vMethTable.BaseSize));
table.WriteRow("ComponentSize:", PrefixHex(vMethTable.ComponentSize));
table.WriteRow("DynamicStatics:", vMethTable.bIsDynamic ? "true" : "false");
Expand Down Expand Up @@ -10338,7 +10358,7 @@ DECLARE_API(EEVersion)
else
ExtOut("Workstation mode\n");

if (!GetGcStructuresValid())
if (!GetGcStructuresValid())
{
ExtOut("In plan phase of garbage collection\n");
}
Expand Down Expand Up @@ -15797,7 +15817,7 @@ class EnumMemoryCallback : public ICLRDataEnumMemoryRegionsCallback, ICLRDataLog
}
}
if (IsInterrupt())
{
{
return COR_E_OPERATIONCANCELED;
}
return S_OK;
Expand All @@ -15808,7 +15828,7 @@ class EnumMemoryCallback : public ICLRDataEnumMemoryRegionsCallback, ICLRDataLog
{
ExtOut("%s", message);
if (IsInterrupt())
{
{
return COR_E_OPERATIONCANCELED;
}
return S_OK;
Expand All @@ -15824,7 +15844,7 @@ DECLARE_API(enummem)
if (SUCCEEDED(Status))
{
ToRelease<ICLRDataEnumMemoryRegionsCallback> callback = new EnumMemoryCallback(false, true);
ULONG32 minidumpType =
ULONG32 minidumpType =
(MiniDumpWithPrivateReadWriteMemory |
MiniDumpWithDataSegs |
MiniDumpWithHandleData |
Expand Down
15 changes: 4 additions & 11 deletions src/SOS/Strike/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3488,7 +3488,7 @@ size_t FunctionType (size_t EIP)

//
// Return true if major runtime version (logical product version like 2.1,
// 3.0 or 5.x). Currently only major versions of 3 or 5 are supported.
// 3.0 or 5.x).
//
bool IsRuntimeVersion(DWORD major)
{
Expand All @@ -3504,13 +3504,10 @@ bool IsRuntimeVersion(VS_FIXEDFILEINFO& fileInfo, DWORD major)
{
switch (major)
{
case 5:
return HIWORD(fileInfo.dwFileVersionMS) == 5;
case 3:
return HIWORD(fileInfo.dwFileVersionMS) == 4 && LOWORD(fileInfo.dwFileVersionMS) == 700;
default:
_ASSERTE(FALSE);
break;
return HIWORD(fileInfo.dwFileVersionMS) == major;
}
return false;
}
Expand All @@ -3536,18 +3533,14 @@ bool IsRuntimeVersionAtLeast(VS_FIXEDFILEINFO& fileInfo, DWORD major)
}
// fall through

case 5:
if (HIWORD(fileInfo.dwFileVersionMS) >= 5)
default:
if (HIWORD(fileInfo.dwFileVersionMS) >= major)
{
return true;
}
// fall through

break;

default:
_ASSERTE(FALSE);
break;
}
return false;
}
Expand Down