xref: /llvm-project/llvm/test/DebugInfo/symbolize-filter-markup-bt.test (revision 7b31a73ffe87e6302ab433da8128058fce8f54bd)
1ea992255SDaniel ThornburghREQUIRES: x86-registered-target
2ea992255SDaniel ThornburghRUN: split-file %s %t
3ea992255SDaniel ThornburghRUN: mkdir -p %t/.build-id/ab
4ea992255SDaniel ThornburghRUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %t/asm.s \
5ea992255SDaniel ThornburghRUN:   -o %t/.build-id/ab/cdef.debug
6ea992255SDaniel ThornburghRUN: llvm-symbolizer --debug-file-directory=%t --filter-markup < %t/input \
7ea992255SDaniel ThornburghRUN:   > %t.output 2> %t.err
8ea992255SDaniel ThornburghRUN: FileCheck %s --input-file=%t.output --match-full-lines \
9ea992255SDaniel ThornburghRUN:   --implicit-check-not {{.}}
10ea992255SDaniel ThornburghRUN: FileCheck %s --check-prefix=ERR --input-file=%t.err --match-full-lines
11ea992255SDaniel Thornburgh
12ea992255SDaniel ThornburghCHECK: [[BEGIN:\[{3}]]ELF module #0x0 "a.o"; BuildID=abcdef [0x10-0x10f](r)[[END:\]{3}]]
13ea992255SDaniel ThornburghCHECK:    #0.1  0x0000000000000018 second /tmp[[SEP:[/\\]]]tmp.c:8:3 (a.o+0x8)
14ea992255SDaniel ThornburghCHECK:    #0    0x0000000000000018 first /tmp[[SEP]]tmp.c:4:3 (a.o+0x8)
15ea992255SDaniel ThornburghCHECK:    #1.1  0x0000000000000018 second /tmp[[SEP]]tmp.c:8:3 (a.o+0x8)
16ea992255SDaniel ThornburghCHECK:    #1    0x0000000000000018 first /tmp[[SEP]]tmp.c:4:3 (a.o+0x8)
17ea992255SDaniel ThornburghCHECK:    #0.1  0x0000000000000018 second /tmp[[SEP]]tmp.c:8:3 (a.o+0x8)
18ea992255SDaniel ThornburghCHECK:    #0    0x0000000000000018 first /tmp[[SEP]]tmp.c:4:3 (a.o+0x8)
19ea992255SDaniel ThornburghCHECK:    #0    0x0000000000000019 first /tmp[[SEP]]tmp.c:5:1 (a.o+0x9)
20ea992255SDaniel ThornburghCHECK:    #0    0x00000000000000fe (a.o+0xee)
21*7b31a73fSDaniel Thornburgh
22*7b31a73fSDaniel ThornburghCHECK:    #0    0x00000000000000fe (a.o+0xee)
23*7b31a73fSDaniel ThornburghERR: warning: expected at most 3 field(s); found 4
24ea992255SDaniel ThornburghCHECK: [[BEGIN]]bt:0:0x111[[END]]
25*7b31a73fSDaniel ThornburghERR: error: no mmap covers address
26ea992255SDaniel Thornburgh
27ea992255SDaniel ThornburghERR: error: expected at least 2 field(s); found 0
28ea992255SDaniel ThornburghERR: error: expected PC type; found ''
29ea992255SDaniel Thornburgh
30ea992255SDaniel Thornburgh;--- input
31ea992255SDaniel Thornburgh{{{module:0:a.o:elf:abcdef}}}
32ea992255SDaniel Thornburgh{{{mmap:0x10:256:load:0:r:0}}}
33ea992255SDaniel Thornburgh{{{bt:0:0x19}}}
34ea992255SDaniel Thornburgh{{{bt:1:0x19}}}
35ea992255SDaniel Thornburgh{{{bt:0:0x19:ra}}}
36ea992255SDaniel Thornburgh{{{bt:0:0x19:pc}}}
37ea992255SDaniel Thornburgh{{{bt:0:0xff}}}
38ea992255SDaniel Thornburgh
39*7b31a73fSDaniel Thornburgh{{{bt:0:0xff:pc:ext}}}
40ea992255SDaniel Thornburgh{{{bt:0:0x111}}}
41*7b31a73fSDaniel Thornburgh
42*7b31a73fSDaniel Thornburgh{{{bt}}}
43ea992255SDaniel Thornburgh{{{bt:0:0:}}}
44ea992255SDaniel Thornburgh;--- asm.s
45ea992255SDaniel Thornburgh# Generated by running "clang -finline -g -S tmp.c" in the following tmp.c on
46ea992255SDaniel Thornburgh# Linux x86_64:
47ea992255SDaniel Thornburgh#
48ea992255SDaniel Thornburgh# static void second(void);
49ea992255SDaniel Thornburgh# void first(void) {
50ea992255SDaniel Thornburgh#   second();
51ea992255SDaniel Thornburgh# }
52ea992255SDaniel Thornburgh# void second(void) {}
53ea992255SDaniel Thornburgh	.text
54ea992255SDaniel Thornburgh	.file	"tmp.c"
55ea992255SDaniel Thornburgh	.globl	first                           # -- Begin function first
56ea992255SDaniel Thornburgh	.p2align	4, 0x90
57ea992255SDaniel Thornburgh	.type	first,@function
58ea992255SDaniel Thornburghfirst:                                  # @first
59ea992255SDaniel Thornburgh.Lfunc_begin0:
60ea992255SDaniel Thornburgh	.file	1 "/tmp" "tmp.c"
61ea992255SDaniel Thornburgh	.loc	1 3 0                           # tmp.c:3:0
62ea992255SDaniel Thornburgh	.cfi_startproc
63ea992255SDaniel Thornburgh# %bb.0:
64ea992255SDaniel Thornburgh	pushq	%rbp
65ea992255SDaniel Thornburgh	.cfi_def_cfa_offset 16
66ea992255SDaniel Thornburgh	.cfi_offset %rbp, -16
67ea992255SDaniel Thornburgh	movq	%rsp, %rbp
68ea992255SDaniel Thornburgh	.cfi_def_cfa_register %rbp
69ea992255SDaniel Thornburgh.Ltmp0:
70ea992255SDaniel Thornburgh	.loc	1 8 3 prologue_end              # tmp.c:8:3
71ea992255SDaniel Thornburgh	callq	first
72ea992255SDaniel Thornburgh.Ltmp1:
73ea992255SDaniel Thornburgh	.loc	1 5 1                           # tmp.c:5:1
74ea992255SDaniel Thornburgh	popq	%rbp
75ea992255SDaniel Thornburgh	.cfi_def_cfa %rsp, 8
76ea992255SDaniel Thornburgh	retq
77ea992255SDaniel Thornburgh.Ltmp2:
78ea992255SDaniel Thornburgh.Lfunc_end0:
79ea992255SDaniel Thornburgh	.size	first, .Lfunc_end0-first
80ea992255SDaniel Thornburgh	.cfi_endproc
81ea992255SDaniel Thornburgh                                        # -- End function
82ea992255SDaniel Thornburgh	.section	.debug_abbrev,"",@progbits
83ea992255SDaniel Thornburgh	.byte	1                               # Abbreviation Code
84ea992255SDaniel Thornburgh	.byte	17                              # DW_TAG_compile_unit
85ea992255SDaniel Thornburgh	.byte	1                               # DW_CHILDREN_yes
86ea992255SDaniel Thornburgh	.byte	37                              # DW_AT_producer
87ea992255SDaniel Thornburgh	.byte	14                              # DW_FORM_strp
88ea992255SDaniel Thornburgh	.byte	19                              # DW_AT_language
89ea992255SDaniel Thornburgh	.byte	5                               # DW_FORM_data2
90ea992255SDaniel Thornburgh	.byte	3                               # DW_AT_name
91ea992255SDaniel Thornburgh	.byte	14                              # DW_FORM_strp
92ea992255SDaniel Thornburgh	.byte	16                              # DW_AT_stmt_list
93ea992255SDaniel Thornburgh	.byte	23                              # DW_FORM_sec_offset
94ea992255SDaniel Thornburgh	.byte	27                              # DW_AT_comp_dir
95ea992255SDaniel Thornburgh	.byte	14                              # DW_FORM_strp
96ea992255SDaniel Thornburgh	.byte	17                              # DW_AT_low_pc
97ea992255SDaniel Thornburgh	.byte	1                               # DW_FORM_addr
98ea992255SDaniel Thornburgh	.byte	18                              # DW_AT_high_pc
99ea992255SDaniel Thornburgh	.byte	6                               # DW_FORM_data4
100ea992255SDaniel Thornburgh	.byte	0                               # EOM(1)
101ea992255SDaniel Thornburgh	.byte	0                               # EOM(2)
102ea992255SDaniel Thornburgh	.byte	2                               # Abbreviation Code
103ea992255SDaniel Thornburgh	.byte	46                              # DW_TAG_subprogram
104ea992255SDaniel Thornburgh	.byte	0                               # DW_CHILDREN_no
105ea992255SDaniel Thornburgh	.byte	3                               # DW_AT_name
106ea992255SDaniel Thornburgh	.byte	14                              # DW_FORM_strp
107ea992255SDaniel Thornburgh	.byte	58                              # DW_AT_decl_file
108ea992255SDaniel Thornburgh	.byte	11                              # DW_FORM_data1
109ea992255SDaniel Thornburgh	.byte	59                              # DW_AT_decl_line
110ea992255SDaniel Thornburgh	.byte	11                              # DW_FORM_data1
111ea992255SDaniel Thornburgh	.byte	39                              # DW_AT_prototyped
112ea992255SDaniel Thornburgh	.byte	25                              # DW_FORM_flag_present
113ea992255SDaniel Thornburgh	.byte	63                              # DW_AT_external
114ea992255SDaniel Thornburgh	.byte	25                              # DW_FORM_flag_present
115ea992255SDaniel Thornburgh	.byte	32                              # DW_AT_inline
116ea992255SDaniel Thornburgh	.byte	11                              # DW_FORM_data1
117ea992255SDaniel Thornburgh	.byte	0                               # EOM(1)
118ea992255SDaniel Thornburgh	.byte	0                               # EOM(2)
119ea992255SDaniel Thornburgh	.byte	3                               # Abbreviation Code
120ea992255SDaniel Thornburgh	.byte	46                              # DW_TAG_subprogram
121ea992255SDaniel Thornburgh	.byte	1                               # DW_CHILDREN_yes
122ea992255SDaniel Thornburgh	.byte	17                              # DW_AT_low_pc
123ea992255SDaniel Thornburgh	.byte	1                               # DW_FORM_addr
124ea992255SDaniel Thornburgh	.byte	18                              # DW_AT_high_pc
125ea992255SDaniel Thornburgh	.byte	6                               # DW_FORM_data4
126ea992255SDaniel Thornburgh	.byte	64                              # DW_AT_frame_base
127ea992255SDaniel Thornburgh	.byte	24                              # DW_FORM_exprloc
128ea992255SDaniel Thornburgh	.byte	3                               # DW_AT_name
129ea992255SDaniel Thornburgh	.byte	14                              # DW_FORM_strp
130ea992255SDaniel Thornburgh	.byte	58                              # DW_AT_decl_file
131ea992255SDaniel Thornburgh	.byte	11                              # DW_FORM_data1
132ea992255SDaniel Thornburgh	.byte	59                              # DW_AT_decl_line
133ea992255SDaniel Thornburgh	.byte	11                              # DW_FORM_data1
134ea992255SDaniel Thornburgh	.byte	39                              # DW_AT_prototyped
135ea992255SDaniel Thornburgh	.byte	25                              # DW_FORM_flag_present
136ea992255SDaniel Thornburgh	.byte	63                              # DW_AT_external
137ea992255SDaniel Thornburgh	.byte	25                              # DW_FORM_flag_present
138ea992255SDaniel Thornburgh	.byte	0                               # EOM(1)
139ea992255SDaniel Thornburgh	.byte	0                               # EOM(2)
140ea992255SDaniel Thornburgh	.byte	4                               # Abbreviation Code
141ea992255SDaniel Thornburgh	.byte	29                              # DW_TAG_inlined_subroutine
142ea992255SDaniel Thornburgh	.byte	0                               # DW_CHILDREN_no
143ea992255SDaniel Thornburgh	.byte	49                              # DW_AT_abstract_origin
144ea992255SDaniel Thornburgh	.byte	19                              # DW_FORM_ref4
145ea992255SDaniel Thornburgh	.byte	17                              # DW_AT_low_pc
146ea992255SDaniel Thornburgh	.byte	1                               # DW_FORM_addr
147ea992255SDaniel Thornburgh	.byte	18                              # DW_AT_high_pc
148ea992255SDaniel Thornburgh	.byte	6                               # DW_FORM_data4
149ea992255SDaniel Thornburgh	.byte	88                              # DW_AT_call_file
150ea992255SDaniel Thornburgh	.byte	11                              # DW_FORM_data1
151ea992255SDaniel Thornburgh	.byte	89                              # DW_AT_call_line
152ea992255SDaniel Thornburgh	.byte	11                              # DW_FORM_data1
153ea992255SDaniel Thornburgh	.byte	87                              # DW_AT_call_column
154ea992255SDaniel Thornburgh	.byte	11                              # DW_FORM_data1
155ea992255SDaniel Thornburgh	.byte	0                               # EOM(1)
156ea992255SDaniel Thornburgh	.byte	0                               # EOM(2)
157ea992255SDaniel Thornburgh	.byte	0                               # EOM(3)
158ea992255SDaniel Thornburgh	.section	.debug_info,"",@progbits
159ea992255SDaniel Thornburgh.Lcu_begin0:
160ea992255SDaniel Thornburgh	.long	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
161ea992255SDaniel Thornburgh.Ldebug_info_start0:
162ea992255SDaniel Thornburgh	.short	4                               # DWARF version number
163ea992255SDaniel Thornburgh	.long	.debug_abbrev                   # Offset Into Abbrev. Section
164ea992255SDaniel Thornburgh	.byte	8                               # Address Size (in bytes)
165ea992255SDaniel Thornburgh	.byte	1                               # Abbrev [1] 0xb:0x52 DW_TAG_compile_unit
166ea992255SDaniel Thornburgh	.long	.Linfo_string0                  # DW_AT_producer
167ea992255SDaniel Thornburgh	.short	12                              # DW_AT_language
168ea992255SDaniel Thornburgh	.long	.Linfo_string1                  # DW_AT_name
169ea992255SDaniel Thornburgh	.long	.Lline_table_start0             # DW_AT_stmt_list
170ea992255SDaniel Thornburgh	.long	.Linfo_string2                  # DW_AT_comp_dir
171ea992255SDaniel Thornburgh	.quad	.Lfunc_begin0                   # DW_AT_low_pc
172ea992255SDaniel Thornburgh	.long	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
173ea992255SDaniel Thornburgh	.byte	2                               # Abbrev [2] 0x2a:0x8 DW_TAG_subprogram
174ea992255SDaniel Thornburgh	.long	.Linfo_string3                  # DW_AT_name
175ea992255SDaniel Thornburgh	.byte	1                               # DW_AT_decl_file
176ea992255SDaniel Thornburgh	.byte	7                               # DW_AT_decl_line
177ea992255SDaniel Thornburgh                                        # DW_AT_prototyped
178ea992255SDaniel Thornburgh                                        # DW_AT_external
179ea992255SDaniel Thornburgh	.byte	1                               # DW_AT_inline
180ea992255SDaniel Thornburgh	.byte	3                               # Abbrev [3] 0x32:0x2a DW_TAG_subprogram
181ea992255SDaniel Thornburgh	.quad	.Lfunc_begin0                   # DW_AT_low_pc
182ea992255SDaniel Thornburgh	.long	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
183ea992255SDaniel Thornburgh	.byte	1                               # DW_AT_frame_base
184ea992255SDaniel Thornburgh	.byte	86
185ea992255SDaniel Thornburgh	.long	.Linfo_string4                  # DW_AT_name
186ea992255SDaniel Thornburgh	.byte	1                               # DW_AT_decl_file
187ea992255SDaniel Thornburgh	.byte	3                               # DW_AT_decl_line
188ea992255SDaniel Thornburgh                                        # DW_AT_prototyped
189ea992255SDaniel Thornburgh                                        # DW_AT_external
190ea992255SDaniel Thornburgh	.byte	4                               # Abbrev [4] 0x47:0x14 DW_TAG_inlined_subroutine
191ea992255SDaniel Thornburgh	.long	42                              # DW_AT_abstract_origin
192ea992255SDaniel Thornburgh	.quad	.Ltmp0                          # DW_AT_low_pc
193ea992255SDaniel Thornburgh	.long	.Ltmp1-.Ltmp0                   # DW_AT_high_pc
194ea992255SDaniel Thornburgh	.byte	1                               # DW_AT_call_file
195ea992255SDaniel Thornburgh	.byte	4                               # DW_AT_call_line
196ea992255SDaniel Thornburgh	.byte	3                               # DW_AT_call_column
197ea992255SDaniel Thornburgh	.byte	0                               # End Of Children Mark
198ea992255SDaniel Thornburgh	.byte	0                               # End Of Children Mark
199ea992255SDaniel Thornburgh.Ldebug_info_end0:
200ea992255SDaniel Thornburgh	.section	.debug_str,"MS",@progbits,1
201ea992255SDaniel Thornburgh.Linfo_string0:
202ea992255SDaniel Thornburgh	.asciz	"Debian clang version 13.0.1-6" # string offset=0
203ea992255SDaniel Thornburgh.Linfo_string1:
204ea992255SDaniel Thornburgh	.asciz	"tmp.c"                         # string offset=30
205ea992255SDaniel Thornburgh.Linfo_string2:
206ea992255SDaniel Thornburgh	.asciz	"/tmp" # string offset=36
207ea992255SDaniel Thornburgh.Linfo_string3:
208ea992255SDaniel Thornburgh	.asciz	"second"                        # string offset=85
209ea992255SDaniel Thornburgh.Linfo_string4:
210ea992255SDaniel Thornburgh	.asciz	"first"                         # string offset=92
211ea992255SDaniel Thornburgh	.ident	"Debian clang version 13.0.1-6"
212ea992255SDaniel Thornburgh	.section	".note.GNU-stack","",@progbits
213ea992255SDaniel Thornburgh	.addrsig
214ea992255SDaniel Thornburgh	.addrsig_sym first
215ea992255SDaniel Thornburgh	.section	.debug_line,"",@progbits
216ea992255SDaniel Thornburgh.Lline_table_start0:
217