File: symbolizer-inline.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (437 lines) | stat: -rw-r--r-- 15,577 bytes parent folder | download | duplicates (15)
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj %s -o %t.obj -triple x86_64-windows-msvc
# RUN: lld-link -entry:main -nodefaultlib %t.obj -out:%t.exe -pdb:%t.pdb -debug
# RUN: llvm-symbolizer --obj=%t.exe --relative-address \
# RUN:   0x1014 0x1015 0x1018 0x1019 0x101c 0x101d 0x1023 0x1024 \
# RUN:   0x1037 0x103A 0x104B 0x104E | FileCheck %s

# Compiled from this cpp code, with modifications to add extra inline line and
# file changes:
# clang -cc1 -triple x86_64-windows-msvc -gcodeview -S test.cpp
#
# __attribute__((always_inline)) int inlinee_2(int x) {
#   return x + 1;
# }
# __attribute__((always_inline)) int inlinee_1(int x) {
#   return inlinee_2(x) + 2;
# }
# int main() {
#   int x = inlinee_1(33);
#   int y = inlinee_2(22);
#   int z = inlinee_2(11);
#   return x + y + z;
# }

	.text
	.def	 @feat.00;
	.scl	3;
	.type	0;
	.endef
	.globl	@feat.00
.set @feat.00, 0
	.file	"test.cpp"
	.def	 main;
	.scl	2;
	.type	32;
	.endef
	.globl	main                            # -- Begin function main
	.p2align	4, 0x90
main:                                   # @main
.Lfunc_begin0:
	.cv_func_id 0
	.cv_file	1 "C:\\src\\test.cpp" "67680A954FC00F980188190C8D23C68E" 1
  .cv_file  2 "C:\\src\\fakefile.cpp" "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 1
	.cv_loc	0 1 9 0                         # test.cpp:9:0
# %bb.0:                                # %entry
	subq	$32, %rsp
	movl	$0, 12(%rsp)
	movl	$33, 16(%rsp)
.Ltmp0:
	.cv_inline_site_id 1 within 0 inlined_at 1 10 11
	.cv_loc	1 1 6 20                        # test.cpp:6:20

# CHECK: inlinee_1
# CHECK-NEXT: C:\src\test.cpp:6:0
# CHECK-NEXT: main
# CHECK-NEXT: C:\src\test.cpp:10:11

# CHECK: inlinee_1
# CHECK-NEXT: C:\src\test.cpp:6:0
# CHECK-NEXT: main
# CHECK-NEXT: C:\src\test.cpp:10:11
	movl	16(%rsp), %eax

# Add a line change here.
  .cv_loc 1 1 7 7

# CHECK: inlinee_1
# CHECK-NEXT: C:\src\test.cpp:7:0
# CHECK-NEXT: main
# CHECK-NEXT: C:\src\test.cpp:10:11

# CHECK: inlinee_1
# CHECK-NEXT: C:\src\test.cpp:7:0
# CHECK-NEXT: main
# CHECK-NEXT: C:\src\test.cpp:10:11
	movl	%eax, 20(%rsp)
.Ltmp1:
	.cv_inline_site_id 2 within 1 inlined_at 1 6 10
	.cv_loc	2 1 2 10                        # test.cpp:2:10

# CHECK: inlinee_2
# CHECK-NEXT: C:\src\test.cpp:2:0
# CHECK-NEXT: inlinee_1
# CHECK-NEXT: C:\src\test.cpp:6:0
# CHECK-NEXT: main
# CHECK-NEXT: C:\src\test.cpp:10:11

# CHECK: inlinee_2
# CHECK-NEXT: C:\src\test.cpp:2:0
# CHECK-NEXT: inlinee_1
# CHECK-NEXT: C:\src\test.cpp:6:0
# CHECK-NEXT: main
# CHECK-NEXT: C:\src\test.cpp:10:11
	movl	20(%rsp), %eax
	.cv_loc	2 1 2 12                        # test.cpp:2:12
	addl	$1, %eax

# Add a file change.
  .cv_loc 2 2 102 0                       # fakefile.cpp:102:0

# CHECK: inlinee_2
# CHECK-NEXT: C:\src\fakefile.cpp:102:0
# CHECK-NEXT: inlinee_1
# CHECK-NEXT: C:\src\test.cpp:6:0
# CHECK-NEXT: main
# CHECK-NEXT: C:\src\test.cpp:10:11
  nop

.Ltmp2:
	.cv_loc	1 1 6 23                        # test.cpp:6:23

# CHECK: inlinee_1
# CHECK-NEXT: C:\src\test.cpp:6:0
# CHECK-NEXT: main
# CHECK-NEXT: C:\src\test.cpp:10:11
	addl	$2, %eax
.Ltmp3:
	.cv_loc	0 1 10 7                        # test.cpp:10:7
	movl	%eax, 8(%rsp)
	movl	$22, 28(%rsp)
.Ltmp4:
# Add a .cv_loc 0 so there is a gap in the inline site.
# CHECK: main
# CHECK-NEXT: C:\src\test.cpp:0:0

# CHECK: inlinee_2
# CHECK-NEXT: C:\src\test.cpp:2:0
# CHECK-NEXT: main
# CHECK-NEXT: C:\src\test.cpp:11:11
	.cv_inline_site_id 3 within 0 inlined_at 1 11 11
	.cv_loc	3 1 2 10                        # test.cpp:2:10
	movl	28(%rsp), %eax
  .cv_loc 0 1 0 0
  nop
	.cv_loc	3 1 2 12                        # test.cpp:2:12
	addl	$1, %eax
.Ltmp5:
	.cv_loc	0 1 11 7                        # test.cpp:11:7
	movl	%eax, 4(%rsp)
	movl	$11, 24(%rsp)
.Ltmp6:
# Same test as above but modify the .cv_inline_linetable to use an annotation
# that clang doesn't emit.
# CHECK-NOT: inlinee_2
# CHECK: main
# CHECK-NEXT: C:\src\test.cpp:11:7

# CHECK: inlinee_2
# CHECK-NEXT: C:\src\test.cpp:1:0
# CHECK-NEXT: main
# CHECK-NEXT: C:\src\test.cpp:11:7
.cv_inline_site_id 4 within 0 inlined_at 1 0 0
	movl	24(%rsp), %eax
  nop
	addl	$1, %eax
.Ltmp7:
	.cv_loc	0 1 13 3                        # test.cpp:13:3
	addq	$32, %rsp
	retq
.Ltmp8:
.Lfunc_end0:
                                        # -- End function
	.section	.debug$S,"dr"
	.p2align	2
	.long	4                               # Debug section magic
	.long	241
	.long	.Ltmp10-.Ltmp9                  # Subsection size
.Ltmp9:
	.short	.Ltmp12-.Ltmp11                 # Record length
.Ltmp11:
	.short	4412                            # Record kind: S_COMPILE3
	.long	1                               # Flags and language
	.short	208                             # CPUType
	.short	12                              # Frontend version
	.short	0
	.short	0
	.short	0
	.short	12000                           # Backend version
	.short	0
	.short	0
	.short	0
	.asciz	"clang version 12.0.0 (https://github.com/llvm/llvm-project.git 2ef947fe318d081b12add3d411bbb2af6373c66d)" # Null-terminated compiler version string
	.p2align	2
.Ltmp12:
.Ltmp10:
	.p2align	2
	.long	246                             # Inlinee lines subsection
	.long	.Ltmp14-.Ltmp13                 # Subsection size
.Ltmp13:
	.long	0                               # Inlinee lines signature

                                        # Inlined function inlinee_1 starts at test.cpp:5
	.long	4098                            # Type index of inlined function
	.cv_filechecksumoffset	1               # Offset into filechecksum table
	.long	5                               # Starting line number

                                        # Inlined function inlinee_2 starts at test.cpp:1
	.long	4099                            # Type index of inlined function
	.cv_filechecksumoffset	1               # Offset into filechecksum table
	.long	1                               # Starting line number
.Ltmp14:
	.p2align	2
	.long	241                             # Symbol subsection for main
	.long	.Ltmp16-.Ltmp15                 # Subsection size
.Ltmp15:
	.short	.Ltmp18-.Ltmp17                 # Record length
.Ltmp17:
	.short	4423                            # Record kind: S_GPROC32_ID
	.long	0                               # PtrParent
	.long	0                               # PtrEnd
	.long	0                               # PtrNext
	.long	.Lfunc_end0-main                # Code size
	.long	0                               # Offset after prologue
	.long	0                               # Offset before epilogue
	.long	4102                            # Function type index
	.secrel32	main                    # Function section relative address
	.secidx	main                            # Function section index
	.byte	0                               # Flags
	.asciz	"main"                          # Function name
	.p2align	2
.Ltmp18:
	.short	.Ltmp20-.Ltmp19                 # Record length
.Ltmp19:
	.short	4114                            # Record kind: S_FRAMEPROC
	.long	32                              # FrameSize
	.long	0                               # Padding
	.long	0                               # Offset of padding
	.long	0                               # Bytes of callee saved registers
	.long	0                               # Exception handler offset
	.short	0                               # Exception handler section
	.long	81920                           # Flags (defines frame register)
	.p2align	2
.Ltmp20:
	.short	.Ltmp22-.Ltmp21                 # Record length
.Ltmp21:
	.short	4414                            # Record kind: S_LOCAL
	.long	116                             # TypeIndex
	.short	0                               # Flags
	.asciz	"x"
	.p2align	2
.Ltmp22:
	.cv_def_range	 .Ltmp0 .Ltmp8, frame_ptr_rel, 8
	.short	.Ltmp24-.Ltmp23                 # Record length
.Ltmp23:
	.short	4414                            # Record kind: S_LOCAL
	.long	116                             # TypeIndex
	.short	0                               # Flags
	.asciz	"y"
	.p2align	2
.Ltmp24:
	.cv_def_range	 .Ltmp0 .Ltmp8, frame_ptr_rel, 4
	.short	.Ltmp26-.Ltmp25                 # Record length
.Ltmp25:
	.short	4414                            # Record kind: S_LOCAL
	.long	116                             # TypeIndex
	.short	0                               # Flags
	.asciz	"z"
	.p2align	2
.Ltmp26:
	.cv_def_range	 .Ltmp0 .Ltmp8, frame_ptr_rel, 0
	.short	.Ltmp28-.Ltmp27                 # Record length
.Ltmp27:
	.short	4429                            # Record kind: S_INLINESITE
	.long	0                               # PtrParent
	.long	0                               # PtrEnd
	.long	4098                            # Inlinee type index
	.cv_inline_linetable	1 1 5 .Lfunc_begin0 .Lfunc_end0
	.p2align	2
.Ltmp28:
	.short	.Ltmp30-.Ltmp29                 # Record length
.Ltmp29:
	.short	4414                            # Record kind: S_LOCAL
	.long	116                             # TypeIndex
	.short	1                               # Flags
	.asciz	"x"
	.p2align	2
.Ltmp30:
	.cv_def_range	 .Ltmp0 .Ltmp3, frame_ptr_rel, 16
	.short	.Ltmp32-.Ltmp31                 # Record length
.Ltmp31:
	.short	4429                            # Record kind: S_INLINESITE
	.long	0                               # PtrParent
	.long	0                               # PtrEnd
	.long	4099                            # Inlinee type index
	.cv_inline_linetable	2 1 1 .Lfunc_begin0 .Lfunc_end0
	.p2align	2
.Ltmp32:
	.short	.Ltmp34-.Ltmp33                 # Record length
.Ltmp33:
	.short	4414                            # Record kind: S_LOCAL
	.long	116                             # TypeIndex
	.short	1                               # Flags
	.asciz	"x"
	.p2align	2
.Ltmp34:
	.cv_def_range	 .Ltmp1 .Ltmp2, frame_ptr_rel, 20
	.short	2                               # Record length
	.short	4430                            # Record kind: S_INLINESITE_END
	.short	2                               # Record length
	.short	4430                            # Record kind: S_INLINESITE_END
	.short	.Ltmp36-.Ltmp35                 # Record length
.Ltmp35:
	.short	4429                            # Record kind: S_INLINESITE
	.long	0                               # PtrParent
	.long	0                               # PtrEnd
	.long	4099                            # Inlinee type index
	.cv_inline_linetable	3 1 1 .Lfunc_begin0 .Lfunc_end0
	.p2align	2
.Ltmp36:
	.short	.Ltmp38-.Ltmp37                 # Record length
.Ltmp37:
	.short	4414                            # Record kind: S_LOCAL
	.long	116                             # TypeIndex
	.short	1                               # Flags
	.asciz	"x"
	.p2align	2
.Ltmp38:
	.cv_def_range	 .Ltmp4 .Ltmp5, frame_ptr_rel, 28
	.short	2                               # Record length
	.short	4430                            # Record kind: S_INLINESITE_END
	.short	.Ltmp40-.Ltmp39                 # Record length
.Ltmp39:
	.short	4429                            # Record kind: S_INLINESITE
	.long	0                               # PtrParent
	.long	0                               # PtrEnd
	.long	4099                            # Inlinee type index
# Changed inline line table annotations.
  .byte 0x0C, 0x4, 0x47
  .byte 0x0C, 0x3, 0x5
	.p2align	2
.Ltmp40:
	.short	.Ltmp42-.Ltmp41                 # Record length
.Ltmp41:
	.short	4414                            # Record kind: S_LOCAL
	.long	116                             # TypeIndex
	.short	1                               # Flags
	.asciz	"x"
	.p2align	2
.Ltmp42:
	.cv_def_range	 .Ltmp6 .Ltmp7, frame_ptr_rel, 24
	.short	2                               # Record length
	.short	4430                            # Record kind: S_INLINESITE_END
	.short	2                               # Record length
	.short	4431                            # Record kind: S_PROC_ID_END
.Ltmp16:
	.p2align	2
	.cv_linetable	0, main, .Lfunc_end0
	.cv_filechecksums                       # File index to string table offset subsection
	.cv_stringtable                         # String table
	.long	241
	.long	.Ltmp44-.Ltmp43                 # Subsection size
.Ltmp43:
	.short	.Ltmp46-.Ltmp45                 # Record length
.Ltmp45:
	.short	4428                            # Record kind: S_BUILDINFO
	.long	4105                            # LF_BUILDINFO index
	.p2align	2
.Ltmp46:
.Ltmp44:
	.p2align	2
	.section	.debug$T,"dr"
	.p2align	2
	.long	4                               # Debug section magic
	# ArgList (0x1000)
	.short	0xa                             # Record length
	.short	0x1201                          # Record kind: LF_ARGLIST
	.long	0x1                             # NumArgs
	.long	0x74                            # Argument: int
	# Procedure (0x1001)
	.short	0xe                             # Record length
	.short	0x1008                          # Record kind: LF_PROCEDURE
	.long	0x74                            # ReturnType: int
	.byte	0x0                             # CallingConvention: NearC
	.byte	0x0                             # FunctionOptions
	.short	0x1                             # NumParameters
	.long	0x1000                          # ArgListType: (int)
	# FuncId (0x1002)
	.short	0x16                            # Record length
	.short	0x1601                          # Record kind: LF_FUNC_ID
	.long	0x0                             # ParentScope
	.long	0x1001                          # FunctionType: int (int)
	.asciz	"inlinee_1"                     # Name
	.byte	242
	.byte	241
	# FuncId (0x1003)
	.short	0x16                            # Record length
	.short	0x1601                          # Record kind: LF_FUNC_ID
	.long	0x0                             # ParentScope
	.long	0x1001                          # FunctionType: int (int)
	.asciz	"inlinee_2"                     # Name
	.byte	242
	.byte	241
	# ArgList (0x1004)
	.short	0x6                             # Record length
	.short	0x1201                          # Record kind: LF_ARGLIST
	.long	0x0                             # NumArgs
	# Procedure (0x1005)
	.short	0xe                             # Record length
	.short	0x1008                          # Record kind: LF_PROCEDURE
	.long	0x74                            # ReturnType: int
	.byte	0x0                             # CallingConvention: NearC
	.byte	0x0                             # FunctionOptions
	.short	0x0                             # NumParameters
	.long	0x1004                          # ArgListType: ()
	# FuncId (0x1006)
	.short	0x12                            # Record length
	.short	0x1601                          # Record kind: LF_FUNC_ID
	.long	0x0                             # ParentScope
	.long	0x1005                          # FunctionType: int ()
	.asciz	"main"                          # Name
	.byte	243
	.byte	242
	.byte	241
	# StringId (0x1007)
	.short	0x2a                            # Record length
	.short	0x1605                          # Record kind: LF_STRING_ID
	.long	0x0                             # Id
	.asciz	"C:\\src\\tests\\symbolizer\\asm-test"  # StringData
	.byte	243
	.byte	242
	.byte	241
	# StringId (0x1008)
	.short	0xe                             # Record length
	.short	0x1605                          # Record kind: LF_STRING_ID
	.long	0x0                             # Id
	.asciz	"<stdin>"                       # StringData
	# BuildInfo (0x1009)
	.short	0x1a                            # Record length
	.short	0x1603                          # Record kind: LF_BUILDINFO
	.short	0x5                             # NumArgs
	.long	0x1007                          # Argument: C:\src
	.long	0x0                             # Argument
	.long	0x1008                          # Argument: <stdin>
	.long	0x0                             # Argument
	.long	0x0                             # Argument
	.byte	242
	.byte	241