1## Check that lldb can locate a static constant variable when its declaration is 2## referenced by a debug_names index. This is a non-conforming extension used by 3## dsymutil. 4 5# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s > %t 6# RUN: %lldb %t -o "target variable Class::constant" \ 7# RUN: -o "expr -l c++ -- Class::constant" -o exit | FileCheck %s 8 9# CHECK: (lldb) target variable Class::constant 10# CHECK-NEXT: (const int) Class::constant = 47 11# CHECK: (lldb) expr -l c++ -- Class::constant 12# CHECK-NEXT: (const int) $0 = 47 13 14 .section .debug_abbrev,"",@progbits 15 .byte 1 # Abbreviation Code 16 .byte 17 # DW_TAG_compile_unit 17 .byte 1 # DW_CHILDREN_yes 18 .byte 37 # DW_AT_producer 19 .byte 8 # DW_FORM_string 20 .byte 19 # DW_AT_language 21 .byte 5 # DW_FORM_data2 22 .byte 0 # EOM(1) 23 .byte 0 # EOM(2) 24 .byte 3 # Abbreviation Code 25 .byte 2 # DW_TAG_class_type 26 .byte 1 # DW_CHILDREN_yes 27 .byte 54 # DW_AT_calling_convention 28 .byte 11 # DW_FORM_data1 29 .byte 3 # DW_AT_name 30 .byte 14 # DW_FORM_strp 31 .byte 11 # DW_AT_byte_size 32 .byte 11 # DW_FORM_data1 33 .byte 0 # EOM(1) 34 .byte 0 # EOM(2) 35 .byte 4 # Abbreviation Code 36 .byte 52 # DW_TAG_variable 37 .byte 0 # DW_CHILDREN_no 38 .byte 3 # DW_AT_name 39 .byte 14 # DW_FORM_strp 40 .byte 73 # DW_AT_type 41 .byte 19 # DW_FORM_ref4 42 .byte 63 # DW_AT_external 43 .byte 25 # DW_FORM_flag_present 44 .byte 60 # DW_AT_declaration 45 .byte 25 # DW_FORM_flag_present 46 .byte 28 # DW_AT_const_value 47 .byte 13 # DW_FORM_sdata 48 .byte 0 # EOM(1) 49 .byte 0 # EOM(2) 50 .byte 5 # Abbreviation Code 51 .byte 38 # DW_TAG_const_type 52 .byte 0 # DW_CHILDREN_no 53 .byte 73 # DW_AT_type 54 .byte 19 # DW_FORM_ref4 55 .byte 0 # EOM(1) 56 .byte 0 # EOM(2) 57 .byte 6 # Abbreviation Code 58 .byte 36 # DW_TAG_base_type 59 .byte 0 # DW_CHILDREN_no 60 .byte 3 # DW_AT_name 61 .byte 14 # DW_FORM_strp 62 .byte 62 # DW_AT_encoding 63 .byte 11 # DW_FORM_data1 64 .byte 11 # DW_AT_byte_size 65 .byte 11 # DW_FORM_data1 66 .byte 0 # EOM(1) 67 .byte 0 # EOM(2) 68 .byte 0 # EOM(3) 69 .section .debug_info,"",@progbits 70.Lcu_begin0: 71 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit 72.Ldebug_info_start0: 73 .short 5 # DWARF version number 74 .byte 1 # DWARF Unit Type 75 .byte 8 # Address Size (in bytes) 76 .long .debug_abbrev # Offset Into Abbrev. Section 77 .byte 1 # Abbrev [1] 0xc:0x40 DW_TAG_compile_unit 78 .asciz "Hand-written DWARF" # DW_AT_producer 79 .short 33 # DW_AT_language 80.LClass: 81 .byte 3 # Abbrev [3] 0x29:0x10 DW_TAG_class_type 82 .byte 5 # DW_AT_calling_convention 83 .long .Linfo_string4 # DW_AT_name 84 .byte 1 # DW_AT_byte_size 85.Lvariable: 86 .byte 4 # Abbrev [4] 0x2f:0x9 DW_TAG_variable 87 .long .Linfo_string5 # DW_AT_name 88 .long .Lconst_int-.Lcu_begin0 # DW_AT_type 89 # DW_AT_external 90 # DW_AT_declaration 91 .byte 47 # DW_AT_const_value 92 .byte 0 # End Of Children Mark 93.Lconst_int: 94 .byte 5 # Abbrev [5] 0x39:0x5 DW_TAG_const_type 95 .long .Lint-.Lcu_begin0 # DW_AT_type 96.Lint: 97 .byte 6 # Abbrev [6] 0x3e:0x4 DW_TAG_base_type 98 .long .Linfo_string6 # DW_AT_name 99 .byte 5 # DW_AT_encoding 100 .byte 4 # DW_AT_byte_size 101 .byte 0 # End Of Children Mark 102.Ldebug_info_end0: 103 104 .section .debug_str,"MS",@progbits,1 105.Linfo_string4: 106 .asciz "Class" 107.Linfo_string5: 108 .asciz "constant" 109.Linfo_string6: 110 .asciz "int" 111 112 .section .debug_names,"",@progbits 113 .long .Lnames_end0-.Lnames_start0 # Header: unit length 114.Lnames_start0: 115 .short 5 # Header: version 116 .short 0 # Header: padding 117 .long 1 # Header: compilation unit count 118 .long 0 # Header: local type unit count 119 .long 0 # Header: foreign type unit count 120 .long 0 # Header: bucket count 121 .long 3 # Header: name count 122 .long .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size 123 .long 8 # Header: augmentation string size 124 .ascii "LLVM0700" # Header: augmentation string 125 .long .Lcu_begin0 # Compilation unit 0 126 .long .Linfo_string4 # String: Class 127 .long .Linfo_string5 # String: constant 128 .long .Linfo_string6 # String: int 129 .long .Lnames0-.Lnames_entries0 130 .long .Lnames3-.Lnames_entries0 131 .long .Lnames1-.Lnames_entries0 132.Lnames_abbrev_start0: 133 .byte 1 # Abbrev code 134 .byte 2 # DW_TAG_class_type 135 .byte 3 # DW_IDX_die_offset 136 .byte 19 # DW_FORM_ref4 137 .byte 0 # End of abbrev 138 .byte 0 # End of abbrev 139 .byte 2 # Abbrev code 140 .byte 52 # DW_TAG_variable 141 .byte 3 # DW_IDX_die_offset 142 .byte 19 # DW_FORM_ref4 143 .byte 0 # End of abbrev 144 .byte 0 # End of abbrev 145 .byte 3 # Abbrev code 146 .byte 36 # DW_TAG_base_type 147 .byte 3 # DW_IDX_die_offset 148 .byte 19 # DW_FORM_ref4 149 .byte 0 # End of abbrev 150 .byte 0 # End of abbrev 151 .byte 0 # End of abbrev list 152.Lnames_abbrev_end0: 153.Lnames_entries0: 154.Lnames0: 155 .byte 1 # Abbreviation code 156 .long .LClass-.Lcu_begin0 # DW_IDX_die_offset 157 .byte 0 # DW_IDX_parent 158 # End of list: Class 159.Lnames3: 160 .byte 2 # Abbreviation code 161 .long .Lvariable-.Lcu_begin0 # DW_IDX_die_offset 162 .byte 0 # DW_IDX_parent 163 # End of list: constant 164.Lnames1: 165 .byte 3 # Abbreviation code 166 .long .Lint-.Lcu_begin0 # DW_IDX_die_offset 167 .byte 0 # DW_IDX_parent 168 # End of list: int 169.Lnames_end0: 170