@@ -335,7 +335,7 @@ HRESULT DacHeapWalker::InitHeapDataSvr(HeapData *&pHeaps, size_t &pCount)
335335 for (int i = 0 ; i < heaps; ++i)
336336 {
337337 // Basic heap info.
338- TADDR heapAddress = HeapTableIndex (g_gcDacGlobals->g_heaps , i);
338+ TADDR heapAddress = HeapTableIndex (g_gcDacGlobals->g_heaps , i);
339339 dac_gc_heap heap = LoadGcHeapData (heapAddress);
340340 dac_gc_heap* pHeap = &heap;
341341 dac_generation gen0 = ServerGenerationTableIndex (heapAddress, 0 );
@@ -395,17 +395,16 @@ HRESULT DacHeapWalker::InitHeapDataSvr(HeapData *&pHeaps, size_t &pCount)
395395 seg = gen0.start_segment ;
396396 for (; seg && (j < count); ++j)
397397 {
398+ pHeaps[i].Segments [j].Generation = CorDebug_Gen0;
398399 pHeaps[i].Segments [j].Start = (CORDB_ADDRESS)seg->mem ;
399400 if (seg.GetAddr () == pHeap->ephemeral_heap_segment .GetAddr ())
400401 {
401402 pHeaps[i].Segments [j].End = (CORDB_ADDRESS)pHeap->alloc_allocated ;
402403 pHeaps[i].EphemeralSegment = j;
403- pHeaps[i].Segments [j].Generation = CorDebug_Gen0;
404404 }
405405 else
406406 {
407407 pHeaps[i].Segments [j].End = (CORDB_ADDRESS)seg->allocated ;
408- pHeaps[i].Segments [j].Generation = seg->flags & HEAP_SEGMENT_FLAGS_READONLY ? CorDebug_NonGC : CorDebug_Gen2;;
409408 }
410409
411410 seg = seg->next ;
@@ -471,11 +470,11 @@ void DacFreeRegionEnumerator::AddServerRegions()
471470 TADDR heapAddress = (TADDR)HeapTableIndex (g_gcDacGlobals->g_heaps , i);
472471 if (heapAddress == 0 )
473472 continue ;
474-
473+
475474 dac_gc_heap heap = LoadGcHeapData (heapAddress);
476475 for (int i = 0 ; i < count_free_region_kinds; i++)
477476 AddSegmentList (heap.free_regions [i].head_free_region , FreeRegionKind::FreeRegion, i);
478-
477+
479478 AddSegmentList (heap.freeable_soh_segment , FreeRegionKind::FreeSohSegment, i);
480479 AddSegmentList (heap.freeable_uoh_segment , FreeRegionKind::FreeUohSegment, i);
481480 }
0 commit comments