llvm-capstone/lldb
Zequan Wu cb9a7c22ee [LLDB][PDB] Fix age field in UUID in PDB file.
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.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D152189
2023-06-06 11:24:50 -04:00
..
bindings [lldb] Fix lua build after 27b6a4e63a 2023-05-15 17:24:00 -07:00
cmake [lldb][cmake] Allow specifying custom libcxx for tests in standalone builds 2023-05-20 12:07:48 +01:00
docs [NFC][Py Reformat] Reformat python files in lldb 2023-05-25 12:54:09 -07:00
examples [lldb/crashlog] Run python formatter (nfc) 2023-06-01 17:13:16 -07:00
include [lldb][NFCI] Change the way Process stores StructuredData plugins 2023-06-05 13:49:58 -07:00
packages/Python/lldbsuite [NFC][Py Reformat] Reformat python files in lldb 2023-05-25 12:54:09 -07:00
resources [lldb][NFC] Remove copy of debugserver entitlements plist 2023-01-31 12:58:37 -08:00
scripts [lldb] Update QEMU git URL in setup.sh 2023-04-21 14:31:39 +00:00
source [LLDB][PDB] Fix age field in UUID in PDB file. 2023-06-06 11:24:50 -04:00
test [LLDB][PDB] Fix age field in UUID in PDB file. 2023-06-06 11:24:50 -04:00
third_party/Python/module [lldb] Remove legacy six module for py2->py3 2023-01-24 19:46:26 -08:00
tools Prevent some spurious error messages in the debugserver logs. 2023-06-01 10:21:23 -07:00
unittests [CMake] Ensure CLANG_RESOURCE_DIR is respected. 2023-06-03 04:21:35 -07:00
utils [NFC][TargetParser] Replace uses of llvm/Support/Host.h 2023-02-10 09:59:46 +00:00
.clang-format
.clang-tidy [LLDB] Applying clang-tidy modernize-use-override over LLDB 2022-04-22 13:29:47 -07:00
.gitignore
CMakeLists.txt Reland "[CMake] Bumps minimum version to 3.20.0. 2023-05-27 12:51:21 +02:00
CODE_OWNERS.txt [lldb] Add entry to code owner 2023-04-25 23:15:07 -07:00
LICENSE.TXT
use_lldb_suite_root.py