This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -2962,31 +2962,19 @@ ClrDataAccess::GetGCHeapData(struct DacpGcHeapData *gcheapData)
2962
2962
2963
2963
// for server GC-capable builds only, we need to check and see if IGCHeap::gcHeapType
2964
2964
// is GC_HEAP_INVALID, in which case we fail.
2965
- // IGCHeap::gcHeapType doesn't exist on non-server-GC capable builds.'
2965
+ // IGCHeap::gcHeapType doesn't exist on non-server-GC capable builds.
2966
2966
#ifdef FEATURE_SVR_GC
2967
- size_t gcHeapValue = 0 ;
2968
- ULONG32 returned = 0 ;
2969
-
2970
- TADDR gcHeapTypeLocation = m_globalBase + g_dacGlobals.IGCHeap__gcHeapType ;
2971
-
2972
- // @todo Microsoft: we should probably be capturing the HRESULT from ReadVirtual. We could
2973
- // provide a more informative error message. E_FAIL is a wretchedly vague thing to return.
2974
- hr = m_pTarget->ReadVirtual (gcHeapTypeLocation, (PBYTE)&gcHeapValue, sizeof (gcHeapValue), &returned);
2975
- if (!SUCCEEDED (hr))
2976
- {
2977
- goto cleanup;
2978
- }
2967
+ ULONG32 gcHeapValue = IGCHeap::gcHeapType;
2979
2968
2980
2969
// GC_HEAP_TYPE has three possible values:
2981
2970
// GC_HEAP_INVALID = 0,
2982
2971
// GC_HEAP_WKS = 1,
2983
2972
// GC_HEAP_SVR = 2
2984
2973
// If we get something other than that, we probably read the wrong location.
2985
- _ASSERTE (gcHeapValue >= 0 && gcHeapValue <= 2 );
2974
+ _ASSERTE (gcHeapValue >= IGCHeap::GC_HEAP_INVALID && gcHeapValue <= IGCHeap::GC_HEAP_SVR );
2986
2975
2987
- // @todo Microsoft: We have an enumerated type, we probably should use the symbolic name
2988
2976
// we have GC_HEAP_INVALID if gcHeapValue == 0, so we're done
2989
- if (SUCCEEDED (hr) && ((returned != sizeof ( gcHeapValue)) || (gcHeapValue == 0 )) )
2977
+ if (gcHeapValue == IGCHeap::GC_HEAP_INVALID )
2990
2978
{
2991
2979
hr = E_FAIL;
2992
2980
goto cleanup;
You can’t perform that action at this time.
0 commit comments