1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261
|
The test input (every-type.pdb) is generated from some short and trivial C++ code
that exercises the entire type system to generate every possible type record that
we claim to understand. We then test this in two ways:
1) We just dump the output for the purposes of readability. This tests that we
we can dump every possible type record.
2) We dump the output to yaml, and then re-generate a PDB with the same type
stream, and then run test 1 on the new PDB. This verifies that the PDB
hasn't changed.
RUN: llvm-pdbutil dump -type-index=0x101A,0x102C,0x103D,0x104D,0x1098,0x10AA,0x10AC \
RUN: -dont-resolve-forward-refs -dependents %p/Inputs/every-type.pdb \
RUN: | FileCheck --check-prefix=TYPES %s
RUN: llvm-pdbutil pdb2yaml -tpi-stream -ipi-stream %p/Inputs/every-type.pdb > %t.pdb.yaml
RUN: llvm-pdbutil yaml2pdb -pdb=%t.yaml.pdb %t.pdb.yaml
RUN: llvm-pdbutil dump -type-index=0x101A,0x102C,0x103D,0x104D,0x1098,0x10AA,0x10AC \
RUN: -dependents -dont-resolve-forward-refs %t.yaml.pdb \
RUN: | FileCheck --check-prefix=TYPES %s
TYPES: Types (TPI Stream)
TYPES-NEXT: ============================================================
TYPES-NEXT: Showing 7 records and their dependents (72 records total)
TYPES-NEXT: 0x1007 | LF_MODIFIER [size = 12]
TYPES-NEXT: referent = 0x0074 (int), modifiers = const
TYPES-NEXT: 0x1008 | LF_CLASS [size = 48] `FooClass`
TYPES-NEXT: unique name: `.?AVFooClass@@`
TYPES-NEXT: vtable: <no type>, base list: <no type>, field list: <no type>
TYPES-NEXT: options: forward ref | has unique name, sizeof 0
TYPES-NEXT: 0x1009 | LF_VTSHAPE [size = 8]
TYPES-NEXT: 0x100A | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x1009, mode = pointer, opts = None, kind = ptr64
TYPES-NEXT: 0x100B | LF_CLASS [size = 44] `Inherit`
TYPES-NEXT: unique name: `.?AVInherit@@`
TYPES-NEXT: vtable: <no type>, base list: <no type>, field list: <no type>
TYPES-NEXT: options: forward ref | has unique name, sizeof 0
TYPES-NEXT: 0x100C | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x100B, mode = pointer, opts = const, kind = ptr64
TYPES-NEXT: 0x100D | LF_ARGLIST [size = 8]
TYPES-NEXT: 0x100E | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x0003 (void), # args = 0, param list = 0x100D
TYPES-NEXT: class type = 0x100B, this type = 0x100C, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = None
TYPES-NEXT: 0x100F | LF_MODIFIER [size = 12]
TYPES-NEXT: referent = 0x100B, modifiers = const
TYPES-NEXT: 0x1010 | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x100F, mode = ref, opts = None, kind = ptr64
TYPES-NEXT: 0x1011 | LF_ARGLIST [size = 12]
TYPES-NEXT: 0x1010: `const Inherit&`
TYPES-NEXT: 0x1012 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x0003 (void), # args = 1, param list = 0x1011
TYPES-NEXT: class type = 0x100B, this type = 0x100C, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = constructor
TYPES-NEXT: 0x1013 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x0003 (void), # args = 0, param list = 0x100D
TYPES-NEXT: class type = 0x100B, this type = 0x100C, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = constructor
TYPES-NEXT: 0x1014 | LF_METHODLIST [size = 20]
TYPES-NEXT: - Method [type = 0x1012, vftable offset = -1, attrs = public compiler-generated]
TYPES-NEXT: - Method [type = 0x1013, vftable offset = -1, attrs = public compiler-generated]
TYPES-NEXT: 0x1015 | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x100B, mode = ref, opts = None, kind = ptr64
TYPES-NEXT: 0x1016 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x1015, # args = 1, param list = 0x1011
TYPES-NEXT: class type = 0x100B, this type = 0x100C, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = None
TYPES-NEXT: 0x1017 | LF_ARGLIST [size = 12]
TYPES-NEXT: 0x0075 (unsigned): `unsigned`
TYPES-NEXT: 0x1018 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x0603 (void*), # args = 1, param list = 0x1017
TYPES-NEXT: class type = 0x100B, this type = 0x100C, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = None
TYPES-NEXT: 0x1019 | LF_FIELDLIST [size = 152]
TYPES-NEXT: - LF_BCLASS
TYPES-NEXT: type = 0x1008, offset = 8, attrs = public
TYPES-NEXT: - LF_VFUNCTAB type = 0x100A
TYPES-NEXT: - LF_ONEMETHOD [name = `~Inherit`]
TYPES-NEXT: type = 0x100E, vftable offset = 0, attrs = public intro virtual
TYPES-NEXT: - LF_METHOD [name = `Inherit`, # overloads = 2, overload list = 0x1014]
TYPES-NEXT: - LF_ONEMETHOD [name = `operator=`]
TYPES-NEXT: type = 0x1016, vftable offset = -1, attrs = public compiler-generated
TYPES-NEXT: - LF_ONEMETHOD [name = `__local_vftable_ctor_closure`]
TYPES-NEXT: type = 0x100E, vftable offset = -1, attrs = public compiler-generated
TYPES-NEXT: - LF_ONEMETHOD [name = `__vecDelDtor`]
TYPES-NEXT: type = 0x1018, vftable offset = 0, attrs = public intro virtual compiler-generated
TYPES-NEXT: 0x101A | LF_CLASS [size = 44] `Inherit`
TYPES-NEXT: unique name: `.?AVInherit@@`
TYPES-NEXT: vtable: 0x1009, base list: <no type>, field list: 0x1019
TYPES-NEXT: options: has ctor / dtor | has unique name | overloaded operator | overloaded operator=, sizeof 16
TYPES-NEXT: 0x101B | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x1007, mode = pointer, opts = None, kind = ptr64
TYPES-NEXT: 0x101C | LF_CLASS [size = 48] `VInherit`
TYPES-NEXT: unique name: `.?AVVInherit@@`
TYPES-NEXT: vtable: <no type>, base list: <no type>, field list: <no type>
TYPES-NEXT: options: forward ref | has unique name, sizeof 0
TYPES-NEXT: 0x101D | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x101C, mode = pointer, opts = const, kind = ptr64
TYPES-NEXT: 0x101E | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x101C, mode = rvalue ref, opts = None, kind = ptr64
TYPES-NEXT: 0x101F | LF_ARGLIST [size = 12]
TYPES-NEXT: 0x101E: `VInherit&&`
TYPES-NEXT: 0x1020 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x0003 (void), # args = 1, param list = 0x101F
TYPES-NEXT: class type = 0x101C, this type = 0x101D, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = constructor with virtual bases | constructor
TYPES-NEXT: 0x1021 | LF_MODIFIER [size = 12]
TYPES-NEXT: referent = 0x101C, modifiers = const
TYPES-NEXT: 0x1022 | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x1021, mode = ref, opts = None, kind = ptr64
TYPES-NEXT: 0x1023 | LF_ARGLIST [size = 12]
TYPES-NEXT: 0x1022: `const VInherit&`
TYPES-NEXT: 0x1024 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x0003 (void), # args = 1, param list = 0x1023
TYPES-NEXT: class type = 0x101C, this type = 0x101D, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = constructor with virtual bases | constructor
TYPES-NEXT: 0x1025 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x0003 (void), # args = 0, param list = 0x100D
TYPES-NEXT: class type = 0x101C, this type = 0x101D, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = constructor with virtual bases | constructor
TYPES-NEXT: 0x1026 | LF_METHODLIST [size = 28]
TYPES-NEXT: - Method [type = 0x1020, vftable offset = -1, attrs = public compiler-generated]
TYPES-NEXT: - Method [type = 0x1024, vftable offset = -1, attrs = public compiler-generated]
TYPES-NEXT: - Method [type = 0x1025, vftable offset = -1, attrs = public compiler-generated]
TYPES-NEXT: 0x1027 | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x101C, mode = ref, opts = None, kind = ptr64
TYPES-NEXT: 0x1028 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x1027, # args = 1, param list = 0x101F
TYPES-NEXT: class type = 0x101C, this type = 0x101D, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = None
TYPES-NEXT: 0x1029 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x1027, # args = 1, param list = 0x1023
TYPES-NEXT: class type = 0x101C, this type = 0x101D, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = None
TYPES-NEXT: 0x102A | LF_METHODLIST [size = 20]
TYPES-NEXT: - Method [type = 0x1028, vftable offset = -1, attrs = public compiler-generated]
TYPES-NEXT: - Method [type = 0x1029, vftable offset = -1, attrs = public compiler-generated]
TYPES-NEXT: 0x102B | LF_FIELDLIST [size = 60]
TYPES-NEXT: - LF_VBCLASS
TYPES-NEXT: base = 0x1008, vbptr = 0x101B, vbptr offset = 0, vtable index = 1
TYPES-NEXT: attrs = public
TYPES-NEXT: - LF_METHOD [name = `VInherit`, # overloads = 3, overload list = 0x1026]
TYPES-NEXT: - LF_METHOD [name = `operator=`, # overloads = 2, overload list = 0x102A]
TYPES-NEXT: 0x102C | LF_CLASS [size = 48] `VInherit`
TYPES-NEXT: unique name: `.?AVVInherit@@`
TYPES-NEXT: vtable: <no type>, base list: <no type>, field list: 0x102B
TYPES-NEXT: options: has ctor / dtor | has unique name | overloaded operator | overloaded operator=, sizeof 16
TYPES-NEXT: 0x102D | LF_CLASS [size = 48] `IVInherit`
TYPES-NEXT: unique name: `.?AVIVInherit@@`
TYPES-NEXT: vtable: <no type>, base list: <no type>, field list: <no type>
TYPES-NEXT: options: forward ref | has unique name, sizeof 0
TYPES-NEXT: 0x102E | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x102D, mode = pointer, opts = const, kind = ptr64
TYPES-NEXT: 0x102F | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x102D, mode = rvalue ref, opts = None, kind = ptr64
TYPES-NEXT: 0x1030 | LF_ARGLIST [size = 12]
TYPES-NEXT: 0x102F: `IVInherit&&`
TYPES-NEXT: 0x1031 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x0003 (void), # args = 1, param list = 0x1030
TYPES-NEXT: class type = 0x102D, this type = 0x102E, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = constructor with virtual bases | constructor
TYPES-NEXT: 0x1032 | LF_MODIFIER [size = 12]
TYPES-NEXT: referent = 0x102D, modifiers = const
TYPES-NEXT: 0x1033 | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x1032, mode = ref, opts = None, kind = ptr64
TYPES-NEXT: 0x1034 | LF_ARGLIST [size = 12]
TYPES-NEXT: 0x1033: `const IVInherit&`
TYPES-NEXT: 0x1035 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x0003 (void), # args = 1, param list = 0x1034
TYPES-NEXT: class type = 0x102D, this type = 0x102E, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = constructor with virtual bases | constructor
TYPES-NEXT: 0x1036 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x0003 (void), # args = 0, param list = 0x100D
TYPES-NEXT: class type = 0x102D, this type = 0x102E, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = constructor with virtual bases | constructor
TYPES-NEXT: 0x1037 | LF_METHODLIST [size = 28]
TYPES-NEXT: - Method [type = 0x1031, vftable offset = -1, attrs = public compiler-generated]
TYPES-NEXT: - Method [type = 0x1035, vftable offset = -1, attrs = public compiler-generated]
TYPES-NEXT: - Method [type = 0x1036, vftable offset = -1, attrs = public compiler-generated]
TYPES-NEXT: 0x1038 | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x102D, mode = ref, opts = None, kind = ptr64
TYPES-NEXT: 0x1039 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x1038, # args = 1, param list = 0x1030
TYPES-NEXT: class type = 0x102D, this type = 0x102E, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = None
TYPES-NEXT: 0x103A | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x1038, # args = 1, param list = 0x1034
TYPES-NEXT: class type = 0x102D, this type = 0x102E, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = None
TYPES-NEXT: 0x103B | LF_METHODLIST [size = 20]
TYPES-NEXT: - Method [type = 0x1039, vftable offset = -1, attrs = public compiler-generated]
TYPES-NEXT: - Method [type = 0x103A, vftable offset = -1, attrs = public compiler-generated]
TYPES-NEXT: 0x103C | LF_FIELDLIST [size = 72]
TYPES-NEXT: - LF_BCLASS
TYPES-NEXT: type = 0x101C, offset = 0, attrs = public
TYPES-NEXT: - LF_IVBCLASS
TYPES-NEXT: base = 0x1008, vbptr = 0x101B, vbptr offset = 0, vtable index = 1
TYPES-NEXT: attrs = public
TYPES-NEXT: - LF_METHOD [name = `IVInherit`, # overloads = 3, overload list = 0x1037]
TYPES-NEXT: - LF_METHOD [name = `operator=`, # overloads = 2, overload list = 0x103B]
TYPES-NEXT: 0x103D | LF_CLASS [size = 48] `IVInherit`
TYPES-NEXT: unique name: `.?AVIVInherit@@`
TYPES-NEXT: vtable: <no type>, base list: <no type>, field list: 0x103C
TYPES-NEXT: options: has ctor / dtor | has unique name | overloaded operator | overloaded operator=, sizeof 16
TYPES-NEXT: 0x1041 | LF_FIELDLIST [size = 28]
TYPES-NEXT: - LF_ENUMERATE [A = 0]
TYPES-NEXT: - LF_ENUMERATE [B = 1]
TYPES-NEXT: - LF_ENUMERATE [C = 2]
TYPES-NEXT: 0x1042 | LF_ENUM [size = 64] `FooClass::NestedEnum`
TYPES-NEXT: unique name: `.?AW4NestedEnum@FooClass@@`
TYPES-NEXT: field list: 0x1041, underlying type: 0x0074 (int)
TYPES-NEXT: options: has unique name | is nested
TYPES-NEXT: 0x1043 | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x1008, mode = pointer, opts = const, kind = ptr64
TYPES-NEXT: 0x1044 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x0003 (void), # args = 0, param list = 0x100D
TYPES-NEXT: class type = 0x1008, this type = 0x1043, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = None
TYPES-NEXT: 0x1045 | LF_ARGLIST [size = 16]
TYPES-NEXT: 0x0074 (int): `int`
TYPES-NEXT: 0x0074 (int): `int`
TYPES-NEXT: 0x1046 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x0003 (void), # args = 2, param list = 0x1045
TYPES-NEXT: class type = 0x1008, this type = 0x1043, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = None
TYPES-NEXT: 0x1047 | LF_ARGLIST [size = 12]
TYPES-NEXT: 0x0074 (int): `int`
TYPES-NEXT: 0x1048 | LF_MFUNCTION [size = 28]
TYPES-NEXT: return type = 0x0003 (void), # args = 1, param list = 0x1047
TYPES-NEXT: class type = 0x1008, this type = 0x1043, this adjust = 0
TYPES-NEXT: calling conv = cdecl, options = None
TYPES-NEXT: 0x1049 | LF_METHODLIST [size = 20]
TYPES-NEXT: - Method [type = 0x1046, vftable offset = -1, attrs = public]
TYPES-NEXT: - Method [type = 0x1048, vftable offset = -1, attrs = public]
TYPES-NEXT: 0x104A | LF_BITFIELD [size = 12]
TYPES-NEXT: type = 0x0074 (int), bit offset = 0, # bits = 4
TYPES-NEXT: 0x104B | LF_BITFIELD [size = 12]
TYPES-NEXT: type = 0x0074 (int), bit offset = 4, # bits = 4
TYPES-NEXT: 0x104C | LF_FIELDLIST [size = 164]
TYPES-NEXT: - LF_NESTTYPE [name = `NestedEnum`, parent = 0x1042]
TYPES-NEXT: - LF_ONEMETHOD [name = `RegularMethod`]
TYPES-NEXT: type = 0x1044, vftable offset = -1, attrs = public
TYPES-NEXT: - LF_METHOD [name = `OverloadedMethod`, # overloads = 2, overload list = 0x1049]
TYPES-NEXT: - LF_MEMBER [name = `HiNibble`, Type = 0x104A, offset = 0, attrs = public]
TYPES-NEXT: - LF_MEMBER [name = `LoNibble`, Type = 0x104B, offset = 0, attrs = public]
TYPES-NEXT: - LF_MEMBER [name = `EnumVariable`, Type = 0x1042, offset = 4, attrs = public]
TYPES-NEXT: - LF_STMEMBER [name = `StaticMember`, type = 0x0603 (void*), attrs = public]
TYPES-NEXT: 0x104D | LF_CLASS [size = 48] `FooClass`
TYPES-NEXT: unique name: `.?AVFooClass@@`
TYPES-NEXT: vtable: <no type>, base list: <no type>, field list: 0x104C
TYPES-NEXT: options: contains nested class | has unique name, sizeof 8
TYPES-NEXT: 0x1098 | LF_UNION [size = 40] `TheUnion`
TYPES-NEXT: unique name: `.?ATTheUnion@@`
TYPES-NEXT: field list: <no type>
TYPES-NEXT: options: forward ref | has unique name, sizeof 0
TYPES-NEXT: 0x10AA | LF_PROCEDURE [size = 16]
TYPES-NEXT: return type = 0x0003 (void), # args = 0, param list = 0x100D
TYPES-NEXT: calling conv = cdecl, options = None
TYPES-NEXT: 0x10AB | LF_POINTER [size = 12]
TYPES-NEXT: referent = 0x10AA, mode = pointer, opts = const, kind = ptr64
TYPES-NEXT: 0x10AC | LF_ARRAY [size = 16]
TYPES-NEXT: size: 8, index type: 0x0023 (unsigned __int64), element type: 0x10AB
|