Only reference IGCHeap::gcHeapType when FEATURE_SVR_GC is defined
authorSean Gillespie <segilles@microsoft.com>
Fri, 9 Sep 2016 13:53:48 +0000 (06:53 -0700)
committerSean Gillespie <segilles@microsoft.com>
Fri, 9 Sep 2016 14:02:49 +0000 (07:02 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/c4d22a210bc28923906b205b219e8bf5c8e58926

src/coreclr/src/debug/daccess/request.cpp

index 9de09e7..e38befa 100644 (file)
@@ -2960,8 +2960,13 @@ ClrDataAccess::GetGCHeapData(struct DacpGcHeapData *gcheapData)
 
     SOSDacEnter();
 
+    // for server GC-capable builds only, we need to check and see if IGCHeap::gcHeapType
+    // is GC_HEAP_INVALID, in which case we fail.
+    // IGCHeap::gcHeapType doesn't exist on non-server-GC capable builds.'
+#ifdef FEATURE_SVR_GC
     size_t gcHeapValue = 0;
     ULONG32 returned = 0;
+
     TADDR gcHeapTypeLocation = m_globalBase + g_dacGlobals.IGCHeap__gcHeapType;
 
     // @todo Microsoft: we should probably be capturing the HRESULT from ReadVirtual. We could 
@@ -2986,6 +2991,7 @@ ClrDataAccess::GetGCHeapData(struct DacpGcHeapData *gcheapData)
         hr = E_FAIL;
         goto cleanup;
     }
+#endif
 
     // Now we can get other important information about the heap
     gcheapData->g_max_generation = GCHeapUtilities::GetMaxGeneration();
@@ -3005,8 +3011,10 @@ ClrDataAccess::GetGCHeapData(struct DacpGcHeapData *gcheapData)
         gcheapData->HeapCount = 1;
     }
 
+#ifdef FEATURE_SVR_GC
 cleanup:
     ;
+#endif
 
     SOSDacLeave();
     return hr;