<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/54445>54445</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Pdb "Too many directory blocks"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          pierricgimmig
      </td>
    </tr>
</table>

<pre>
    Some pdb files have more indices to directory blocks than what fits in a single block. In Llvm, when that happens, we run into the "Too many directory blocks" error and the pdb can not be loaded. From [MSFCommon.cpp](https://github.com/llvm/llvm-project/blob/main/llvm/lib/DebugInfo/MSF/MSFCommon.cpp#L42):

```
  // The directory, as we understand it, is a block which consists of a list of
  // block numbers.  It is unclear what would happen if the number of blocks
  // couldn't fit on a single block.
  if (NumDirectoryBlocks > SB.BlockSize / sizeof(support::ulittle32_t))
    return make_error<MSFError>(msf_error_code::invalid_format,
                                "Too many directory blocks.");
```

It seems that when this happens, the indices to all the blocks containing directory block indices are actually available. See https://github.com/MolecularMatters/raw_pdb/issues/6 for more information and for their implementation of the fix.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVVNtu2zAM_RrnhZiRykmaPPihaRqgQDsMSN8DWaJjrboYkpyu_fpRctpm7dBhhiHLvBxSh6QaJ5_rnTMIvWygVRoDdPyIYJxHUFYqQZLoQCqPIjr_DI124pFkHbfw1PFIXjGQKXAIyh40jhYl3Fq400dTsGuyQ5s8IoH3PdqQhQh-sORJ8LFDKBh7cA4Mt8-fwpEO0HvngVuZrVO-glKwLkKDoB2XKEvYemegmK_vd9trZ4yzpej7Yr4p2LKLsQ9FdVWwLb0HFbuhKYWjBLc655k_33rvflJs-qXQDX0MV_bMRiXZBpvhcGtbR3sKNa5nAVl1N2MFW6Vw000xfV0X09ObfwHGXOCBDvR25MQND4mewUr0IaYjq5jEKhDLmRGiVIkOhLNBBeLftaTRtKXdB_DR3g6mIbAS4DYmnMEKjdyPJXxyg5an2oBqM8GjQwI-leBPVJFciJfL3ADgPtX_1Z7giPzvg9m8HnA9dlBR3cBuXea_nXpJDbAliBekE7BlGPre-ZgIrK4GrWLUWLF9TKTSewIH8BgHb6lrHnGfO6SorqkWN-P2hpBMaEfNXjiJI6CyR66V3LfOG56ofQf86vmqRUtS5oqv_1rrcSXuA6IJ4zCcxkKF87FI3J8NHtc6i05jRwWP1I9E9McE3pw4TS4XcSDPZ-BHrjRvNJawQ4QvZuDeaRSD5v6ex0idQiLPn_Y0Z7RTIQyYRAsgyl5vh5E9lWpPLZoUlKnyoEyv0SBlmpVubKhW_Sonsq7kqlrxSVRU0PoHTfE_5n4yeF3_9-y-JTyfzWbzSVezVcsXlzMu2kW7XK7ERYtcLJlcILaX06mcEEuoQ013BwW1-AQZIhV1vpmomk0Zm1YXS1rmF8uyFUwycSnkQjBcNFUxmyJdFLpMeZTOHya-zinRPRFImUYzvCt5COpgEXM4wudD7Jyve0WNqsRBGaMOk5xAnQ_wGydh2LY">