There are two age fields in a PDB file. One from the PDB Stream and another one
from the DBI stream.
According to https://randomascii.wordpress.com/2011/11/11/source-indexing-is-underused-awesomeness/#comment-34328,
The age in DBI stream is used to against the binary's age. Pdbstr.exe is used
to only increment the age from PDB stream without changing the DBI age. I
also verified this by manually changing the DBI age of a PDB file and let
windbg.exe to load it. It shows the following logs before and after changing:
Before:
SYMSRV: BYINDEX: 0xA c:\symbols*https://msdl.microsoft.com/download/symbols nlaapi.pdb D72AA69CD5ABE5D28C74FADB17DE3F8C1 SYMSRV: PATH: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb SYMSRV: RESULT: 0x00000000 *** WARNING: Unable to verify checksum for NLAapi.dll DBGHELP: NLAapi - public symbols c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb ...
After:
SYMSRV: BYINDEX: 0xA c:\symbols*https://msdl.microsoft.com/download/symbols nlaapi.pdb D72AA69CD5ABE5D28C74FADB17DE3F8C1 SYMSRV: PATH: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb SYMSRV: RESULT: 0x00000000 DBGHELP: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb - mismatched pdb SYMSRV: BYINDEX: 0xB c:\symbols*https://chromium-browser-symsrv.commondatastorage.googleapis.com nlaapi.pdb D72AA69CD5ABE5D28C74FADB17DE3F8C1 SYMSRV: PATH: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb SYMSRV: RESULT: 0x00000000 DBGHELP: c:\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb - mismatched pdb SYMSRV: BYINDEX: 0xC c:\src\symbols*https://msdl.microsoft.com/download/symbols nlaapi.pdb D72AA69CD5ABE5D28C74FADB17DE3F8C1 SYMSRV: PATH: c:\src\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb SYMSRV: RESULT: 0x00000000 *** WARNING: Unable to verify checksum for NLAapi.dll DBGHELP: NLAapi - public symbols c:\src\symbols\nlaapi.pdb\D72AA69CD5ABE5D28C74FADB17DE3F8C1\nlaapi.pdb
So, windbg.exe uses the DBI age to detect mismatched pdb, but it still loads
the pdb even if the age mismatched. Probably lldb should do the same and give
some warnings.
This fixes a bug that lldb can't load some windows system pdbs due to mismatched
uuid.