llvm-project/lld/test/COFF/pdb.test

410 lines
14 KiB
Plaintext
Raw Normal View History

# RUN: yaml2obj < %p/Inputs/pdb1.yaml > %t1.obj
# RUN: yaml2obj < %p/Inputs/pdb2.yaml > %t2.obj
# RUN: lld-link /debug /pdb:%t.pdb /dll /out:%t.dll /entry:main /nodefaultlib \
# RUN: %t1.obj %t2.obj
# RUN: llvm-pdbutil pdb2yaml -stream-metadata -stream-directory -pdb-stream \
# RUN: -dbi-stream -ipi-stream -tpi-stream %t.pdb | FileCheck %s
# RUN: llvm-pdbutil raw -modules -section-map -section-headers -section-contribs \
# RUN: -tpi-records %t.pdb | FileCheck -check-prefix RAW %s
# CHECK: MSF:
# CHECK-NEXT: SuperBlock:
# CHECK-NEXT: BlockSize: 4096
# CHECK-NEXT: FreeBlockMap: 1
# CHECK-NEXT: NumBlocks:
# CHECK-NEXT: NumDirectoryBytes:
# CHECK-NEXT: Unknown1: 0
# CHECK-NEXT: BlockMapAddr:
# CHECK-NEXT: NumDirectoryBlocks:
# CHECK-NEXT: DirectoryBlocks:
# CHECK-NEXT: NumStreams:
# CHECK-NEXT: FileSize:
# CHECK-NEXT: StreamSizes:
# CHECK-NEXT: StreamMap:
# CHECK: PdbStream:
# CHECK-NEXT: Age: 1
# CHECK-NEXT: Guid:
# CHECK-NEXT: Signature: 0
# CHECK-NEXT: Version: VC70
# CHECK-NEXT: DbiStream:
# CHECK-NEXT: VerHeader: V110
# CHECK-NEXT: Age: 1
# CHECK-NEXT: BuildNumber: 0
# CHECK-NEXT: PdbDllVersion: 0
# CHECK-NEXT: PdbDllRbld: 0
# CHECK-NEXT: Flags: 0
# CHECK-NEXT: MachineType: x86
# CHECK-NEXT: TpiStream:
# CHECK-NEXT: Version: VC80
# CHECK-NEXT: Records:
# CHECK-NEXT: - Kind: LF_ARGLIST
# CHECK-NEXT: ArgList:
# CHECK-NEXT: ArgIndices: [ ]
# CHECK-NEXT: - Kind: LF_PROCEDURE
# CHECK-NEXT: Procedure:
# CHECK-NEXT: ReturnType: 116
# CHECK-NEXT: CallConv: NearC
# CHECK-NEXT: Options: [ None ]
# CHECK-NEXT: ParameterCount: 0
# CHECK-NEXT: ArgumentList: 4096
# CHECK-NEXT: - Kind: LF_POINTER
# CHECK-NEXT: Pointer:
# CHECK-NEXT: ReferentType: 4097
# CHECK-NEXT: Attrs: 65548
# CHECK-NEXT: - Kind: LF_ARGLIST
# CHECK-NEXT: ArgList:
# CHECK-NEXT: ArgIndices: [ 0 ]
# CHECK-NEXT: - Kind: LF_PROCEDURE
# CHECK-NEXT: Procedure:
# CHECK-NEXT: ReturnType: 116
# CHECK-NEXT: CallConv: NearC
# CHECK-NEXT: Options: [ None ]
# CHECK-NEXT: ParameterCount: 0
# CHECK-NEXT: ArgumentList: 4099
# CHECK-NEXT: IpiStream:
# CHECK-NEXT: Version: VC80
# CHECK-NEXT: Records:
# CHECK-NEXT: - Kind: LF_FUNC_ID
# CHECK-NEXT: FuncId:
# CHECK-NEXT: ParentScope: 0
# CHECK-NEXT: FunctionType: 4100
# CHECK-NEXT: Name: main
# CHECK-NEXT: - Kind: LF_FUNC_ID
# CHECK-NEXT: FuncId:
# CHECK-NEXT: ParentScope: 0
# CHECK-NEXT: FunctionType: 4097
# CHECK-NEXT: Name: foo
# CHECK-NEXT: - Kind: LF_STRING_ID
# CHECK-NEXT: StringId:
# CHECK-NEXT: Id: 0
# CHECK-NEXT: String: 'D:\b'
# CHECK-NEXT: - Kind: LF_STRING_ID
# CHECK-NEXT: StringId:
# CHECK-NEXT: Id: 0
# CHECK-NEXT: String: 'C:\vs14\VC\BIN\amd64\cl.exe'
# CHECK-NEXT: - Kind: LF_STRING_ID
# CHECK-NEXT: StringId:
# CHECK-NEXT: Id: 0
# CHECK-NEXT: String: '-Z7 -c -MT -IC:\vs14\VC\INCLUDE -IC:\vs14\VC\ATLMFC\INCLUDE -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10150.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" -I"C:\Program Files (x86)\Windows Kits\8.1\include\shared"'
# CHECK-NEXT: - Kind: LF_SUBSTR_LIST
# CHECK-NEXT: StringList:
# CHECK-NEXT: StringIndices: [ 4100 ]
# CHECK-NEXT: - Kind: LF_STRING_ID
# CHECK-NEXT: StringId:
# CHECK-NEXT: Id: 4101
# CHECK-NEXT: String: ' -I"C:\Program Files (x86)\Windows Kits\8.1\include\um" -I"C:\Program Files (x86)\Windows Kits\8.1\include\winrt" -TC -X'
# CHECK-NEXT: - Kind: LF_STRING_ID
# CHECK-NEXT: StringId:
# CHECK-NEXT: Id: 0
# CHECK-NEXT: String: ret42-main.c
# CHECK-NEXT: - Kind: LF_STRING_ID
# CHECK-NEXT: StringId:
# CHECK-NEXT: Id: 0
# CHECK-NEXT: String: 'D:\b\vc140.pdb'
# CHECK-NEXT: - Kind: LF_BUILDINFO
# CHECK-NEXT: BuildInfo:
# CHECK-NEXT: ArgIndices: [ 4098, 4099, 4103, 4104, 4102 ]
# CHECK-NEXT: - Kind: LF_STRING_ID
# CHECK-NEXT: StringId:
# CHECK-NEXT: Id: 0
# CHECK-NEXT: String: ret42-sub.c
# CHECK-NEXT: - Kind: LF_BUILDINFO
# CHECK-NEXT: BuildInfo:
# CHECK-NEXT: ArgIndices: [ 4098, 4099, 4106, 4104, 4102 ]
# RAW: Type Info Stream (TPI) {
# RAW-NEXT: TPI Version: 20040203
# RAW-NEXT: Record count: 5
# RAW-NEXT: Records [
# RAW-NEXT: {
# RAW-NEXT: ArgList (0x1000) {
# RAW-NEXT: TypeLeafKind: LF_ARGLIST (0x1201)
# RAW-NEXT: NumArgs: 0
# RAW-NEXT: Arguments [
# RAW-NEXT: ]
# RAW-NEXT: }
# RAW-NEXT: }
# RAW-NEXT: {
# RAW-NEXT: Procedure (0x1001) {
# RAW-NEXT: TypeLeafKind: LF_PROCEDURE (0x1008)
# RAW-NEXT: ReturnType: int (0x74)
# RAW-NEXT: CallingConvention: NearC (0x0)
# RAW-NEXT: FunctionOptions [ (0x0)
# RAW-NEXT: ]
# RAW-NEXT: NumParameters: 0
# RAW-NEXT: ArgListType: () (0x1000)
# RAW-NEXT: }
# RAW-NEXT: }
# RAW-NEXT: {
# RAW-NEXT: Pointer (0x1002) {
# RAW-NEXT: TypeLeafKind: LF_POINTER (0x1002)
# RAW-NEXT: PointeeType: int () (0x1001)
# RAW-NEXT: PointerAttributes: 0x1000C
# RAW-NEXT: PtrType: Near64 (0xC)
# RAW-NEXT: PtrMode: Pointer (0x0)
# RAW-NEXT: IsFlat: 0
# RAW-NEXT: IsConst: 0
# RAW-NEXT: IsVolatile: 0
# RAW-NEXT: IsUnaligned: 0
# RAW-NEXT: SizeOf: 8
# RAW-NEXT: }
# RAW-NEXT: }
# RAW-NEXT: {
# RAW-NEXT: ArgList (0x1003) {
# RAW-NEXT: TypeLeafKind: LF_ARGLIST (0x1201)
# RAW-NEXT: NumArgs: 1
# RAW-NEXT: Arguments [
# RAW-NEXT: ArgType: 0x0
# RAW-NEXT: ]
# RAW-NEXT: }
# RAW-NEXT: }
# RAW-NEXT: {
# RAW-NEXT: Procedure (0x1004) {
# RAW-NEXT: TypeLeafKind: LF_PROCEDURE (0x1008)
# RAW-NEXT: ReturnType: int (0x74)
# RAW-NEXT: CallingConvention: NearC (0x0)
# RAW-NEXT: FunctionOptions [ (0x0)
# RAW-NEXT: ]
# RAW-NEXT: NumParameters: 0
# RAW-NEXT: ArgListType: (<no type>) (0x1003)
# RAW-NEXT: }
# RAW-NEXT: }
# RAW-NEXT: TypeIndexOffsets [
# RAW-NEXT: Index: 0x1000, Offset: 0
# RAW-NEXT: ]
# RAW-NEXT: ]
# RAW-NEXT: }
# RAW-NEXT: DBI Stream {
# RAW-NEXT: Dbi Version: 20091201
# RAW-NEXT: Age: 1
# RAW-NEXT: Incremental Linking: No
# RAW-NEXT: Has CTypes: No
# RAW-NEXT: Is Stripped: No
# RAW-NEXT: Machine Type: x86
# RAW-NEXT: Symbol Record Stream Index: 65535
# RAW-NEXT: Public Symbol Stream Index: 65535
# RAW-NEXT: Global Symbol Stream Index: 65535
# RAW-NEXT: Toolchain Version: 0.0
# RAW-NEXT: mspdb00.dll version: 0.0.0
# RAW-NEXT: Modules [
# RAW-NEXT: {
# RAW-NEXT: Name: * Linker *
# RAW-NEXT: Debug Stream Index: 9
# RAW-NEXT: Object File Name:
# RAW-NEXT: Num Files: 0
# RAW-NEXT: Source File Name Idx: 0
# RAW-NEXT: Pdb File Name Idx: 0
# RAW-NEXT: Line Info Byte Size: 0
# RAW-NEXT: C13 Line Info Byte Size: 0
# RAW-NEXT: Symbol Byte Size: 4
# RAW-NEXT: Type Server Index: 0
# RAW-NEXT: Has EC Info: No
# RAW-NEXT: }
# RAW-NEXT: ]
# RAW-NEXT: }
# RAW-NEXT: Section Contributions [
# RAW-NEXT: Contribution {
# RAW-NEXT: ISect: 0
# RAW-NEXT: Off: 1288
# RAW-NEXT: Size: 14
# RAW-NEXT: Characteristics [ (0x60500020)
# RAW-NEXT: IMAGE_SCN_ALIGN_16BYTES (0x500000)
# RAW-NEXT: IMAGE_SCN_CNT_CODE (0x20)
# RAW-NEXT: IMAGE_SCN_MEM_EXECUTE (0x20000000)
# RAW-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
# RAW-NEXT: ]
# RAW-NEXT: Module {
# RAW-NEXT: Index: 0
# RAW-NEXT: Name: * Linker *
# RAW-NEXT: }
# RAW-NEXT: Data CRC: 0
# RAW-NEXT: Reloc CRC: 0
# RAW-NEXT: }
# RAW-NEXT: Contribution {
# RAW-NEXT: ISect: 0
# RAW-NEXT: Off: 1312
# RAW-NEXT: Size: 8
# RAW-NEXT: Characteristics [ (0x40300040)
# RAW-NEXT: IMAGE_SCN_ALIGN_4BYTES (0x300000)
# RAW-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA (0x40)
# RAW-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
# RAW-NEXT: ]
# RAW-NEXT: Module {
# RAW-NEXT: Index: 0
# RAW-NEXT: Name: * Linker *
# RAW-NEXT: }
# RAW-NEXT: Data CRC: 0
# RAW-NEXT: Reloc CRC: 0
# RAW-NEXT: }
# RAW-NEXT: Contribution {
# RAW-NEXT: ISect: 0
# RAW-NEXT: Off: 1320
# RAW-NEXT: Size: 12
# RAW-NEXT: Characteristics [ (0x40300040)
# RAW-NEXT: IMAGE_SCN_ALIGN_4BYTES (0x300000)
# RAW-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA (0x40)
# RAW-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
# RAW-NEXT: ]
# RAW-NEXT: Module {
# RAW-NEXT: Index: 0
# RAW-NEXT: Name: * Linker *
# RAW-NEXT: }
# RAW-NEXT: Data CRC: 0
# RAW-NEXT: Reloc CRC: 0
# RAW-NEXT: }
# RAW-NEXT: Contribution {
# RAW-NEXT: ISect: 0
# RAW-NEXT: Off: 1144
# RAW-NEXT: Size: 6
# RAW-NEXT: Characteristics [ (0x60500020)
# RAW-NEXT: IMAGE_SCN_ALIGN_16BYTES (0x500000)
# RAW-NEXT: IMAGE_SCN_CNT_CODE (0x20)
# RAW-NEXT: IMAGE_SCN_MEM_EXECUTE (0x20000000)
# RAW-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
# RAW-NEXT: ]
# RAW-NEXT: Module {
# RAW-NEXT: Index: 0
# RAW-NEXT: Name: * Linker *
# RAW-NEXT: }
# RAW-NEXT: Data CRC: 0
# RAW-NEXT: Reloc CRC: 0
# RAW-NEXT: }
# RAW-NEXT: ]
# RAW-NEXT: Section Map [
# RAW-NEXT: Entry {
# RAW-NEXT: Flags [ (0x109)
# RAW-NEXT: AddressIs32Bit (0x8)
# RAW-NEXT: IsSelector (0x100)
# RAW-NEXT: Read (0x1)
# RAW-NEXT: ]
# RAW-NEXT: Ovl: 0
# RAW-NEXT: Group: 0
# RAW-NEXT: Frame: 1
# RAW-NEXT: SecName: 65535
# RAW-NEXT: ClassName: 65535
# RAW-NEXT: Offset: 0
# RAW-NEXT: SecByteLength: 12
# RAW-NEXT: }
# RAW-NEXT: Entry {
# RAW-NEXT: Flags [ (0x10D)
# RAW-NEXT: AddressIs32Bit (0x8)
# RAW-NEXT: Execute (0x4)
# RAW-NEXT: IsSelector (0x100)
# RAW-NEXT: Read (0x1)
# RAW-NEXT: ]
# RAW-NEXT: Ovl: 0
# RAW-NEXT: Group: 0
# RAW-NEXT: Frame: 2
# RAW-NEXT: SecName: 65535
# RAW-NEXT: ClassName: 65535
# RAW-NEXT: Offset: 0
# RAW-NEXT: SecByteLength: 22
# RAW-NEXT: }
# RAW-NEXT: Entry {
# RAW-NEXT: Flags [ (0x109)
# RAW-NEXT: AddressIs32Bit (0x8)
# RAW-NEXT: IsSelector (0x100)
# RAW-NEXT: Read (0x1)
# RAW-NEXT: ]
# RAW-NEXT: Ovl: 0
# RAW-NEXT: Group: 0
# RAW-NEXT: Frame: 3
# RAW-NEXT: SecName: 65535
# RAW-NEXT: ClassName: 65535
# RAW-NEXT: Offset: 0
# RAW-NEXT: SecByteLength: 8
# RAW-NEXT: }
# RAW-NEXT: Entry {
# RAW-NEXT: Flags [ (0x109)
# RAW-NEXT: AddressIs32Bit (0x8)
# RAW-NEXT: IsSelector (0x100)
# RAW-NEXT: Read (0x1)
# RAW-NEXT: ]
# RAW-NEXT: Ovl: 0
# RAW-NEXT: Group: 0
# RAW-NEXT: Frame: 4
# RAW-NEXT: SecName: 65535
# RAW-NEXT: ClassName: 65535
# RAW-NEXT: Offset: 0
# RAW-NEXT: SecByteLength:
# RAW-NEXT: }
# RAW-NEXT: Entry {
# RAW-NEXT: Flags [ (0x208)
# RAW-NEXT: AddressIs32Bit (0x8)
# RAW-NEXT: IsAbsoluteAddress (0x200)
# RAW-NEXT: ]
# RAW-NEXT: Ovl: 0
# RAW-NEXT: Group: 0
# RAW-NEXT: Frame: 5
# RAW-NEXT: SecName: 65535
# RAW-NEXT: ClassName: 65535
# RAW-NEXT: Offset: 0
# RAW-NEXT: SecByteLength: 4294967295
# RAW-NEXT: }
# RAW-NEXT: ]
# RAW-NEXT: Section Headers [
# RAW-NEXT: {
# RAW-NEXT: Name: .pdata
# RAW-NEXT: Virtual Size: 12
# RAW-NEXT: Virtual Address: 4096
# RAW-NEXT: Size of Raw Data: 512
# RAW-NEXT: File Pointer to Raw Data: 1024
# RAW-NEXT: File Pointer to Relocations: 0
# RAW-NEXT: File Pointer to Linenumbers: 0
# RAW-NEXT: Number of Relocations: 0
# RAW-NEXT: Number of Linenumbers: 0
# RAW-NEXT: Characteristics [ (0x40000040)
# RAW-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA (0x40)
# RAW-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
# RAW-NEXT: ]
# RAW-NEXT: }
# RAW-NEXT: {
# RAW-NEXT: Name: .text
# RAW-NEXT: Virtual Size: 22
# RAW-NEXT: Virtual Address: 8192
# RAW-NEXT: Size of Raw Data: 512
# RAW-NEXT: File Pointer to Raw Data: 1536
# RAW-NEXT: File Pointer to Relocations: 0
# RAW-NEXT: File Pointer to Linenumbers: 0
# RAW-NEXT: Number of Relocations: 0
# RAW-NEXT: Number of Linenumbers: 0
# RAW-NEXT: Characteristics [ (0x60000020)
# RAW-NEXT: IMAGE_SCN_CNT_CODE (0x20)
# RAW-NEXT: IMAGE_SCN_MEM_EXECUTE (0x20000000)
# RAW-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
# RAW-NEXT: ]
# RAW-NEXT: }
# RAW-NEXT: {
# RAW-NEXT: Name: .xdata
# RAW-NEXT: Virtual Size: 8
# RAW-NEXT: Virtual Address: 12288
# RAW-NEXT: Size of Raw Data: 512
# RAW-NEXT: File Pointer to Raw Data: 2048
# RAW-NEXT: File Pointer to Relocations: 0
# RAW-NEXT: File Pointer to Linenumbers: 0
# RAW-NEXT: Number of Relocations: 0
# RAW-NEXT: Number of Linenumbers: 0
# RAW-NEXT: Characteristics [ (0x40000040)
# RAW-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA (0x40)
# RAW-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
# RAW-NEXT: ]
# RAW-NEXT: }
# RAW-NEXT: {
# RAW-NEXT: Name: .rdata
# RAW-NEXT: Virtual Size:
# RAW-NEXT: Virtual Address: 16384
# RAW-NEXT: Size of Raw Data: 512
# RAW-NEXT: File Pointer to Raw Data: 2560
# RAW-NEXT: File Pointer to Relocations: 0
# RAW-NEXT: File Pointer to Linenumbers: 0
# RAW-NEXT: Number of Relocations: 0
# RAW-NEXT: Number of Linenumbers: 0
# RAW-NEXT: Characteristics [ (0x40000040)
# RAW-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA (0x40)
# RAW-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
# RAW-NEXT: ]
# RAW-NEXT: }
# RAW-NEXT: ]