| 1 |
## This test checks debug info for the types located into the |
| 2 |
## different compilation units from the single object file. |
| 3 |
## Type definition for the "class1" should be removed from the |
| 4 |
## second compilation unit. |
| 5 |
|
| 6 |
# RUN: yaml2obj %s -o %t.o |
| 7 |
# RUN: echo '---' > %t2.map |
| 8 |
# RUN: echo "triple: 'x86_64-apple-darwin'" >> %t2.map |
| 9 |
# RUN: echo 'objects:' >> %t2.map |
| 10 |
# RUN: echo " - filename: '%t.o'" >> %t2.map |
| 11 |
# RUN: echo ' symbols:' >> %t2.map |
| 12 |
# RUN: echo ' - { sym: __Z3foov, objAddr: 0x0, binAddr: 0x10000, size: 0x10 }' >> %t2.map |
| 13 |
# RUN: echo '...' >> %t2.map |
| 14 |
# RUN: dsymutil -y %t2.map -f -o - | llvm-dwarfdump -a - | FileCheck %s |
| 15 |
|
| 16 |
# CHECK: file format Mach-O 64-bit x86-64 |
| 17 |
# CHECK: .debug_info contents: |
| 18 |
# CHECK: Compile Unit: |
| 19 |
# CHECK: DW_TAG_compile_unit |
| 20 |
# CHECK: DW_AT_name{{.*}}"CU1" |
| 21 |
# CHECK: DW_TAG_class_type{{.*[[:space:]].*}}DW_AT_name{{.*}}"class1" |
| 22 |
# CHECK: DW_TAG_variable |
| 23 |
# CHECK: DW_AT_name{{.*}}"var1" |
| 24 |
# CHECK: DW_AT_const_value |
| 25 |
# CHECK: DW_AT_type (0x00000000[[CLASS1:[0-9a-f]*]] |
| 26 |
|
| 27 |
# CHECK: Compile Unit: |
| 28 |
# CHECK: DW_TAG_compile_unit |
| 29 |
# CHECK: DW_AT_name{{.*}}"CU2" |
| 30 |
# CHECK-NOT: DW_TAG_class_type |
| 31 |
# CHECK-NOT: "class1" |
| 32 |
# CHECK: DW_TAG_variable |
| 33 |
# CHECK: DW_AT_name{{.*}}"var2" |
| 34 |
# CHECK: DW_AT_const_value |
| 35 |
# CHECK: DW_AT_type (0x00000000[[CLASS1]] |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
--- !mach-o |
| 40 |
FileHeader: |
| 41 |
magic: 0xFEEDFACF |
| 42 |
cputype: 0x01000007 |
| 43 |
cpusubtype: 0x00000003 |
| 44 |
filetype: 0x00000001 |
| 45 |
ncmds: 2 |
| 46 |
sizeofcmds: 376 |
| 47 |
flags: 0x00002000 |
| 48 |
reserved: 0x00000000 |
| 49 |
LoadCommands: |
| 50 |
- cmd: LC_SEGMENT_64 |
| 51 |
cmdsize: 232 |
| 52 |
segname: '' |
| 53 |
vmaddr: 0x00 |
| 54 |
vmsize: 0x300 |
| 55 |
fileoff: 0x300 |
| 56 |
filesize: 0x300 |
| 57 |
maxprot: 7 |
| 58 |
initprot: 7 |
| 59 |
nsects: 2 |
| 60 |
flags: 0 |
| 61 |
Sections: |
| 62 |
- sectname: __debug_abbrev |
| 63 |
segname: __DWARF |
| 64 |
addr: 0x000000000000000F |
| 65 |
size: 0x3c |
| 66 |
offset: 0x00000380 |
| 67 |
align: 0 |
| 68 |
reloff: 0x00000000 |
| 69 |
nreloc: 0 |
| 70 |
flags: 0x02000000 |
| 71 |
reserved1: 0x00000000 |
| 72 |
reserved2: 0x00000000 |
| 73 |
reserved3: 0x00000000 |
| 74 |
- sectname: __debug_info |
| 75 |
segname: __DWARF |
| 76 |
addr: 0x000000000000100 |
| 77 |
size: 0x62 |
| 78 |
offset: 0x00000410 |
| 79 |
align: 0 |
| 80 |
reloff: 0x00000600 |
| 81 |
nreloc: 1 |
| 82 |
flags: 0x02000000 |
| 83 |
reserved1: 0x00000000 |
| 84 |
reserved2: 0x00000000 |
| 85 |
reserved3: 0x00000000 |
| 86 |
relocations: |
| 87 |
- address: 0x1FC |
| 88 |
symbolnum: 1 |
| 89 |
pcrel: true |
| 90 |
length: 3 |
| 91 |
extern: true |
| 92 |
type: 0 |
| 93 |
scattered: false |
| 94 |
value: 0 |
| 95 |
- cmd: LC_SYMTAB |
| 96 |
cmdsize: 24 |
| 97 |
symoff: 0x700 |
| 98 |
nsyms: 2 |
| 99 |
stroff: 0x720 |
| 100 |
strsize: 10 |
| 101 |
LinkEditData: |
| 102 |
NameList: |
| 103 |
- n_strx: 1 |
| 104 |
n_type: 0x0F |
| 105 |
n_sect: 1 |
| 106 |
n_desc: 0 |
| 107 |
n_value: 0 |
| 108 |
- n_strx: 1 |
| 109 |
n_type: 0x0F |
| 110 |
n_sect: 1 |
| 111 |
n_desc: 0 |
| 112 |
n_value: 0 |
| 113 |
StringTable: |
| 114 |
- '' |
| 115 |
- '__Z3foov' |
| 116 |
- '' |
| 117 |
DWARF: |
| 118 |
debug_abbrev: |
| 119 |
- Table: |
| 120 |
- Tag: DW_TAG_compile_unit |
| 121 |
Children: DW_CHILDREN_yes |
| 122 |
Attributes: |
| 123 |
- Attribute: DW_AT_producer |
| 124 |
Form: DW_FORM_string |
| 125 |
- Attribute: DW_AT_language |
| 126 |
Form: DW_FORM_data2 |
| 127 |
- Attribute: DW_AT_name |
| 128 |
Form: DW_FORM_string |
| 129 |
- Tag: DW_TAG_class_type |
| 130 |
Children: DW_CHILDREN_no |
| 131 |
Attributes: |
| 132 |
- Attribute: DW_AT_name |
| 133 |
Form: DW_FORM_string |
| 134 |
- Tag: DW_TAG_variable |
| 135 |
Children: DW_CHILDREN_no |
| 136 |
Attributes: |
| 137 |
- Attribute: DW_AT_name |
| 138 |
Form: DW_FORM_string |
| 139 |
- Attribute: DW_AT_const_value |
| 140 |
Form: DW_FORM_data4 |
| 141 |
- Attribute: DW_AT_type |
| 142 |
Form: DW_FORM_ref4 |
| 143 |
- Table: |
| 144 |
- Tag: DW_TAG_compile_unit |
| 145 |
Children: DW_CHILDREN_yes |
| 146 |
Attributes: |
| 147 |
- Attribute: DW_AT_producer |
| 148 |
Form: DW_FORM_string |
| 149 |
- Attribute: DW_AT_language |
| 150 |
Form: DW_FORM_data2 |
| 151 |
- Attribute: DW_AT_name |
| 152 |
Form: DW_FORM_string |
| 153 |
- Tag: DW_TAG_class_type |
| 154 |
Children: DW_CHILDREN_no |
| 155 |
Attributes: |
| 156 |
- Attribute: DW_AT_name |
| 157 |
Form: DW_FORM_string |
| 158 |
- Tag: DW_TAG_variable |
| 159 |
Children: DW_CHILDREN_no |
| 160 |
Attributes: |
| 161 |
- Attribute: DW_AT_name |
| 162 |
Form: DW_FORM_string |
| 163 |
- Attribute: DW_AT_const_value |
| 164 |
Form: DW_FORM_data4 |
| 165 |
- Attribute: DW_AT_type |
| 166 |
Form: DW_FORM_ref4 |
| 167 |
debug_info: |
| 168 |
- Version: 4 |
| 169 |
Entries: |
| 170 |
- AbbrCode: 1 |
| 171 |
Values: |
| 172 |
- CStr: by_hand |
| 173 |
- Value: 0x04 |
| 174 |
- CStr: CU1 |
| 175 |
- AbbrCode: 2 |
| 176 |
Values: |
| 177 |
- CStr: class1 |
| 178 |
- AbbrCode: 3 |
| 179 |
Values: |
| 180 |
- CStr: var1 |
| 181 |
- Value: 0x00000000 |
| 182 |
- Value: 0x0000001a |
| 183 |
- AbbrCode: 0 |
| 184 |
- Version: 4 |
| 185 |
Entries: |
| 186 |
- AbbrCode: 1 |
| 187 |
Values: |
| 188 |
- CStr: by_hand |
| 189 |
- Value: 0x04 |
| 190 |
- CStr: CU2 |
| 191 |
- AbbrCode: 2 |
| 192 |
Values: |
| 193 |
- CStr: class1 |
| 194 |
- AbbrCode: 3 |
| 195 |
Values: |
| 196 |
- CStr: var2 |
| 197 |
- Value: 0x00000000 |
| 198 |
- Value: 0x0000001a |
| 199 |
- AbbrCode: 0 |
| 200 |
... |