1 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s > %t
2 # RUN: %lldb %t -o "image lookup -v -s lookup_ranges" -o exit 2>%t.error | FileCheck %s
3 # RUN: cat %t.error | FileCheck %s --check-prefix ERROR
5 # ERROR: DIE has DW_AT_ranges(DW_FORM_sec_offset 0x0000000000000047) attribute, but range extraction failed (No debug_ranges section),
6 # CHECK: Function: id = {0x0000001c}, name = "ranges", range = [0x0000000000000000-0x0000000000000004)
7 # CHECK: Blocks: id = {0x0000001c}, range = [0x00000000-0x00000004)
12 .type ranges,@function
20 .size ranges, .Lranges_end-ranges
22 .section .debug_str,"MS",@progbits,1
24 .asciz "Hand-written DWARF"
28 .section .debug_abbrev,"",@progbits
29 .byte 1 # Abbreviation Code
30 .byte 17 # DW_TAG_compile_unit
31 .byte 1 # DW_CHILDREN_yes
32 .byte 37 # DW_AT_producer
33 .byte 14 # DW_FORM_strp
34 .byte 17 # DW_AT_low_pc
35 .byte 1 # DW_FORM_addr
36 .byte 18 # DW_AT_high_pc
37 .byte 6 # DW_FORM_data4
40 .byte 2 # Abbreviation Code
41 .byte 46 # DW_TAG_subprogram
42 .byte 1 # DW_CHILDREN_yes
43 .byte 17 # DW_AT_low_pc
44 .byte 1 # DW_FORM_addr
45 .byte 18 # DW_AT_high_pc
46 .byte 6 # DW_FORM_data4
48 .byte 14 # DW_FORM_strp
51 .byte 5 # Abbreviation Code
52 .byte 11 # DW_TAG_lexical_block
53 .byte 0 # DW_CHILDREN_no
54 .byte 85 # DW_AT_ranges
55 .byte 23 # DW_FORM_sec_offset
60 .section .debug_info,"",@progbits
62 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
64 .short 4 # DWARF version number
65 .long .debug_abbrev # Offset Into Abbrev. Section
66 .byte 8 # Address Size (in bytes)
67 .byte 1 # Abbrev [1] 0xb:0x7b DW_TAG_compile_unit
68 .long .Lproducer # DW_AT_producer
69 .quad ranges # DW_AT_low_pc
70 .long .Lranges_end-ranges # DW_AT_high_pc
71 .byte 2 # Abbrev [2] 0x2a:0x4d DW_TAG_subprogram
72 .quad ranges # DW_AT_low_pc
73 .long .Lranges_end-ranges # DW_AT_high_pc
74 .long .Lranges # DW_AT_name
75 .byte 5 # Abbrev [5] 0x61:0x15 DW_TAG_lexical_block
76 .long 0x47 # DW_AT_ranges
77 .byte 0 # End Of Children Mark
78 .byte 0 # End Of Children Mark