• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# // Compile with clang-cl -m32 /Z7 /GS- /c t.obj pdb-framedata.cpp
2#
3# int func(int x, int y) {
4#  return x + y;
5# }
6#
7# int main(int argc, char **argv) {
8#   return func(argc, argc+1);
9# }
10
11# RUN: yaml2obj %s -o %t.obj
12# RUN: lld-link %t.obj -debug -entry:main -nodefaultlib -debug -out:%t.exe -pdb:%t.pdb
13# RUN: llvm-pdbutil dump -fpo %t.pdb | FileCheck %s
14
15# CHECK:                         New FPO Data
16# CHECK-NEXT: ============================================================
17# CHECK-NEXT:   RVA    | Code | Locals | Params | Stack | Prolog | Saved Regs | Has SEH | Has C++EH | Start | Program
18# CHECK-NEXT: 00001000 |   31 |      0 |      8 |     0 |      6 |          0 |   false |     false | false | $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
19# CHECK-NEXT: 00001001 |   30 |      0 |      8 |     0 |      5 |          4 |   false |     false | false | $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ =
20# CHECK-NEXT: 00001003 |   28 |      0 |      8 |     0 |      3 |          4 |   false |     false | false | $T0 $ebp 4 + = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ =
21# CHECK-NEXT: 00001020 |   53 |      0 |      8 |     0 |      7 |          0 |   false |     false | false | $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
22# CHECK-NEXT: 00001021 |   52 |      0 |      8 |     0 |      6 |          4 |   false |     false | false | $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ =
23# CHECK-NEXT: 00001023 |   50 |      0 |      8 |     0 |      4 |          4 |   false |     false | false | $T0 $ebp 4 + = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ =
24# CHECK-NEXT: 00001024 |   49 |      0 |      8 |     0 |      3 |          8 |   false |     false | false | $T0 $ebp 4 + = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = $esi $T0 8 - ^ =
25
26
27--- !COFF
28header:
29  Machine:         IMAGE_FILE_MACHINE_I386
30  Characteristics: [  ]
31sections:
32  - Name:            .text
33    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
34    Alignment:       16
35    SectionData:     5589E583EC088B450C8B4D088B550803550C8945FC89D0894DF883C4085DC3905589E55683EC148B450C8B4D08C745F8000000008B550883C2018B7508893424895424048945F4894DF0E80000000083C4145E5DC3
36    Relocations:
37      - VirtualAddress:  75
38        SymbolName:      '?func@@YAHHH@Z'
39        Type:            IMAGE_REL_I386_REL32
40  - Name:            .data
41    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
42    Alignment:       4
43    SectionData:     ''
44  - Name:            .bss
45    Characteristics: [ IMAGE_SCN_CNT_UNINITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
46    Alignment:       4
47    SectionData:     ''
48  - Name:            .drectve
49    Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
50    Alignment:       1
51    SectionData:     202F44454641554C544C49423A6C6962636D742E6C6962202F44454641554C544C49423A6F6C646E616D65732E6C6962
52  - Name:            '.debug$S'
53    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
54    Alignment:       4
55    Subsections:
56      - !Symbols
57        Records:
58          - Kind:            S_COMPILE3
59            Compile3Sym:
60              Flags:           [  ]
61              Machine:         Pentium3
62              FrontendMajor:   8
63              FrontendMinor:   0
64              FrontendBuild:   0
65              FrontendQFE:     0
66              BackendMajor:    8000
67              BackendMinor:    0
68              BackendBuild:    0
69              BackendQFE:      0
70              Version:         'clang version 8.0.0 '
71      - !FrameData
72        Frames:
73          - CodeSize:        31
74            FrameFunc:       '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = '
75            LocalSize:       0
76            MaxStackSize:    0
77            ParamsSize:      8
78            PrologSize:      6
79            RvaStart:        0
80            SavedRegsSize:   0
81          - CodeSize:        30
82            FrameFunc:       '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = '
83            LocalSize:       0
84            MaxStackSize:    0
85            ParamsSize:      8
86            PrologSize:      5
87            RvaStart:        1
88            SavedRegsSize:   4
89          - CodeSize:        28
90            FrameFunc:       '$T0 $ebp 4 + = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = '
91            LocalSize:       0
92            MaxStackSize:    0
93            ParamsSize:      8
94            PrologSize:      3
95            RvaStart:        3
96            SavedRegsSize:   4
97      - !Symbols
98        Records:
99          - Kind:            S_GPROC32_ID
100            ProcSym:
101              CodeSize:        31
102              DbgStart:        0
103              DbgEnd:          0
104              FunctionType:    4098
105              Flags:           [  ]
106              DisplayName:     func
107          - Kind:            S_LOCAL
108            LocalSym:
109              Type:            116
110              Flags:           [ IsParameter ]
111              VarName:         x
112          - Kind:            S_DEFRANGE_REGISTER_REL
113            DefRangeRegisterRelSym:
114              Register:        22
115              Flags:           0
116              BasePointerOffset: 8
117              Range:
118                OffsetStart:     12
119                ISectStart:      0
120                Range:           19
121              Gaps:
122          - Kind:            S_LOCAL
123            LocalSym:
124              Type:            116
125              Flags:           [ IsParameter ]
126              VarName:         y
127          - Kind:            S_DEFRANGE_REGISTER_REL
128            DefRangeRegisterRelSym:
129              Register:        22
130              Flags:           0
131              BasePointerOffset: 12
132              Range:
133                OffsetStart:     12
134                ISectStart:      0
135                Range:           19
136              Gaps:
137          - Kind:            S_PROC_ID_END
138            ScopeEndSym:
139      - !Lines
140        CodeSize:        31
141        Flags:           [  ]
142        RelocOffset:     0
143        RelocSegment:    0
144        Blocks:
145          - FileName:        'D:\src\llvmbuild\cl\Debug\x64\pdb-framedata.cpp'
146            Lines:
147              - Offset:          0
148                LineStart:       3
149                IsStatement:     false
150                EndDelta:        0
151              - Offset:          12
152                LineStart:       4
153                IsStatement:     false
154                EndDelta:        0
155            Columns:
156      - !FrameData
157        Frames:
158          - CodeSize:        53
159            FrameFunc:       '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = '
160            LocalSize:       0
161            MaxStackSize:    0
162            ParamsSize:      8
163            PrologSize:      7
164            RvaStart:        0
165            SavedRegsSize:   0
166          - CodeSize:        52
167            FrameFunc:       '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = '
168            LocalSize:       0
169            MaxStackSize:    0
170            ParamsSize:      8
171            PrologSize:      6
172            RvaStart:        1
173            SavedRegsSize:   4
174          - CodeSize:        50
175            FrameFunc:       '$T0 $ebp 4 + = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = '
176            LocalSize:       0
177            MaxStackSize:    0
178            ParamsSize:      8
179            PrologSize:      4
180            RvaStart:        3
181            SavedRegsSize:   4
182          - CodeSize:        49
183            FrameFunc:       '$T0 $ebp 4 + = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = $esi $T0 8 - ^ = '
184            LocalSize:       0
185            MaxStackSize:    0
186            ParamsSize:      8
187            PrologSize:      3
188            RvaStart:        4
189            SavedRegsSize:   8
190      - !Symbols
191        Records:
192          - Kind:            S_GPROC32_ID
193            ProcSym:
194              CodeSize:        53
195              DbgStart:        0
196              DbgEnd:          0
197              FunctionType:    4102
198              Flags:           [  ]
199              DisplayName:     main
200          - Kind:            S_LOCAL
201            LocalSym:
202              Type:            116
203              Flags:           [ IsParameter ]
204              VarName:         argc
205          - Kind:            S_DEFRANGE_REGISTER_REL
206            DefRangeRegisterRelSym:
207              Register:        22
208              Flags:           0
209              BasePointerOffset: 8
210              Range:
211                OffsetStart:     52
212                ISectStart:      0
213                Range:           33
214              Gaps:
215          - Kind:            S_LOCAL
216            LocalSym:
217              Type:            4099
218              Flags:           [ IsParameter ]
219              VarName:         argv
220          - Kind:            S_DEFRANGE_REGISTER_REL
221            DefRangeRegisterRelSym:
222              Register:        22
223              Flags:           0
224              BasePointerOffset: 12
225              Range:
226                OffsetStart:     52
227                ISectStart:      0
228                Range:           33
229              Gaps:
230          - Kind:            S_PROC_ID_END
231            ScopeEndSym:
232      - !Lines
233        CodeSize:        53
234        Flags:           [  ]
235        RelocOffset:     0
236        RelocSegment:    0
237        Blocks:
238          - FileName:        'D:\src\llvmbuild\cl\Debug\x64\pdb-framedata.cpp'
239            Lines:
240              - Offset:          0
241                LineStart:       7
242                IsStatement:     false
243                EndDelta:        0
244              - Offset:          20
245                LineStart:       8
246                IsStatement:     false
247                EndDelta:        0
248            Columns:
249      - !FileChecksums
250        Checksums:
251          - FileName:        'D:\src\llvmbuild\cl\Debug\x64\pdb-framedata.cpp'
252            Kind:            MD5
253            Checksum:        A611B73E19B77B02646FAAF7CAEB025D
254      - !StringTable
255        Strings:
256          - 'D:\src\llvmbuild\cl\Debug\x64\pdb-framedata.cpp'
257          - '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = '
258          - '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = '
259          - '$T0 $ebp 4 + = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = '
260          - '$T0 $ebp 4 + = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = $esi $T0 8 - ^ = '
261          - ''
262    Relocations:
263      - VirtualAddress:  68
264        SymbolName:      '?func@@YAHHH@Z'
265        Type:            IMAGE_REL_I386_DIR32NB
266      - VirtualAddress:  208
267        SymbolName:      '?func@@YAHHH@Z'
268        Type:            IMAGE_REL_I386_SECREL
269      - VirtualAddress:  212
270        SymbolName:      '?func@@YAHHH@Z'
271        Type:            IMAGE_REL_I386_SECTION
272      - VirtualAddress:  244
273        SymbolName:      .text
274        Type:            IMAGE_REL_I386_SECREL
275      - VirtualAddress:  248
276        SymbolName:      .text
277        Type:            IMAGE_REL_I386_SECTION
278      - VirtualAddress:  276
279        SymbolName:      .text
280        Type:            IMAGE_REL_I386_SECREL
281      - VirtualAddress:  280
282        SymbolName:      .text
283        Type:            IMAGE_REL_I386_SECTION
284      - VirtualAddress:  296
285        SymbolName:      '?func@@YAHHH@Z'
286        Type:            IMAGE_REL_I386_SECREL
287      - VirtualAddress:  300
288        SymbolName:      '?func@@YAHHH@Z'
289        Type:            IMAGE_REL_I386_SECTION
290      - VirtualAddress:  344
291        SymbolName:      _main
292        Type:            IMAGE_REL_I386_DIR32NB
293      - VirtualAddress:  516
294        SymbolName:      _main
295        Type:            IMAGE_REL_I386_SECREL
296      - VirtualAddress:  520
297        SymbolName:      _main
298        Type:            IMAGE_REL_I386_SECTION
299      - VirtualAddress:  555
300        SymbolName:      .text
301        Type:            IMAGE_REL_I386_SECREL
302      - VirtualAddress:  559
303        SymbolName:      .text
304        Type:            IMAGE_REL_I386_SECTION
305      - VirtualAddress:  590
306        SymbolName:      .text
307        Type:            IMAGE_REL_I386_SECREL
308      - VirtualAddress:  594
309        SymbolName:      .text
310        Type:            IMAGE_REL_I386_SECTION
311      - VirtualAddress:  612
312        SymbolName:      _main
313        Type:            IMAGE_REL_I386_SECREL
314      - VirtualAddress:  616
315        SymbolName:      _main
316        Type:            IMAGE_REL_I386_SECTION
317  - Name:            '.debug$T'
318    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
319    Alignment:       4
320    Types:
321      - Kind:            LF_ARGLIST
322        ArgList:
323          ArgIndices:      [ 116, 116 ]
324      - Kind:            LF_PROCEDURE
325        Procedure:
326          ReturnType:      116
327          CallConv:        NearC
328          Options:         [ None ]
329          ParameterCount:  2
330          ArgumentList:    4096
331      - Kind:            LF_FUNC_ID
332        FuncId:
333          ParentScope:     0
334          FunctionType:    4097
335          Name:            func
336      - Kind:            LF_POINTER
337        Pointer:
338          ReferentType:    1136
339          Attrs:           32778
340      - Kind:            LF_ARGLIST
341        ArgList:
342          ArgIndices:      [ 116, 4099 ]
343      - Kind:            LF_PROCEDURE
344        Procedure:
345          ReturnType:      116
346          CallConv:        NearC
347          Options:         [ None ]
348          ParameterCount:  2
349          ArgumentList:    4100
350      - Kind:            LF_FUNC_ID
351        FuncId:
352          ParentScope:     0
353          FunctionType:    4101
354          Name:            main
355  - Name:            .llvm_addrsig
356    Characteristics: [ IMAGE_SCN_LNK_REMOVE ]
357    Alignment:       1
358    SectionData:     0F
359symbols:
360  - Name:            .text
361    Value:           0
362    SectionNumber:   1
363    SimpleType:      IMAGE_SYM_TYPE_NULL
364    ComplexType:     IMAGE_SYM_DTYPE_NULL
365    StorageClass:    IMAGE_SYM_CLASS_STATIC
366    SectionDefinition:
367      Length:          85
368      NumberOfRelocations: 1
369      NumberOfLinenumbers: 0
370      CheckSum:        1989857796
371      Number:          1
372  - Name:            .data
373    Value:           0
374    SectionNumber:   2
375    SimpleType:      IMAGE_SYM_TYPE_NULL
376    ComplexType:     IMAGE_SYM_DTYPE_NULL
377    StorageClass:    IMAGE_SYM_CLASS_STATIC
378    SectionDefinition:
379      Length:          0
380      NumberOfRelocations: 0
381      NumberOfLinenumbers: 0
382      CheckSum:        0
383      Number:          2
384  - Name:            .bss
385    Value:           0
386    SectionNumber:   3
387    SimpleType:      IMAGE_SYM_TYPE_NULL
388    ComplexType:     IMAGE_SYM_DTYPE_NULL
389    StorageClass:    IMAGE_SYM_CLASS_STATIC
390    SectionDefinition:
391      Length:          0
392      NumberOfRelocations: 0
393      NumberOfLinenumbers: 0
394      CheckSum:        0
395      Number:          3
396  - Name:            .drectve
397    Value:           0
398    SectionNumber:   4
399    SimpleType:      IMAGE_SYM_TYPE_NULL
400    ComplexType:     IMAGE_SYM_DTYPE_NULL
401    StorageClass:    IMAGE_SYM_CLASS_STATIC
402    SectionDefinition:
403      Length:          48
404      NumberOfRelocations: 0
405      NumberOfLinenumbers: 0
406      CheckSum:        149686238
407      Number:          4
408  - Name:            '.debug$S'
409    Value:           0
410    SectionNumber:   5
411    SimpleType:      IMAGE_SYM_TYPE_NULL
412    ComplexType:     IMAGE_SYM_DTYPE_NULL
413    StorageClass:    IMAGE_SYM_CLASS_STATIC
414    SectionDefinition:
415      Length:          988
416      NumberOfRelocations: 18
417      NumberOfLinenumbers: 0
418      CheckSum:        2571438511
419      Number:          5
420  - Name:            '.debug$T'
421    Value:           0
422    SectionNumber:   6
423    SimpleType:      IMAGE_SYM_TYPE_NULL
424    ComplexType:     IMAGE_SYM_DTYPE_NULL
425    StorageClass:    IMAGE_SYM_CLASS_STATIC
426    SectionDefinition:
427      Length:          120
428      NumberOfRelocations: 0
429      NumberOfLinenumbers: 0
430      CheckSum:        3148269371
431      Number:          6
432  - Name:            .llvm_addrsig
433    Value:           0
434    SectionNumber:   7
435    SimpleType:      IMAGE_SYM_TYPE_NULL
436    ComplexType:     IMAGE_SYM_DTYPE_NULL
437    StorageClass:    IMAGE_SYM_CLASS_STATIC
438    SectionDefinition:
439      Length:          1
440      NumberOfRelocations: 0
441      NumberOfLinenumbers: 0
442      CheckSum:        2428444049
443      Number:          7
444  - Name:            '@feat.00'
445    Value:           1
446    SectionNumber:   -1
447    SimpleType:      IMAGE_SYM_TYPE_NULL
448    ComplexType:     IMAGE_SYM_DTYPE_NULL
449    StorageClass:    IMAGE_SYM_CLASS_STATIC
450  - Name:            '?func@@YAHHH@Z'
451    Value:           0
452    SectionNumber:   1
453    SimpleType:      IMAGE_SYM_TYPE_NULL
454    ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
455    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
456  - Name:            _main
457    Value:           32
458    SectionNumber:   1
459    SimpleType:      IMAGE_SYM_TYPE_NULL
460    ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
461    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
462...
463