<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/76602>76602</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Doc bug, incorrect description of PDB Serialized Hash Table Format
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
TimMisiak
</td>
</tr>
</table>
<pre>
The documentation page for the PDB Serialized Hash Table Format (https://github.com/llvm/llvm-project/blob/main/llvm/docs/PDB/HashTable.rst) indicates that the number of key/value pairs is "capacity" but based on my reading of the microsoft-pdb repo (and looking through some PDB files modified by pdbstr.exe), it's actually "size" that determines the length. Or more accurately, in the microsoft-pdb implementation it's actually determined by the number of bits set in the "present" bit map. Which I believe should match in a well-behaved PDB.
Reference source here: https://github.com/microsoft/microsoft-pdb/blob/805655a28bd8198004be2ac27e6e0290121a5e89/PDB/include/map.h#L584
Commit in a fork showing a potential revision to the docs: https://github.com/TimMisiak/llvm-project/commit/9bd97569f6861eca059c985254a3b7719d8e7ab3
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUlF9vpTYTxj-Nz80oCIbDAV9wkWyE3ldq1VUbqddjezhMYzCyTdKzn76CaJPtH23VG0DCnnl-jx8PpSTXhblXzYNqHk-05SnE_knmHyUJPZ9McLf-aWJwwW4zL5myhAVWujKMIUKeGD4_PsAvHIW8fGEH_6M0wRMZzzCEOFMGhd2U85pUfa9wUDhcJU-bKWyYFQ7ev3x93a0x_MY2KxyMD0bhMJMsH2tcsEnh8PnxQeGw9znaFDFlhRpkcWIpc4I8UT6kLdtsOEIY4ZlvCocX8hvDShITSAKFaGklK_mmEMFsGQwldhAWmG8QmZws1337XmwWG0MKY75bnYHIa9jJaHHgQ3jeF-Yphu06QQrzmy2jeE4wByejsANzg9WZlGPBv7NCrfATSFbYJiCbN_L-tmtK8oV3PQeG48xxluXAYvC8XPNUwE8R5hAZyNotUmZ_O4ot_6BU5tXzx9n9teF7g0Pfn10zkhMkzl8LK8Q1cuIlH35JhpnWAn6dxE7wfzDshV8Y0hQ272CmbKd9K8Ere39neKIXdrszhSofVXn_9vyZR468WIYUtmgZJo6s6nv4TmreEb_93nE_stOVzaVpCDvjukp3ZXk2jGSx5QuXqMsKK2q40--JksX6zfERu7WYFNY_NN35W6WfwjxLfkMaQ3zeSV_3kydYQ-YlC3mI_CJpdzqHw7Qjtd-neb9wf78I9mipcNDG6ba56PHSXSq2VDba6q7B5ky1adtKu45bMvXJ9bXTtaYT91Vb1ro61011mvqmsqibCh2fDdfsWqwaXeu205ZKpu4kPZZYV1iXZVNjXRVjpV3TXpzuKufa2qlzyTOJL3aNRYjXk6S0cd9eLiWePBn26RgliAu_wvFTIe6TJfYHl9muSZ1LLymnjypZsuf-MVgw2_UtxzbEyHaPf7JR1iO5YfzXWXPaou__87A5hO6T5QD5IwAA__-4Pa6X">