3 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s > %t
4 # RUN: lldb-test symbols %t &> %t.txt
5 # RUN: cat %t.txt | FileCheck %s
7 # Tests that error is printed correctly when DW_AT_low_pc value is
8 # greater then a range entry.
10 # CHECK: 0x0000006e: adding range [0x0000000000000000-0x000000000000001f)
11 # CHECK-SAME: which has a base that is less than the function's low PC 0x0000000000000021.
12 # CHECK-SAME: Please file a bug and attach the file at the start of this error message
16 # Test was manually modified to change DW_TAG_lexical_block
17 # to use DW_AT_ranges, and value lower then DW_AT_low_pc value
18 # in DW_TAG_subprogram
19 # static int foo(bool b) {
31 .section .text.main,"ax",@progbits
32 .globl main # -- Begin function main
37 .file 1 "base-lower-then-range-entry" "main.cpp"
38 .loc 1 8 0 # main.cpp:8:0
42 .cfi_def_cfa_offset 16
45 .cfi_def_cfa_register %rbp
49 .loc 1 9 10 prologue_end # main.cpp:9:10
52 .loc 1 9 3 epilogue_begin is_stmt 0 # main.cpp:9:3
59 .size main, .Lfunc_end0-main
62 .section .text._ZL3foob,"ax",@progbits
63 .p2align 4, 0x90 # -- Begin function _ZL3foob
64 .type _ZL3foob,@function
67 .loc 1 1 0 is_stmt 1 # main.cpp:1:0
71 .cfi_def_cfa_offset 16
74 .cfi_def_cfa_register %rbp
79 .loc 1 2 7 prologue_end # main.cpp:2:7
84 .loc 1 3 8 # main.cpp:3:8
86 .loc 1 4 12 # main.cpp:4:12
88 .loc 1 4 5 is_stmt 0 # main.cpp:4:5
93 .loc 1 6 3 is_stmt 1 # main.cpp:6:3
96 .loc 1 7 1 # main.cpp:7:1
98 .loc 1 7 1 epilogue_begin is_stmt 0 # main.cpp:7:1
104 .size _ZL3foob, .Lfunc_end1-_ZL3foob
107 .section .debug_abbrev,"",@progbits
108 .byte 1 # Abbreviation Code
109 .byte 17 # DW_TAG_compile_unit
110 .byte 1 # DW_CHILDREN_yes
111 .byte 37 # DW_AT_producer
112 .byte 14 # DW_FORM_strp
113 .byte 19 # DW_AT_language
114 .byte 5 # DW_FORM_data2
116 .byte 14 # DW_FORM_strp
117 .byte 16 # DW_AT_stmt_list
118 .byte 23 # DW_FORM_sec_offset
119 .byte 27 # DW_AT_comp_dir
120 .byte 14 # DW_FORM_strp
121 .byte 17 # DW_AT_low_pc
122 .byte 1 # DW_FORM_addr
123 .byte 85 # DW_AT_ranges
124 .byte 23 # DW_FORM_sec_offset
127 .byte 2 # Abbreviation Code
128 .byte 46 # DW_TAG_subprogram
129 .byte 0 # DW_CHILDREN_no
130 .byte 17 # DW_AT_low_pc
131 .byte 1 # DW_FORM_addr
132 .byte 18 # DW_AT_high_pc
133 .byte 6 # DW_FORM_data4
134 .byte 64 # DW_AT_frame_base
135 .byte 24 # DW_FORM_exprloc
137 .byte 14 # DW_FORM_strp
138 .byte 58 # DW_AT_decl_file
139 .byte 11 # DW_FORM_data1
140 .byte 59 # DW_AT_decl_line
141 .byte 11 # DW_FORM_data1
142 .byte 73 # DW_AT_type
143 .byte 19 # DW_FORM_ref4
144 .byte 63 # DW_AT_external
145 .byte 25 # DW_FORM_flag_present
148 .byte 3 # Abbreviation Code
149 .byte 46 # DW_TAG_subprogram
150 .byte 1 # DW_CHILDREN_yes
151 .byte 17 # DW_AT_low_pc
152 .byte 1 # DW_FORM_addr
153 .byte 18 # DW_AT_high_pc
154 .byte 6 # DW_FORM_data4
155 .byte 64 # DW_AT_frame_base
156 .byte 24 # DW_FORM_exprloc
157 .byte 110 # DW_AT_linkage_name
158 .byte 14 # DW_FORM_strp
160 .byte 14 # DW_FORM_strp
161 .byte 58 # DW_AT_decl_file
162 .byte 11 # DW_FORM_data1
163 .byte 59 # DW_AT_decl_line
164 .byte 11 # DW_FORM_data1
165 .byte 73 # DW_AT_type
166 .byte 19 # DW_FORM_ref4
169 .byte 4 # Abbreviation Code
170 .byte 5 # DW_TAG_formal_parameter
171 .byte 0 # DW_CHILDREN_no
172 .byte 2 # DW_AT_location
173 .byte 24 # DW_FORM_exprloc
175 .byte 14 # DW_FORM_strp
176 .byte 58 # DW_AT_decl_file
177 .byte 11 # DW_FORM_data1
178 .byte 59 # DW_AT_decl_line
179 .byte 11 # DW_FORM_data1
180 .byte 73 # DW_AT_type
181 .byte 19 # DW_FORM_ref4
184 .byte 5 # Abbreviation Code
185 .byte 11 # DW_TAG_lexical_block
186 .byte 1 # DW_CHILDREN_yes
187 .byte 85 # DW_AT_ranges <------ Manually modified. Replaced low_pc/high)_pc with rangres.
188 .byte 23 # DW_FORM_sec_offset
191 .byte 6 # Abbreviation Code
192 .byte 52 # DW_TAG_variable
193 .byte 0 # DW_CHILDREN_no
194 .byte 2 # DW_AT_location
195 .byte 24 # DW_FORM_exprloc
197 .byte 14 # DW_FORM_strp
198 .byte 58 # DW_AT_decl_file
199 .byte 11 # DW_FORM_data1
200 .byte 59 # DW_AT_decl_line
201 .byte 11 # DW_FORM_data1
202 .byte 73 # DW_AT_type
203 .byte 19 # DW_FORM_ref4
206 .byte 7 # Abbreviation Code
207 .byte 36 # DW_TAG_base_type
208 .byte 0 # DW_CHILDREN_no
210 .byte 14 # DW_FORM_strp
211 .byte 62 # DW_AT_encoding
212 .byte 11 # DW_FORM_data1
213 .byte 11 # DW_AT_byte_size
214 .byte 11 # DW_FORM_data1
218 .section .debug_info,"",@progbits
220 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
222 .short 4 # DWARF version number
223 .long .debug_abbrev # Offset Into Abbrev. Section
224 .byte 8 # Address Size (in bytes)
225 .byte 1 # Abbrev [1] 0xb:0x8f DW_TAG_compile_unit
226 .long .Linfo_string0 # DW_AT_producer
227 .short 33 # DW_AT_language
228 .long .Linfo_string1 # DW_AT_name
229 .long .Lline_table_start0 # DW_AT_stmt_list
230 .long .Linfo_string2 # DW_AT_comp_dir
231 .quad 0 # DW_AT_low_pc
232 .long .Ldebug_ranges0 # DW_AT_ranges
233 .byte 2 # Abbrev [2] 0x2a:0x19 DW_TAG_subprogram
234 .quad .Lfunc_begin0 # DW_AT_low_pc
235 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
236 .byte 1 # DW_AT_frame_base
238 .long .Linfo_string3 # DW_AT_name
239 .byte 1 # DW_AT_decl_file
240 .byte 8 # DW_AT_decl_line
241 .long 138 # DW_AT_type
243 .byte 3 # Abbrev [3] 0x43:0x48 DW_TAG_subprogram
244 .quad .Lfunc_begin1 + 1 # DW_AT_low_pc
245 .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc
246 .byte 1 # DW_AT_frame_base
248 .long .Linfo_string5 # DW_AT_linkage_name
249 .long .Linfo_string6 # DW_AT_name
250 .byte 1 # DW_AT_decl_file
251 .byte 1 # DW_AT_decl_line
252 .long 138 # DW_AT_type
253 .byte 4 # Abbrev [4] 0x60:0xe DW_TAG_formal_parameter
254 .byte 2 # DW_AT_location
257 .long .Linfo_string7 # DW_AT_name
258 .byte 1 # DW_AT_decl_file
259 .byte 1 # DW_AT_decl_line
260 .long 138 # DW_AT_type
261 .byte 5 # Abbrev [5] 0x6e:0x1c DW_TAG_lexical_block
262 .long .Ldebug_ranges0 # DW_AT_ranges <-- Manually modified replaced low_pc/high_pc to rangres.
263 .byte 6 # Abbrev [6] 0x7b:0xe DW_TAG_variable
264 .byte 2 # DW_AT_location
267 .long .Linfo_string9 # DW_AT_name
268 .byte 1 # DW_AT_decl_file
269 .byte 3 # DW_AT_decl_line
270 .long 138 # DW_AT_type
271 .byte 0 # End Of Children Mark
272 .byte 0 # End Of Children Mark
273 .byte 7 # Abbrev [7] 0x8b:0x7 DW_TAG_base_type
274 .long .Linfo_string4 # DW_AT_name
275 .byte 5 # DW_AT_encoding
276 .byte 4 # DW_AT_byte_size
277 .byte 7 # Abbrev [7] 0x92:0x7 DW_TAG_base_type
278 .long .Linfo_string8 # DW_AT_name
279 .byte 2 # DW_AT_encoding
280 .byte 1 # DW_AT_byte_size
281 .byte 0 # End Of Children Mark
283 .section .debug_ranges,"",@progbits
291 .section .debug_str,"MS",@progbits,1
293 .asciz "clang version 17.0.0 (https://github.com/llvm/llvm-project.git 73027ae39b1492e5b6033358a13b86d7d1e781ae)" # string offset=0
295 .asciz "main.cpp" # string offset=105
297 .asciz "base-lower-then-range-entry" # string offset=114
299 .asciz "main" # string offset=179
301 .asciz "int" # string offset=184
303 .asciz "_ZL3foob" # string offset=188
305 .asciz "foo" # string offset=197
307 .asciz "b" # string offset=201
309 .asciz "bool" # string offset=203
311 .asciz "food" # string offset=208
312 .ident "clang version 17.0.0 (https://github.com/llvm/llvm-project.git 73027ae39b1492e5b6033358a13b86d7d1e781ae)"
313 .section ".note.GNU-stack","",@progbits
315 .addrsig_sym _ZL3foob
316 .section .debug_line,"",@progbits