xref: /llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/debug_rnglists.s (revision fdede92d435068f31e7ea3a1dddb46d50343dd8c)
1# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s > %t
2# RUN: %lldb %t -o "image lookup -v -s lookup_rnglists" \
3# RUN:   -o "image lookup -v -s lookup_rnglists2" -o exit | FileCheck %s
4
5# CHECK-LABEL: image lookup -v -s lookup_rnglists
6# CHECK:  Function: id = {0x00000030}, name = "rnglists", range = [0x0000000000000000-0x0000000000000004)
7# CHECK:    Blocks: id = {0x00000030}, range = [0x00000000-0x00000004)
8# CHECK-NEXT:       id = {0x00000046}, ranges = [0x00000001-0x00000002)[0x00000003-0x00000004)
9
10# CHECK-LABEL: image lookup -v -s lookup_rnglists2
11# CHECK:  Function: id = {0x0000007a}, name = "rnglists2", range = [0x0000000000000004-0x0000000000000007)
12# CHECK:    Blocks: id = {0x0000007a}, range = [0x00000004-0x00000007)
13# CHECK-NEXT:       id = {0x00000091}, range = [0x00000005-0x00000007)
14
15        .text
16        .p2align 12
17rnglists:
18        nop
19.Lblock1_begin:
20lookup_rnglists:
21        nop
22.Lblock1_end:
23        nop
24.Lblock2_begin:
25        nop
26.Lblock2_end:
27.Lrnglists_end:
28
29rnglists2:
30        nop
31.Lblock3_begin:
32lookup_rnglists2:
33        nop
34        nop
35.Lblock3_end:
36.Lrnglists2_end:
37
38        .section        .debug_abbrev,"",@progbits
39        .byte   1                       # Abbreviation Code
40        .byte   17                      # DW_TAG_compile_unit
41        .byte   1                       # DW_CHILDREN_yes
42        .byte   37                      # DW_AT_producer
43        .byte   8                       # DW_FORM_string
44        .byte   17                      # DW_AT_low_pc
45        .byte   1                       # DW_FORM_addr
46        .byte   18                      # DW_AT_high_pc
47        .byte   6                       # DW_FORM_data4
48        .byte   116                     # DW_AT_rnglists_base
49        .byte   23                      # DW_FORM_sec_offset
50        .byte   0                       # EOM(1)
51        .byte   0                       # EOM(2)
52        .byte   2                       # Abbreviation Code
53        .byte   46                      # DW_TAG_subprogram
54        .byte   1                       # DW_CHILDREN_yes
55        .byte   17                      # DW_AT_low_pc
56        .byte   1                       # DW_FORM_addr
57        .byte   18                      # DW_AT_high_pc
58        .byte   6                       # DW_FORM_data4
59        .byte   3                       # DW_AT_name
60        .byte   8                       # DW_FORM_string
61        .byte   0                       # EOM(1)
62        .byte   0                       # EOM(2)
63        .byte   5                       # Abbreviation Code
64        .byte   11                      # DW_TAG_lexical_block
65        .byte   0                       # DW_CHILDREN_no
66        .byte   85                      # DW_AT_ranges
67        .byte   35                      # DW_FORM_rnglistx
68        .byte   0                       # EOM(1)
69        .byte   0                       # EOM(2)
70        .byte   0                       # EOM(3)
71
72        .section        .debug_info,"",@progbits
73.Lcu_begin0:
74        .long   .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
75.Ldebug_info_start0:
76        .short  5                       # DWARF version number
77        .byte   1                       # DWARF Unit Type
78        .byte   8                       # Address Size (in bytes)
79        .long   .debug_abbrev           # Offset Into Abbrev. Section
80        .byte   1                       # Abbrev [1] 0xc:0x5f DW_TAG_compile_unit
81        .asciz  "Hand-written DWARF"    # DW_AT_producer
82        .quad   rnglists                # DW_AT_low_pc
83        .long   .Lrnglists_end-rnglists # DW_AT_high_pc
84        .long   .Lrnglists_table_base0  # DW_AT_rnglists_base
85        .byte   2                       # Abbrev [2] 0x2b:0x37 DW_TAG_subprogram
86        .quad   rnglists                # DW_AT_low_pc
87        .long   .Lrnglists_end-rnglists # DW_AT_high_pc
88        .asciz  "rnglists"              # DW_AT_name
89        .byte   5                       # Abbrev [5] 0x52:0xf DW_TAG_lexical_block
90        .byte   0                       # DW_AT_ranges
91        .byte   0                       # End Of Children Mark
92        .byte   0                       # End Of Children Mark
93.Ldebug_info_end0:
94
95.Lcu_begin1:
96        .long   .Ldebug_info_end1-.Ldebug_info_start1 # Length of Unit
97.Ldebug_info_start1:
98        .short  5                       # DWARF version number
99        .byte   1                       # DWARF Unit Type
100        .byte   8                       # Address Size (in bytes)
101        .long   .debug_abbrev           # Offset Into Abbrev. Section
102        .byte   1                       # Abbrev [1] 0xc:0x5f DW_TAG_compile_unit
103        .asciz  "Hand-written DWARF"    # DW_AT_producer
104        .quad   rnglists2               # DW_AT_low_pc
105        .long   .Lrnglists2_end-rnglists2 # DW_AT_high_pc
106        .long   .Lrnglists_table_base1  # DW_AT_rnglists_base
107        .byte   2                       # Abbrev [2] 0x2b:0x37 DW_TAG_subprogram
108        .quad   rnglists2               # DW_AT_low_pc
109        .long   .Lrnglists2_end-rnglists2 # DW_AT_high_pc
110        .asciz  "rnglists2"             # DW_AT_name
111        .byte   5                       # Abbrev [5] 0x52:0xf DW_TAG_lexical_block
112        .byte   0                       # DW_AT_ranges
113        .byte   0                       # End Of Children Mark
114        .byte   0                       # End Of Children Mark
115.Ldebug_info_end1:
116
117        .section        .debug_rnglists,"",@progbits
118        .long   .Ldebug_rnglist_table_end0-.Ldebug_rnglist_table_start0 # Length
119.Ldebug_rnglist_table_start0:
120        .short  5                       # Version
121        .byte   8                       # Address size
122        .byte   0                       # Segment selector size
123        .long   1                       # Offset entry count
124.Lrnglists_table_base0:
125        .long   .Ldebug_ranges0-.Lrnglists_table_base0
126.Ldebug_ranges0:
127        .byte   4                       # DW_RLE_offset_pair
128        .uleb128 .Lblock2_begin-rnglists  #   starting offset
129        .uleb128 .Lblock2_end-rnglists    #   ending offset
130        .byte   4                       # DW_RLE_offset_pair
131        .uleb128 .Lblock1_begin-rnglists  #   starting offset
132        .uleb128 .Lblock1_end-rnglists    #   ending offset
133        .byte   0                       # DW_RLE_end_of_list
134.Ldebug_rnglist_table_end0:
135
136        .long   .Ldebug_rnglist_table_end1-.Ldebug_rnglist_table_start1 # Length
137.Ldebug_rnglist_table_start1:
138        .short  5                       # Version
139        .byte   8                       # Address size
140        .byte   0                       # Segment selector size
141        .long   1                       # Offset entry count
142.Lrnglists_table_base1:
143        .long   .Ldebug_ranges1-.Lrnglists_table_base1
144.Ldebug_ranges1:
145        .byte   4                       # DW_RLE_offset_pair
146        .uleb128 .Lblock3_begin-rnglists2 #   starting offset
147        .uleb128 .Lblock3_end-rnglists2   #   ending offset
148        .byte   0                       # DW_RLE_end_of_list
149.Ldebug_rnglist_table_end1:
150