Fix minidumps not loading in VS issue (dotnet/coreclr#27406)
authorMike McLaughlin <mikem@microsoft.com>
Thu, 24 Oct 2019 17:44:59 +0000 (10:44 -0700)
committerGitHub <noreply@github.com>
Thu, 24 Oct 2019 17:44:59 +0000 (10:44 -0700)
Fix a function that was ifdef'ed needed for the metadata locator callbacks to work.

Fix some not properly DAC'ized code in the type desc and server GC code. Caused an exception during dump generation.

Commit migrated from https://github.com/dotnet/coreclr/commit/0a048b8e88764abb9056ae1e0d2a5c946b120b45

src/coreclr/src/debug/daccess/dacdbiimpl.cpp
src/coreclr/src/debug/daccess/request_svr.cpp
src/coreclr/src/vm/typedesc.cpp

index 5c751b9..69f163e 100644 (file)
@@ -1238,12 +1238,6 @@ bool DacDbiInterfaceImpl::GetMetaDataFileInfoFromPEFile(VMPTR_PEFile vmPEFile,
                                                         bool  &isNGEN,
                                                         IStringHolder* pStrFilename)
 {
-#if !defined(FEATURE_PREJIT)
-
-    return false;
-
-#else // defined(FEATURE_PREJIT)
-
     DD_ENTER_MAY_THROW;
 
     DWORD dwDataSize;
@@ -1266,7 +1260,6 @@ bool DacDbiInterfaceImpl::GetMetaDataFileInfoFromPEFile(VMPTR_PEFile vmPEFile,
 
     pStrFilename->AssignCopy(wszFilePath);
     return ret;
-#endif // !defined(FEATURE_PREJIT)
 }
 
 
index 8b3f11f..20419fb 100644 (file)
@@ -227,7 +227,9 @@ ClrDataAccess::EnumSvrGlobalMemoryRegions(CLRDataEnumMemoryFlags flags)
         size_t gen_table_size = g_gcDacGlobals->generation_size * (*g_gcDacGlobals->max_gen + 2);
         DacEnumMemoryRegion(dac_cast<TADDR>(pHeap), sizeof(dac_gc_heap));
         DacEnumMemoryRegion(dac_cast<TADDR>(pHeap->finalize_queue), sizeof(dac_finalize_queue));
-        DacEnumMemoryRegion(dac_cast<TADDR>(pHeap->generation_table), gen_table_size);
+
+        TADDR taddrTable = dac_cast<TADDR>(pHeap) + offsetof(dac_gc_heap, generation_table);
+        DacEnumMemoryRegion(taddrTable, gen_table_size);
 
         // enumerating the generations from max (which is normally gen2) to max+1 gives you
         // the segment list for all the normal segements plus the large heap segment (max+1)
index 856d06b..a2d11ff 100644 (file)
@@ -229,9 +229,9 @@ void TypeDesc::GetName(SString &ssBuf)
         th = TypeHandle(this);
 
     if (kind == ELEMENT_TYPE_ARRAY)
-        rank = ((ArrayTypeDesc*) this)->GetRank();
+        rank = dac_cast<PTR_ArrayTypeDesc>(this)->GetRank();
     else if (CorTypeInfo::IsGenericVariable(kind))
-        rank = ((TypeVarTypeDesc*) this)->GetIndex();
+        rank = dac_cast<PTR_TypeVarTypeDesc>(this)->GetIndex();
     else
         rank = 0;