diff options
| author | Reid Kleckner <rnk@google.com> | 2017-04-11 16:26:15 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2017-04-11 16:26:15 +0000 |
| commit | 6e545ffc4e99b16cab6494eba21dd3b6cf06ee68 (patch) | |
| tree | 90459834c4fa5cc9175e13e308fe91ddb246c659 /llvm/test/DebugInfo/PDB | |
| parent | 83d37dc0662ceb4489fceda0d3044a08ef5a6159 (diff) | |
| download | bcm5719-llvm-6e545ffc4e99b16cab6494eba21dd3b6cf06ee68.tar.gz bcm5719-llvm-6e545ffc4e99b16cab6494eba21dd3b6cf06ee68.zip | |
[PDB] Emit index/offset pairs for TPI and IPI streams
Summary:
This lets PDB readers lookup type record data by type index in O(log n)
time. It also enables makes `cvdump -t` work on PDBs produced by LLD.
cvdump will not dump a PDB that doesn't have an index-to-offset table.
The table is sorted by type index, and has an entry every 8KB. Looking
up a type record by index is a binary search of this table, followed by
a scan of at most 8KB.
Reviewers: ruiu, zturner, inglorion
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31636
llvm-svn: 299958
Diffstat (limited to 'llvm/test/DebugInfo/PDB')
| -rw-r--r-- | llvm/test/DebugInfo/PDB/pdb-yaml-types.test | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/llvm/test/DebugInfo/PDB/pdb-yaml-types.test b/llvm/test/DebugInfo/PDB/pdb-yaml-types.test new file mode 100644 index 00000000000..b3108591271 --- /dev/null +++ b/llvm/test/DebugInfo/PDB/pdb-yaml-types.test @@ -0,0 +1,74 @@ +RUN: llvm-pdbdump pdb2yaml -tpi-stream %p/Inputs/big-read.pdb > %t.yaml +RUN: FileCheck -check-prefix=YAML %s < %t.yaml +RUN: llvm-pdbdump yaml2pdb %t.yaml -pdb %t.pdb +RUN: llvm-pdbdump raw -tpi-records %t.pdb | FileCheck %s --check-prefix=PDB + +Only verify the beginning of the type stream. + +YAML: TpiStream: +YAML-NEXT: Version: VC80 +YAML-NEXT: Records: +YAML-NEXT: - Kind: LF_ARGLIST +YAML-NEXT: ArgList: +YAML-NEXT: ArgIndices: [ ] +YAML-NEXT: - Kind: LF_PROCEDURE +YAML-NEXT: Procedure: +YAML-NEXT: ReturnType: 3 +YAML-NEXT: CallConv: NearC +YAML-NEXT: Options: [ None ] +YAML-NEXT: ParameterCount: 0 +YAML-NEXT: ArgumentList: 4096 +YAML-NEXT: - Kind: LF_PROCEDURE +YAML-NEXT: Procedure: +YAML-NEXT: ReturnType: 116 +YAML-NEXT: CallConv: NearC +YAML-NEXT: Options: [ None ] +YAML-NEXT: ParameterCount: 0 +YAML-NEXT: ArgumentList: 4096 + +This test is mostly checking to make sure we include the type index offset +table, and eventually hash codes. The type index offsets should be similar to +what are already present in big-read.pdb. + +PDB: Type Info Stream (TPI) { +PDB-NEXT: TPI Version: 20040203 +PDB-NEXT: Record count: 728 +PDB-NEXT: Records [ +PDB-NEXT: { +PDB-NEXT: ArgList (0x1000) { +PDB-NEXT: TypeLeafKind: LF_ARGLIST (0x1201) +PDB-NEXT: NumArgs: 0 +PDB-NEXT: Arguments [ +PDB-NEXT: ] +PDB-NEXT: } +PDB-NEXT: } +PDB-NEXT: { +PDB-NEXT: Procedure (0x1001) { +PDB-NEXT: TypeLeafKind: LF_PROCEDURE (0x1008) +PDB-NEXT: ReturnType: void (0x3) +PDB-NEXT: CallingConvention: NearC (0x0) +PDB-NEXT: FunctionOptions [ (0x0) +PDB-NEXT: ] +PDB-NEXT: NumParameters: 0 +PDB-NEXT: ArgListType: () (0x1000) +PDB-NEXT: } +PDB-NEXT: } +PDB-NEXT: { +PDB-NEXT: Procedure (0x1002) { +PDB-NEXT: TypeLeafKind: LF_PROCEDURE (0x1008) +PDB-NEXT: ReturnType: int (0x74) +PDB-NEXT: CallingConvention: NearC (0x0) +PDB-NEXT: FunctionOptions [ (0x0) +PDB-NEXT: ] +PDB-NEXT: NumParameters: 0 +PDB-NEXT: ArgListType: () (0x1000) +PDB-NEXT: } +PDB-NEXT: } +... +PDB: TypeIndexOffsets [ +PDB-NEXT: Index: 0x1000, Offset: 0 +PDB-NEXT: Index: 0x106c, Offset: 8,116 +PDB-NEXT: Index: 0x1118, Offset: 16,372 +PDB-NEXT: Index: 0x11df, Offset: 24,564 +PDB-NEXT: Index: 0x128e, Offset: 32,752 +PDB-NEXT: ] |

