From 934ef618a9e3abf968e5783b8efa28e9c1caf295 Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Wed, 30 Oct 2019 16:12:47 -0700 Subject: Fix minidumps not loading in VS issue (#27553) 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. Issue: https://github.com/dotnet/coreclr/issues/26907 --- src/debug/daccess/dacdbiimpl.cpp | 7 ------- src/debug/daccess/request_svr.cpp | 4 +++- src/vm/typedesc.cpp | 4 ++-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/debug/daccess/dacdbiimpl.cpp b/src/debug/daccess/dacdbiimpl.cpp index a65233c2d0..fb930c16fa 100644 --- a/src/debug/daccess/dacdbiimpl.cpp +++ b/src/debug/daccess/dacdbiimpl.cpp @@ -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) } diff --git a/src/debug/daccess/request_svr.cpp b/src/debug/daccess/request_svr.cpp index 8b3f11fd4d..20419fb039 100644 --- a/src/debug/daccess/request_svr.cpp +++ b/src/debug/daccess/request_svr.cpp @@ -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(pHeap), sizeof(dac_gc_heap)); DacEnumMemoryRegion(dac_cast(pHeap->finalize_queue), sizeof(dac_finalize_queue)); - DacEnumMemoryRegion(dac_cast(pHeap->generation_table), gen_table_size); + + TADDR taddrTable = dac_cast(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) diff --git a/src/vm/typedesc.cpp b/src/vm/typedesc.cpp index 74be17ad05..983a403cef 100644 --- a/src/vm/typedesc.cpp +++ b/src/vm/typedesc.cpp @@ -229,9 +229,9 @@ void TypeDesc::GetName(SString &ssBuf) th = TypeHandle(this); if (kind == ELEMENT_TYPE_ARRAY) - rank = ((ArrayTypeDesc*) this)->GetRank(); + rank = dac_cast(this)->GetRank(); else if (CorTypeInfo::IsGenericVariable(kind)) - rank = ((TypeVarTypeDesc*) this)->GetIndex(); + rank = dac_cast(this)->GetIndex(); else rank = 0; -- cgit v1.2.3