Index: include/llvm/DebugInfo/MSF/MSFCommon.h =================================================================== --- include/llvm/DebugInfo/MSF/MSFCommon.h +++ include/llvm/DebugInfo/MSF/MSFCommon.h @@ -110,12 +110,15 @@ inline uint32_t getNumFpmIntervals(const MSFLayout &L, bool IncludeUnusedFpmData = false) { + // Need to subtract the free block map index from the number of blocks + // so the blocks before Fpm (SB & Fpm0 if using Fpm1) aren't included + // Need to add 1 to block size so the interval includes the already present FPM blocks if (IncludeUnusedFpmData) - return divideCeil(L.SB->NumBlocks, L.SB->BlockSize); + return divideCeil(L.SB->NumBlocks - L.SB->FreeBlockMapBlock, L.SB->BlockSize + 1); // We want the minimum number of intervals required, where each interval can // represent BlockSize * 8 blocks. - return divideCeil(L.SB->NumBlocks, 8 * L.SB->BlockSize); + return divideCeil(L.SB->NumBlocks - L.SB->FreeBlockMapBlock, 8 * L.SB->BlockSize); } Error validateSuperBlock(const SuperBlock &SB);