aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-completeness-json-output.s
blob: 9c9658308c2f9083c248a5b37cbc56189bfa7d14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj -o - | not llvm-dwarfdump -verify --verify-json=%t.json -
# RUN: FileCheck %s --input-file %t.json

# CHECK: {"error-categories":{"Name Index DIE entry missing name":{"count":10,"details":{"DW_TAG_inlined_subroutine":1,"DW_TAG_label":1,"DW_TAG_namespace":2,"DW_TAG_subprogram":2,"DW_TAG_variable":4}}},"error-count":10}
# CHECK-NOT: error: Name Index @ 0x0: Entry for DIE @ {{.*}} (DW_TAG_variable) with name var_block_addr missing.

        .section        .debug_loc,"",@progbits
.Ldebug_loc0:
        .quad   0
        .quad   1
        .short  .Lloc0_end-.Lloc0_start # Loc expr size
.Lloc0_start:
        .byte   3                       # DW_OP_addr
        .quad 0x47
.Lloc0_end:
        .quad   0
        .quad   0

        .section        .debug_abbrev,"",@progbits
        .byte   1                       # Abbreviation Code
        .byte   17                      # DW_TAG_compile_unit
        .byte   1                       # DW_CHILDREN_yes
        .byte   37                      # DW_AT_producer
        .byte   8                       # DW_FORM_string
        .byte   17                      # DW_AT_low_pc
        .byte   1                       # DW_FORM_addr
        .byte   18                      # DW_AT_high_pc
        .byte   6                       # DW_FORM_data4
        .byte   0                       # EOM(1)
        .byte   0                       # EOM(2)

        .byte   2                       # Abbreviation Code
        .byte   52                      # DW_TAG_variable
        .byte   0                       # DW_CHILDREN_no
        .byte   3                       # DW_AT_name
        .byte   8                       # DW_FORM_string
        .byte   2                       # DW_AT_location
        .byte   24                      # DW_FORM_exprloc
        .byte   0                       # EOM(1)
        .byte   0                       # EOM(2)

        .byte   3                       # Abbreviation Code
        .byte   46                      # DW_TAG_subprogram
        .byte   1                       # DW_CHILDREN_yes
        .byte   3                       # DW_AT_name
        .byte   8                       # DW_FORM_string
        .byte   110                     # DW_AT_linkage_name
        .byte   8                       # DW_FORM_string
        .byte   82                      # DW_AT_entry_pc
        .byte   1                       # DW_FORM_addr
        .byte   0                       # EOM(1)
        .byte   0                       # EOM(2)

        .byte   4                       # Abbreviation Code
        .byte   57                      # DW_TAG_namespace
        .byte   1                       # DW_CHILDREN_yes
        .byte   3                       # DW_AT_name
        .byte   8                       # DW_FORM_string
        .byte   0                       # EOM(1)
        .byte   0                       # EOM(2)

        .byte   5                       # Abbreviation Code
        .byte   52                      # DW_TAG_variable
        .byte   0                       # DW_CHILDREN_no
        .byte   3                       # DW_AT_name
        .byte   8                       # DW_FORM_string
        .byte   2                       # DW_AT_location
        .byte   23                      # DW_FORM_sec_offset
        .byte   0                       # EOM(1)
        .byte   0                       # EOM(2)

        .byte   6                       # Abbreviation Code
        .byte   57                      # DW_TAG_namespace
        .byte   1                       # DW_CHILDREN_yes
        .byte   0                       # EOM(1)
        .byte   0                       # EOM(2)

        .byte   7                       # Abbreviation Code
        .byte   29                      # DW_TAG_inlined_subroutine
        .byte   0                       # DW_CHILDREN_no
        .byte   3                       # DW_AT_name
        .byte   8                       # DW_FORM_string
        .byte   17                      # DW_AT_low_pc
        .byte   1                       # DW_FORM_addr
        .byte   18                      # DW_AT_high_pc
        .byte   1                       # DW_FORM_addr
        .byte   0                       # EOM(1)
        .byte   0                       # EOM(2)

        .byte   8                       # Abbreviation Code
        .byte   10                      # DW_TAG_label
        .byte   0                       # DW_CHILDREN_no
        .byte   3                       # DW_AT_name
        .byte   8                       # DW_FORM_string
        .byte   82                      # DW_AT_entry_pc
        .byte   1                       # DW_FORM_addr
        .byte   0                       # EOM(1)
        .byte   0                       # EOM(2)

        .byte   0                       # EOM(3)
        .section        .debug_info,"",@progbits

.Lcu_begin0:
        .long   .Lcu_end0-.Lcu_start0   # Length of Unit
.Lcu_start0:
        .short  4                       # DWARF version number
        .long   .debug_abbrev           # Offset Into Abbrev. Section
        .byte   8                       # Address Size (in bytes)
        .byte   1                       # Abbrev [1] DW_TAG_compile_unit
        .asciz  "hand-written DWARF"    # DW_AT_producer
        .quad   0x0                     # DW_AT_low_pc
        .long   0x100                   # DW_AT_high_pc

        .byte   4                       # Abbrev [4] DW_TAG_namespace
        .asciz  "namesp"                # DW_AT_name
        .byte   2                       # Abbrev [2] DW_TAG_variable
        .asciz  "var_block_addr"        # DW_AT_name
        .byte   9                       # DW_AT_location
        .byte   3                       # DW_OP_addr
        .quad   0x47
        .byte   0                       # End Of Children Mark

        .byte   6                       # Abbrev [6] DW_TAG_namespace
        .byte   5                       # Abbrev [5] DW_TAG_variable
        .asciz  "var_loc_addr"          # DW_AT_name
        .long   .Ldebug_loc0            # DW_AT_location
        .byte   0                       # End Of Children Mark

        .byte   2                       # Abbrev [2] DW_TAG_variable
        .asciz  "var_loc_tls"           # DW_AT_name
        .byte   1                       # DW_AT_location
        .byte   0x9b                    # DW_OP_form_tls_address

        .byte   2                       # Abbrev [2] DW_TAG_variable
        .asciz  "var_loc_gnu_tls"       # DW_AT_name
        .byte   1                       # DW_AT_location
        .byte   0xe0                    # DW_OP_GNU_push_tls_address

        .byte   3                       # Abbrev [3] DW_TAG_subprogram
        .asciz  "fun_name"              # DW_AT_name
        .asciz  "_Z8fun_name"           # DW_AT_linkage_name
        .quad   0x47                    # DW_AT_entry_pc
        .byte   7                       # Abbrev [7] DW_TAG_inlined_subroutine
        .asciz  "fun_inline"            # DW_AT_name
        .quad   0x48                    # DW_AT_low_pc
        .quad   0x49                    # DW_AT_high_pc
        .byte   8                       # Abbrev [8] DW_TAG_label
        .asciz  "label"                 # DW_AT_name
        .quad   0x4a                    # DW_AT_entry_pc
        .byte   0                       # End Of Children Mark

        .byte   0                       # End Of Children Mark
.Lcu_end0:

        .section        .debug_names,"",@progbits
        .long   .Lnames_end0-.Lnames_start0 # Header: contribution length
.Lnames_start0:
        .short  5                       # Header: version
        .short  0                       # Header: padding
        .long   1                       # Header: compilation unit count
        .long   0                       # Header: local type unit count
        .long   0                       # Header: foreign type unit count
        .long   0                       # Header: bucket count
        .long   0                       # Header: name count
        .long   .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
        .long   0                       # Header: augmentation length
        .long   .Lcu_begin0             # Compilation unit 0
.Lnames_abbrev_start0:
        .byte   0                       # End of abbrev list
.Lnames_abbrev_end0:
.Lnames_entries0:
.Lnames_end0: