1 # DW_AT_ranges can use DW_FORM_sec_offset (instead of DW_FORM_rnglistx).
2 # In such case DW_AT_rnglists_base does not need to be present.
6 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s > %t
7 # RUN: %lldb %t -o "image lookup -v -s lookup_rnglists" \
8 # RUN: -o exit | FileCheck %s
10 # Failure was the block range 1..2 was not printed plus:
11 # error: DW_AT_range-DW_FORM_sec_offset.s.tmp {0x000000000000003f}: DIE has DW_AT_ranges(0xc) attribute, but range extraction failed (missing or invalid range list table), please file a bug and attach the file at the start of this error message
13 # CHECK-LABEL: image lookup -v -s lookup_rnglists
14 # CHECK: Function: id = {0x00000029}, name = "rnglists", range = [0x0000000000000000-0x0000000000000003)
15 # CHECK: Blocks: id = {0x00000029}, range = [0x00000000-0x00000003)
16 # CHECK-NEXT: id = {0x0000003f}, range = [0x00000001-0x00000002)
18 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj \
19 # RUN: --defsym RNGLISTX=0 %s > %t-rnglistx
20 # RUN: %lldb %t-rnglistx -o "image lookup -v -s lookup_rnglists" \
21 # RUN: -o exit 2>%t.error | FileCheck --check-prefix=RNGLISTX %s
22 # RUN: cat %t.error | FileCheck --check-prefix=ERROR %s
24 # RNGLISTX-LABEL: image lookup -v -s lookup_rnglists
25 # ERROR: error: {{.*}} [0x000000000000003f]: DIE has DW_AT_ranges(DW_FORM_rnglistx 0x0000000000000000) attribute, but range extraction failed (DW_FORM_rnglistx cannot be used without DW_AT_rnglists_base for CU at 0x0000000000000000), please file a bug and attach the file at the start of this error message
27 # RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj \
28 # RUN: --defsym RNGLISTX=0 --defsym RNGLISTBASE=0 %s > %t-rnglistbase
29 # RUN: %lldb %t-rnglistbase -o "image lookup -v -s lookup_rnglists" \
30 # RUN: -o exit 2>%t.error | FileCheck --check-prefix=RNGLISTBASE %s
31 # RUN: cat %t.error | FileCheck --check-prefix=ERRORBASE %s
33 # RNGLISTBASE-LABEL: image lookup -v -s lookup_rnglists
34 # ERRORBASE: error: {{.*}}-rnglistbase [0x0000000000000043]: DIE has DW_AT_ranges(DW_FORM_rnglistx 0x0000000000000000) attribute, but range extraction failed (invalid range list table index 0; OffsetEntryCount is 0, DW_AT_rnglists_base is 24), please file a bug and attach the file at the start of this error message
46 .section .debug_abbrev,"",@progbits
47 .byte 1 # Abbreviation Code
48 .byte 17 # DW_TAG_compile_unit
49 .byte 1 # DW_CHILDREN_yes
50 .byte 37 # DW_AT_producer
51 .byte 8 # DW_FORM_string
52 .byte 17 # DW_AT_low_pc
53 .byte 27 # DW_FORM_addrx
54 .byte 18 # DW_AT_high_pc
55 .byte 6 # DW_FORM_data4
56 .byte 115 # DW_AT_addr_base
57 .byte 23 # DW_FORM_sec_offset
59 .byte 0x74 # DW_AT_rnglists_base
60 .byte 23 # DW_FORM_sec_offset
64 .byte 2 # Abbreviation Code
65 .byte 46 # DW_TAG_subprogram
66 .byte 1 # DW_CHILDREN_yes
67 .byte 17 # DW_AT_low_pc
68 .byte 1 # DW_FORM_addr
69 .byte 18 # DW_AT_high_pc
70 .byte 6 # DW_FORM_data4
72 .byte 8 # DW_FORM_string
75 .byte 5 # Abbreviation Code
76 .byte 11 # DW_TAG_lexical_block
77 .byte 0 # DW_CHILDREN_no
78 .byte 85 # DW_AT_ranges
80 .byte 0x17 # DW_FORM_sec_offset
82 .byte 0x23 # DW_FORM_rnglistx
88 .section .debug_info,"",@progbits
90 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
92 .short 5 # DWARF version number
93 .byte 1 # DWARF Unit Type
94 .byte 8 # Address Size (in bytes)
95 .long .debug_abbrev # Offset Into Abbrev. Section
96 .byte 1 # Abbrev [1] 0xc:0x5f DW_TAG_compile_unit
97 .asciz "Hand-written DWARF" # DW_AT_producer
98 .byte 0 # DW_AT_low_pc
99 .long .Lrnglists_end-rnglists # DW_AT_high_pc
100 .long .Laddr_table_base0 # DW_AT_addr_base
102 .long .Ldebug_ranges1 # DW_AT_rnglists_base
104 .byte 2 # Abbrev [2] 0x2b:0x37 DW_TAG_subprogram
105 .quad rnglists # DW_AT_low_pc
106 .long .Lrnglists_end-rnglists # DW_AT_high_pc
107 .asciz "rnglists" # DW_AT_name
108 .byte 5 # Abbrev [5] 0x52:0xf DW_TAG_lexical_block
110 .long .Ldebug_ranges1 # DW_AT_ranges DW_FORM_sec_offset
112 .uleb128 0 # DW_AT_ranges DW_FORM_rnglistx
114 .byte 0 # End Of Children Mark
115 .byte 0 # End Of Children Mark
118 .section .debug_addr,"",@progbits
119 .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
121 .short 5 # DWARF version number
122 .byte 8 # Address size
123 .byte 0 # Segment selector size
128 .section .debug_rnglists,"",@progbits
129 .long .Ldebug_rnglist_table_end0-.Ldebug_rnglist_table_start0 # Length
130 .Ldebug_rnglist_table_start0:
132 .byte 8 # Address size
133 .byte 0 # Segment selector size
134 .long 0 # Offset entry count
135 .Ldebug_rnglist_table_end0:
137 .long .Ldebug_rnglist_table_end1-.Ldebug_rnglist_table_start1 # Length
138 .Ldebug_rnglist_table_start1:
140 .byte 8 # Address size
141 .byte 0 # Segment selector size
142 .long 0 # Offset entry count
144 .byte 4 # DW_RLE_offset_pair
145 .uleb128 .Lblock1_begin-rnglists # starting offset
146 .uleb128 .Lblock1_end-rnglists # ending offset
147 .byte 0 # DW_RLE_end_of_list
148 .Ldebug_rnglist_table_end1: