| 1 |
# RUN: yaml2obj %s -o %t.dSYM |
| 2 |
|
| 3 |
## Verify that we don't keep merged functions by default |
| 4 |
# RUN: llvm-gsymutil --num-threads=1 --convert %t.dSYM --out-file=%t.default.gSYM |
| 5 |
# RUN: llvm-gsymutil --verify --verbose %t.default.gSYM | FileCheck --check-prefix=CHECK-GSYM-DEFAULT %s |
| 6 |
|
| 7 |
## Verify that we keep merged functions when specyfing --merged-functions |
| 8 |
# RUN: llvm-gsymutil --num-threads=1 --convert %t.dSYM --out-file=%t.keep.gSYM --merged-functions |
| 9 |
# RUN: llvm-gsymutil --verify --verbose %t.keep.gSYM | FileCheck --check-prefix=CHECK-GSYM-KEEP %s |
| 10 |
|
| 11 |
## Note: For identical functions, the dSYM / gSYM cannot be counted on to be deterministic. |
| 12 |
## So we can only match the general structure, not exact function names / offsets |
| 13 |
|
| 14 |
|
| 15 |
# CHECK-GSYM-DEFAULT-NOT: Merged FunctionInfos |
| 16 |
# CHECK-GSYM-DEFAULT: FunctionInfo @ 0x{{[0-9a-fA-F]+}}: [0x{{[0-9a-fA-F]+}} - 0x{{[0-9a-fA-F]+}}) "my_func_03" |
| 17 |
|
| 18 |
|
| 19 |
# CHECK-GSYM-KEEP: Address Table: |
| 20 |
# CHECK-GSYM-KEEP-NEXT: INDEX OFFSET16 (ADDRESS) |
| 21 |
# CHECK-GSYM-KEEP-NEXT: ====== =============================== |
| 22 |
# CHECK-GSYM-KEEP-NEXT: [ 0] 0x{{[0-9a-fA-F]+}} |
| 23 |
|
| 24 |
# CHECK-GSYM-KEEP: Address Info Offsets: |
| 25 |
# CHECK-GSYM-KEEP-NEXT: INDEX Offset |
| 26 |
# CHECK-GSYM-KEEP-NEXT: ====== ========== |
| 27 |
# CHECK-GSYM-KEEP-NEXT: [ 0] 0x{{[0-9a-fA-F]+}} |
| 28 |
|
| 29 |
# CHECK-GSYM-KEEP: Files: |
| 30 |
# CHECK-GSYM-KEEP-NEXT: INDEX DIRECTORY BASENAME PATH |
| 31 |
# CHECK-GSYM-KEEP-NEXT: ====== ========== ========== ============================== |
| 32 |
# CHECK-GSYM-KEEP-NEXT: [ 0] 0x{{[0-9a-fA-F]+}} 0x{{[0-9a-fA-F]+}} |
| 33 |
# CHECK-GSYM-KEEP-NEXT: [ 1] 0x{{[0-9a-fA-F]+}} 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_01.cpp |
| 34 |
# CHECK-GSYM-KEEP-NEXT: [ 2] 0x{{[0-9a-fA-F]+}} 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_02.cpp |
| 35 |
# CHECK-GSYM-KEEP-NEXT: [ 3] 0x{{[0-9a-fA-F]+}} 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_03.cpp |
| 36 |
|
| 37 |
# CHECK-GSYM-KEEP: FunctionInfo @ 0x{{[0-9a-fA-F]+}}: [0x{{[0-9a-fA-F]+}} - 0x{{[0-9a-fA-F]+}}) "my_func_01" |
| 38 |
# CHECK-GSYM-KEEP-NEXT: LineTable: |
| 39 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_01.cpp:5 |
| 40 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_01.cpp:7 |
| 41 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_01.cpp:9 |
| 42 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_01.cpp:8 |
| 43 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_01.cpp:11 |
| 44 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_01.cpp:10 |
| 45 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_01.cpp:6 |
| 46 |
# CHECK-GSYM-KEEP-NEXT: ++ Merged FunctionInfos[0]: |
| 47 |
# CHECK-GSYM-KEEP-NEXT: [0x{{[0-9a-fA-F]+}} - 0x{{[0-9a-fA-F]+}}) "my_func_02" |
| 48 |
# CHECK-GSYM-KEEP-NEXT: LineTable: |
| 49 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_02.cpp:5 |
| 50 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_02.cpp:7 |
| 51 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_02.cpp:9 |
| 52 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_02.cpp:8 |
| 53 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_02.cpp:11 |
| 54 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_02.cpp:10 |
| 55 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_02.cpp:6 |
| 56 |
# CHECK-GSYM-KEEP-NEXT: ++ Merged FunctionInfos[1]: |
| 57 |
# CHECK-GSYM-KEEP-NEXT: [0x{{[0-9a-fA-F]+}} - 0x{{[0-9a-fA-F]+}}) "my_func_03" |
| 58 |
# CHECK-GSYM-KEEP-NEXT: LineTable: |
| 59 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_03.cpp:5 |
| 60 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_03.cpp:7 |
| 61 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_03.cpp:9 |
| 62 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_03.cpp:8 |
| 63 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_03.cpp:11 |
| 64 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_03.cpp:10 |
| 65 |
# CHECK-GSYM-KEEP-NEXT: 0x{{[0-9a-fA-F]+}} /tmp/test_gsym_yaml{{[/\\]}}out/file_03.cpp:6 |
| 66 |
|
| 67 |
## Test the lookup functionality for merged functions: |
| 68 |
# RUN: llvm-gsymutil --verify %t.keep.gSYM --address 0x248 --merged-functions | FileCheck --check-prefix=CHECK-MERGED-LOOKUP %s |
| 69 |
# RUN: llvm-gsymutil --verify %t.keep.gSYM --address 0x248 | FileCheck --check-prefix=CHECK-NORMAL-LOOKUP %s |
| 70 |
|
| 71 |
|
| 72 |
# CHECK-MERGED-LOOKUP: Found 3 functions at address 0x0000000000000248: |
| 73 |
# CHECK-MERGED-LOOKUP-NEXT: 0x0000000000000248: my_func_01 @ /tmp/test_gsym_yaml{{[/\\]}}out/file_01.cpp:5 |
| 74 |
# CHECK-MERGED-LOOKUP-NEXT-NEXT: 0x0000000000000248: my_func_02 @ /tmp/test_gsym_yaml{{[/\\]}}out/file_02.cpp:5 |
| 75 |
# CHECK-MERGED-LOOKUP-NEXT-NEXT: 0x0000000000000248: my_func_03 @ /tmp/test_gsym_yaml{{[/\\]}}out/file_03.cpp:5 |
| 76 |
|
| 77 |
# CHECK-NORMAL-LOOKUP: 0x0000000000000248: my_func_01 @ /tmp/test_gsym_yaml{{[/\\]}}out/file_01.cpp:5 |
| 78 |
|
| 79 |
|
| 80 |
--- !mach-o |
| 81 |
FileHeader: |
| 82 |
magic: 0xFEEDFACF |
| 83 |
cputype: 0x100000C |
| 84 |
cpusubtype: 0x0 |
| 85 |
filetype: 0xA |
| 86 |
ncmds: 6 |
| 87 |
sizeofcmds: 1168 |
| 88 |
flags: 0x0 |
| 89 |
reserved: 0x0 |
| 90 |
LoadCommands: |
| 91 |
- cmd: LC_UUID |
| 92 |
cmdsize: 24 |
| 93 |
uuid: 4C4C44EA-5555-3144-A15B-1DD428F7F3A2 |
| 94 |
- cmd: LC_BUILD_VERSION |
| 95 |
cmdsize: 24 |
| 96 |
platform: 1 |
| 97 |
minos: 720896 |
| 98 |
sdk: 720896 |
| 99 |
ntools: 0 |
| 100 |
- cmd: LC_SYMTAB |
| 101 |
cmdsize: 24 |
| 102 |
symoff: 4096 |
| 103 |
nsyms: 3 |
| 104 |
stroff: 4144 |
| 105 |
strsize: 38 |
| 106 |
- cmd: LC_SEGMENT_64 |
| 107 |
cmdsize: 152 |
| 108 |
segname: __TEXT |
| 109 |
vmaddr: 0 |
| 110 |
vmsize: 16384 |
| 111 |
fileoff: 0 |
| 112 |
filesize: 0 |
| 113 |
maxprot: 5 |
| 114 |
initprot: 5 |
| 115 |
nsects: 1 |
| 116 |
flags: 0 |
| 117 |
Sections: |
| 118 |
- sectname: __text |
| 119 |
segname: __TEXT |
| 120 |
addr: 0x248 |
| 121 |
size: 40 |
| 122 |
offset: 0x0 |
| 123 |
align: 2 |
| 124 |
reloff: 0x0 |
| 125 |
nreloc: 0 |
| 126 |
flags: 0x80000400 |
| 127 |
reserved1: 0x0 |
| 128 |
reserved2: 0x0 |
| 129 |
reserved3: 0x0 |
| 130 |
content: CFFAEDFE0C000001000000000A000000060000009004000000000000000000001B00000018000000 |
| 131 |
- cmd: LC_SEGMENT_64 |
| 132 |
cmdsize: 72 |
| 133 |
segname: __LINKEDIT |
| 134 |
vmaddr: 16384 |
| 135 |
vmsize: 4096 |
| 136 |
fileoff: 4096 |
| 137 |
filesize: 86 |
| 138 |
maxprot: 1 |
| 139 |
initprot: 1 |
| 140 |
nsects: 0 |
| 141 |
flags: 0 |
| 142 |
- cmd: LC_SEGMENT_64 |
| 143 |
cmdsize: 872 |
| 144 |
segname: __DWARF |
| 145 |
vmaddr: 20480 |
| 146 |
vmsize: 4096 |
| 147 |
fileoff: 8192 |
| 148 |
filesize: 1405 |
| 149 |
maxprot: 7 |
| 150 |
initprot: 3 |
| 151 |
nsects: 10 |
| 152 |
flags: 0 |
| 153 |
Sections: |
| 154 |
- sectname: __debug_line |
| 155 |
segname: __DWARF |
| 156 |
addr: 0x5000 |
| 157 |
size: 234 |
| 158 |
offset: 0x2000 |
| 159 |
align: 0 |
| 160 |
reloff: 0x0 |
| 161 |
nreloc: 0 |
| 162 |
flags: 0x0 |
| 163 |
reserved1: 0x0 |
| 164 |
reserved2: 0x0 |
| 165 |
reserved3: 0x0 |
| 166 |
- sectname: __debug_aranges |
| 167 |
segname: __DWARF |
| 168 |
addr: 0x50EA |
| 169 |
size: 144 |
| 170 |
offset: 0x20EA |
| 171 |
align: 0 |
| 172 |
reloff: 0x0 |
| 173 |
nreloc: 0 |
| 174 |
flags: 0x0 |
| 175 |
reserved1: 0x0 |
| 176 |
reserved2: 0x0 |
| 177 |
reserved3: 0x0 |
| 178 |
- sectname: __debug_info |
| 179 |
segname: __DWARF |
| 180 |
addr: 0x517A |
| 181 |
size: 324 |
| 182 |
offset: 0x217A |
| 183 |
align: 0 |
| 184 |
reloff: 0x0 |
| 185 |
nreloc: 0 |
| 186 |
flags: 0x0 |
| 187 |
reserved1: 0x0 |
| 188 |
reserved2: 0x0 |
| 189 |
reserved3: 0x0 |
| 190 |
- sectname: __debug_frame |
| 191 |
segname: __DWARF |
| 192 |
addr: 0x52BE |
| 193 |
size: 120 |
| 194 |
offset: 0x22BE |
| 195 |
align: 0 |
| 196 |
reloff: 0x0 |
| 197 |
nreloc: 0 |
| 198 |
flags: 0x0 |
| 199 |
reserved1: 0x0 |
| 200 |
reserved2: 0x0 |
| 201 |
reserved3: 0x0 |
| 202 |
content: 14000000FFFFFFFF0400080001781E0C1F000000000000001C0000000000000048020000000000002800000000000000440E1000000000001C0000000000000048020000000000002800000000000000440E1000000000001C0000000000000048020000000000002800000000000000440E100000000000 |
| 203 |
- sectname: __debug_abbrev |
| 204 |
segname: __DWARF |
| 205 |
addr: 0x5336 |
| 206 |
size: 73 |
| 207 |
offset: 0x2336 |
| 208 |
align: 0 |
| 209 |
reloff: 0x0 |
| 210 |
nreloc: 0 |
| 211 |
flags: 0x0 |
| 212 |
reserved1: 0x0 |
| 213 |
reserved2: 0x0 |
| 214 |
reserved3: 0x0 |
| 215 |
- sectname: __debug_str |
| 216 |
segname: __DWARF |
| 217 |
addr: 0x537F |
| 218 |
size: 221 |
| 219 |
offset: 0x237F |
| 220 |
align: 0 |
| 221 |
reloff: 0x0 |
| 222 |
nreloc: 0 |
| 223 |
flags: 0x0 |
| 224 |
reserved1: 0x0 |
| 225 |
reserved2: 0x0 |
| 226 |
reserved3: 0x0 |
| 227 |
- sectname: __apple_namespac |
| 228 |
segname: __DWARF |
| 229 |
addr: 0x545C |
| 230 |
size: 36 |
| 231 |
offset: 0x245C |
| 232 |
align: 0 |
| 233 |
reloff: 0x0 |
| 234 |
nreloc: 0 |
| 235 |
flags: 0x0 |
| 236 |
reserved1: 0x0 |
| 237 |
reserved2: 0x0 |
| 238 |
reserved3: 0x0 |
| 239 |
content: 485341480100000001000000000000000C000000000000000100000001000600FFFFFFFF |
| 240 |
- sectname: __apple_names |
| 241 |
segname: __DWARF |
| 242 |
addr: 0x5480 |
| 243 |
size: 116 |
| 244 |
offset: 0x2480 |
| 245 |
align: 0 |
| 246 |
reloff: 0x0 |
| 247 |
nreloc: 0 |
| 248 |
flags: 0x0 |
| 249 |
reserved1: 0x0 |
| 250 |
reserved2: 0x0 |
| 251 |
reserved3: 0x0 |
| 252 |
content: 485341480100000003000000030000000C00000000000000010000000100060000000000010000000200000038450B6E36450B6E37450B6E440000005400000064000000D200000001000000060100000000000094000000010000002E00000000000000B7000000010000009A00000000000000 |
| 253 |
- sectname: __apple_types |
| 254 |
segname: __DWARF |
| 255 |
addr: 0x54F4 |
| 256 |
size: 101 |
| 257 |
offset: 0x24F4 |
| 258 |
align: 0 |
| 259 |
reloff: 0x0 |
| 260 |
nreloc: 0 |
| 261 |
flags: 0x0 |
| 262 |
reserved1: 0x0 |
| 263 |
reserved2: 0x0 |
| 264 |
reserved3: 0x0 |
| 265 |
content: 48534148010000000100000001000000180000000000000004000000010006000300050005000B0006000600000000003080880B38000000A30000000300000064000000240000A4283A0CD0000000240000A4283A0C3C010000240000A4283A0C00000000 |
| 266 |
- sectname: __apple_objc |
| 267 |
segname: __DWARF |
| 268 |
addr: 0x5559 |
| 269 |
size: 36 |
| 270 |
offset: 0x2559 |
| 271 |
align: 0 |
| 272 |
reloff: 0x0 |
| 273 |
nreloc: 0 |
| 274 |
flags: 0x0 |
| 275 |
reserved1: 0x0 |
| 276 |
reserved2: 0x0 |
| 277 |
reserved3: 0x0 |
| 278 |
content: 485341480100000001000000000000000C000000000000000100000001000600FFFFFFFF |
| 279 |
LinkEditData: |
| 280 |
NameList: |
| 281 |
- n_strx: 2 |
| 282 |
n_type: 0xF |
| 283 |
n_sect: 1 |
| 284 |
n_desc: 0 |
| 285 |
n_value: 584 |
| 286 |
- n_strx: 14 |
| 287 |
n_type: 0xF |
| 288 |
n_sect: 1 |
| 289 |
n_desc: 0 |
| 290 |
n_value: 584 |
| 291 |
- n_strx: 26 |
| 292 |
n_type: 0xF |
| 293 |
n_sect: 1 |
| 294 |
n_desc: 0 |
| 295 |
n_value: 584 |
| 296 |
StringTable: |
| 297 |
- '' |
| 298 |
- '' |
| 299 |
- _my_func_01 |
| 300 |
- _my_func_02 |
| 301 |
- _my_func_03 |
| 302 |
DWARF: |
| 303 |
debug_str: |
| 304 |
- '' |
| 305 |
- 'clang version 20.0.0git (https://github.com/alx32/llvm-project.git cfb92be0a9cdd0f4595100c5add4e2795a44134e)' |
| 306 |
- 'out/file_01.cpp' |
| 307 |
- '/' |
| 308 |
- '/tmp/test_gsym_yaml' |
| 309 |
- my_func_01 |
| 310 |
- a |
| 311 |
- b |
| 312 |
- int |
| 313 |
- 'out/file_02.cpp' |
| 314 |
- my_func_02 |
| 315 |
- 'out/file_03.cpp' |
| 316 |
- my_func_03 |
| 317 |
debug_abbrev: |
| 318 |
- ID: 0 |
| 319 |
Table: |
| 320 |
- Code: 0x1 |
| 321 |
Tag: DW_TAG_compile_unit |
| 322 |
Children: DW_CHILDREN_yes |
| 323 |
Attributes: |
| 324 |
- Attribute: DW_AT_producer |
| 325 |
Form: DW_FORM_strp |
| 326 |
- Attribute: DW_AT_language |
| 327 |
Form: DW_FORM_data2 |
| 328 |
- Attribute: DW_AT_name |
| 329 |
Form: DW_FORM_strp |
| 330 |
- Attribute: DW_AT_LLVM_sysroot |
| 331 |
Form: DW_FORM_strp |
| 332 |
- Attribute: DW_AT_stmt_list |
| 333 |
Form: DW_FORM_sec_offset |
| 334 |
- Attribute: DW_AT_comp_dir |
| 335 |
Form: DW_FORM_strp |
| 336 |
- Attribute: DW_AT_low_pc |
| 337 |
Form: DW_FORM_addr |
| 338 |
- Attribute: DW_AT_high_pc |
| 339 |
Form: DW_FORM_data4 |
| 340 |
- Code: 0x2 |
| 341 |
Tag: DW_TAG_subprogram |
| 342 |
Children: DW_CHILDREN_yes |
| 343 |
Attributes: |
| 344 |
- Attribute: DW_AT_low_pc |
| 345 |
Form: DW_FORM_addr |
| 346 |
- Attribute: DW_AT_high_pc |
| 347 |
Form: DW_FORM_data4 |
| 348 |
- Attribute: DW_AT_APPLE_omit_frame_ptr |
| 349 |
Form: DW_FORM_flag_present |
| 350 |
- Attribute: DW_AT_frame_base |
| 351 |
Form: DW_FORM_exprloc |
| 352 |
- Attribute: DW_AT_name |
| 353 |
Form: DW_FORM_strp |
| 354 |
- Attribute: DW_AT_decl_file |
| 355 |
Form: DW_FORM_data1 |
| 356 |
- Attribute: DW_AT_decl_line |
| 357 |
Form: DW_FORM_data1 |
| 358 |
- Attribute: DW_AT_type |
| 359 |
Form: DW_FORM_ref_addr |
| 360 |
- Attribute: DW_AT_external |
| 361 |
Form: DW_FORM_flag_present |
| 362 |
- Code: 0x3 |
| 363 |
Tag: DW_TAG_formal_parameter |
| 364 |
Children: DW_CHILDREN_no |
| 365 |
Attributes: |
| 366 |
- Attribute: DW_AT_location |
| 367 |
Form: DW_FORM_exprloc |
| 368 |
- Attribute: DW_AT_name |
| 369 |
Form: DW_FORM_strp |
| 370 |
- Attribute: DW_AT_decl_file |
| 371 |
Form: DW_FORM_data1 |
| 372 |
- Attribute: DW_AT_decl_line |
| 373 |
Form: DW_FORM_data1 |
| 374 |
- Attribute: DW_AT_type |
| 375 |
Form: DW_FORM_ref_addr |
| 376 |
- Code: 0x4 |
| 377 |
Tag: DW_TAG_base_type |
| 378 |
Children: DW_CHILDREN_no |
| 379 |
Attributes: |
| 380 |
- Attribute: DW_AT_name |
| 381 |
Form: DW_FORM_strp |
| 382 |
- Attribute: DW_AT_encoding |
| 383 |
Form: DW_FORM_data1 |
| 384 |
- Attribute: DW_AT_byte_size |
| 385 |
Form: DW_FORM_data1 |
| 386 |
debug_aranges: |
| 387 |
- Length: 0x2C |
| 388 |
Version: 2 |
| 389 |
CuOffset: 0x0 |
| 390 |
AddressSize: 0x8 |
| 391 |
Descriptors: |
| 392 |
- Address: 0x248 |
| 393 |
Length: 0x28 |
| 394 |
- Length: 0x2C |
| 395 |
Version: 2 |
| 396 |
CuOffset: 0x6C |
| 397 |
AddressSize: 0x8 |
| 398 |
Descriptors: |
| 399 |
- Address: 0x248 |
| 400 |
Length: 0x28 |
| 401 |
- Length: 0x2C |
| 402 |
Version: 2 |
| 403 |
CuOffset: 0xD8 |
| 404 |
AddressSize: 0x8 |
| 405 |
Descriptors: |
| 406 |
- Address: 0x248 |
| 407 |
Length: 0x28 |
| 408 |
debug_info: |
| 409 |
- Length: 0x68 |
| 410 |
Version: 4 |
| 411 |
AbbrevTableID: 0 |
| 412 |
AbbrOffset: 0x0 |
| 413 |
AddrSize: 8 |
| 414 |
Entries: |
| 415 |
- AbbrCode: 0x1 |
| 416 |
Values: |
| 417 |
- Value: 0x1 |
| 418 |
- Value: 0x21 |
| 419 |
- Value: 0x6E |
| 420 |
- Value: 0x7E |
| 421 |
- Value: 0x0 |
| 422 |
- Value: 0x80 |
| 423 |
- Value: 0x248 |
| 424 |
- Value: 0x28 |
| 425 |
- AbbrCode: 0x2 |
| 426 |
Values: |
| 427 |
- Value: 0x248 |
| 428 |
- Value: 0x28 |
| 429 |
- Value: 0x1 |
| 430 |
- Value: 0x1 |
| 431 |
BlockData: [ 0x6F ] |
| 432 |
- Value: 0x94 |
| 433 |
- Value: 0x1 |
| 434 |
- Value: 0x2 |
| 435 |
- Value: 0x64 |
| 436 |
- Value: 0x1 |
| 437 |
- AbbrCode: 0x3 |
| 438 |
Values: |
| 439 |
- Value: 0x2 |
| 440 |
BlockData: [ 0x91, 0xC ] |
| 441 |
- Value: 0x9F |
| 442 |
- Value: 0x1 |
| 443 |
- Value: 0x3 |
| 444 |
- Value: 0x64 |
| 445 |
- AbbrCode: 0x3 |
| 446 |
Values: |
| 447 |
- Value: 0x2 |
| 448 |
BlockData: [ 0x91, 0x8 ] |
| 449 |
- Value: 0xA1 |
| 450 |
- Value: 0x1 |
| 451 |
- Value: 0x4 |
| 452 |
- Value: 0x64 |
| 453 |
- AbbrCode: 0x0 |
| 454 |
- AbbrCode: 0x4 |
| 455 |
Values: |
| 456 |
- Value: 0xA3 |
| 457 |
- Value: 0x5 |
| 458 |
- Value: 0x4 |
| 459 |
- AbbrCode: 0x0 |
| 460 |
- Length: 0x68 |
| 461 |
Version: 4 |
| 462 |
AbbrevTableID: 0 |
| 463 |
AbbrOffset: 0x0 |
| 464 |
AddrSize: 8 |
| 465 |
Entries: |
| 466 |
- AbbrCode: 0x1 |
| 467 |
Values: |
| 468 |
- Value: 0x1 |
| 469 |
- Value: 0x21 |
| 470 |
- Value: 0xA7 |
| 471 |
- Value: 0x7E |
| 472 |
- Value: 0x4E |
| 473 |
- Value: 0x80 |
| 474 |
- Value: 0x248 |
| 475 |
- Value: 0x28 |
| 476 |
- AbbrCode: 0x2 |
| 477 |
Values: |
| 478 |
- Value: 0x248 |
| 479 |
- Value: 0x28 |
| 480 |
- Value: 0x1 |
| 481 |
- Value: 0x1 |
| 482 |
BlockData: [ 0x6F ] |
| 483 |
- Value: 0xB7 |
| 484 |
- Value: 0x1 |
| 485 |
- Value: 0x2 |
| 486 |
- Value: 0xD0 |
| 487 |
- Value: 0x1 |
| 488 |
- AbbrCode: 0x3 |
| 489 |
Values: |
| 490 |
- Value: 0x2 |
| 491 |
BlockData: [ 0x91, 0xC ] |
| 492 |
- Value: 0x9F |
| 493 |
- Value: 0x1 |
| 494 |
- Value: 0x3 |
| 495 |
- Value: 0xD0 |
| 496 |
- AbbrCode: 0x3 |
| 497 |
Values: |
| 498 |
- Value: 0x2 |
| 499 |
BlockData: [ 0x91, 0x8 ] |
| 500 |
- Value: 0xA1 |
| 501 |
- Value: 0x1 |
| 502 |
- Value: 0x4 |
| 503 |
- Value: 0xD0 |
| 504 |
- AbbrCode: 0x0 |
| 505 |
- AbbrCode: 0x4 |
| 506 |
Values: |
| 507 |
- Value: 0xA3 |
| 508 |
- Value: 0x5 |
| 509 |
- Value: 0x4 |
| 510 |
- AbbrCode: 0x0 |
| 511 |
- Length: 0x68 |
| 512 |
Version: 4 |
| 513 |
AbbrevTableID: 0 |
| 514 |
AbbrOffset: 0x0 |
| 515 |
AddrSize: 8 |
| 516 |
Entries: |
| 517 |
- AbbrCode: 0x1 |
| 518 |
Values: |
| 519 |
- Value: 0x1 |
| 520 |
- Value: 0x21 |
| 521 |
- Value: 0xC2 |
| 522 |
- Value: 0x7E |
| 523 |
- Value: 0x9C |
| 524 |
- Value: 0x80 |
| 525 |
- Value: 0x248 |
| 526 |
- Value: 0x28 |
| 527 |
- AbbrCode: 0x2 |
| 528 |
Values: |
| 529 |
- Value: 0x248 |
| 530 |
- Value: 0x28 |
| 531 |
- Value: 0x1 |
| 532 |
- Value: 0x1 |
| 533 |
BlockData: [ 0x6F ] |
| 534 |
- Value: 0xD2 |
| 535 |
- Value: 0x1 |
| 536 |
- Value: 0x2 |
| 537 |
- Value: 0x13C |
| 538 |
- Value: 0x1 |
| 539 |
- AbbrCode: 0x3 |
| 540 |
Values: |
| 541 |
- Value: 0x2 |
| 542 |
BlockData: [ 0x91, 0xC ] |
| 543 |
- Value: 0x9F |
| 544 |
- Value: 0x1 |
| 545 |
- Value: 0x3 |
| 546 |
- Value: 0x13C |
| 547 |
- AbbrCode: 0x3 |
| 548 |
Values: |
| 549 |
- Value: 0x2 |
| 550 |
BlockData: [ 0x91, 0x8 ] |
| 551 |
- Value: 0xA1 |
| 552 |
- Value: 0x1 |
| 553 |
- Value: 0x4 |
| 554 |
- Value: 0x13C |
| 555 |
- AbbrCode: 0x0 |
| 556 |
- AbbrCode: 0x4 |
| 557 |
Values: |
| 558 |
- Value: 0xA3 |
| 559 |
- Value: 0x5 |
| 560 |
- Value: 0x4 |
| 561 |
- AbbrCode: 0x0 |
| 562 |
debug_line: |
| 563 |
- Length: 74 |
| 564 |
Version: 4 |
| 565 |
PrologueLength: 39 |
| 566 |
MinInstLength: 1 |
| 567 |
MaxOpsPerInst: 1 |
| 568 |
DefaultIsStmt: 1 |
| 569 |
LineBase: 251 |
| 570 |
LineRange: 14 |
| 571 |
OpcodeBase: 13 |
| 572 |
StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ] |
| 573 |
IncludeDirs: |
| 574 |
- out |
| 575 |
Files: |
| 576 |
- Name: file_01.cpp |
| 577 |
DirIdx: 1 |
| 578 |
ModTime: 0 |
| 579 |
Length: 0 |
| 580 |
Opcodes: |
| 581 |
- Opcode: DW_LNS_extended_op |
| 582 |
ExtLen: 9 |
| 583 |
SubOpcode: DW_LNE_set_address |
| 584 |
Data: 584 |
| 585 |
- Opcode: 0x16 |
| 586 |
Data: 0 |
| 587 |
- Opcode: DW_LNS_set_column |
| 588 |
Data: 7 |
| 589 |
- Opcode: DW_LNS_set_prologue_end |
| 590 |
Data: 0 |
| 591 |
- Opcode: 0xBC |
| 592 |
Data: 0 |
| 593 |
- Opcode: 0x4C |
| 594 |
Data: 0 |
| 595 |
- Opcode: 0x49 |
| 596 |
Data: 0 |
| 597 |
- Opcode: 0x4D |
| 598 |
Data: 0 |
| 599 |
- Opcode: 0x49 |
| 600 |
Data: 0 |
| 601 |
- Opcode: DW_LNS_set_column |
| 602 |
Data: 5 |
| 603 |
- Opcode: DW_LNS_set_epilogue_begin |
| 604 |
Data: 0 |
| 605 |
- Opcode: 0x46 |
| 606 |
Data: 0 |
| 607 |
- Opcode: DW_LNS_advance_pc |
| 608 |
Data: 8 |
| 609 |
- Opcode: DW_LNS_extended_op |
| 610 |
ExtLen: 1 |
| 611 |
SubOpcode: DW_LNE_end_sequence |
| 612 |
Data: 0 |
| 613 |
- Length: 74 |
| 614 |
Version: 4 |
| 615 |
PrologueLength: 39 |
| 616 |
MinInstLength: 1 |
| 617 |
MaxOpsPerInst: 1 |
| 618 |
DefaultIsStmt: 1 |
| 619 |
LineBase: 251 |
| 620 |
LineRange: 14 |
| 621 |
OpcodeBase: 13 |
| 622 |
StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ] |
| 623 |
IncludeDirs: |
| 624 |
- out |
| 625 |
Files: |
| 626 |
- Name: file_02.cpp |
| 627 |
DirIdx: 1 |
| 628 |
ModTime: 0 |
| 629 |
Length: 0 |
| 630 |
Opcodes: |
| 631 |
- Opcode: DW_LNS_extended_op |
| 632 |
ExtLen: 9 |
| 633 |
SubOpcode: DW_LNE_set_address |
| 634 |
Data: 584 |
| 635 |
- Opcode: 0x16 |
| 636 |
Data: 0 |
| 637 |
- Opcode: DW_LNS_set_column |
| 638 |
Data: 7 |
| 639 |
- Opcode: DW_LNS_set_prologue_end |
| 640 |
Data: 0 |
| 641 |
- Opcode: 0xBC |
| 642 |
Data: 0 |
| 643 |
- Opcode: 0x4C |
| 644 |
Data: 0 |
| 645 |
- Opcode: 0x49 |
| 646 |
Data: 0 |
| 647 |
- Opcode: 0x4D |
| 648 |
Data: 0 |
| 649 |
- Opcode: 0x49 |
| 650 |
Data: 0 |
| 651 |
- Opcode: DW_LNS_set_column |
| 652 |
Data: 5 |
| 653 |
- Opcode: DW_LNS_set_epilogue_begin |
| 654 |
Data: 0 |
| 655 |
- Opcode: 0x46 |
| 656 |
Data: 0 |
| 657 |
- Opcode: DW_LNS_advance_pc |
| 658 |
Data: 8 |
| 659 |
- Opcode: DW_LNS_extended_op |
| 660 |
ExtLen: 1 |
| 661 |
SubOpcode: DW_LNE_end_sequence |
| 662 |
Data: 0 |
| 663 |
- Length: 74 |
| 664 |
Version: 4 |
| 665 |
PrologueLength: 39 |
| 666 |
MinInstLength: 1 |
| 667 |
MaxOpsPerInst: 1 |
| 668 |
DefaultIsStmt: 1 |
| 669 |
LineBase: 251 |
| 670 |
LineRange: 14 |
| 671 |
OpcodeBase: 13 |
| 672 |
StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ] |
| 673 |
IncludeDirs: |
| 674 |
- out |
| 675 |
Files: |
| 676 |
- Name: file_03.cpp |
| 677 |
DirIdx: 1 |
| 678 |
ModTime: 0 |
| 679 |
Length: 0 |
| 680 |
Opcodes: |
| 681 |
- Opcode: DW_LNS_extended_op |
| 682 |
ExtLen: 9 |
| 683 |
SubOpcode: DW_LNE_set_address |
| 684 |
Data: 584 |
| 685 |
- Opcode: 0x16 |
| 686 |
Data: 0 |
| 687 |
- Opcode: DW_LNS_set_column |
| 688 |
Data: 7 |
| 689 |
- Opcode: DW_LNS_set_prologue_end |
| 690 |
Data: 0 |
| 691 |
- Opcode: 0xBC |
| 692 |
Data: 0 |
| 693 |
- Opcode: 0x4C |
| 694 |
Data: 0 |
| 695 |
- Opcode: 0x49 |
| 696 |
Data: 0 |
| 697 |
- Opcode: 0x4D |
| 698 |
Data: 0 |
| 699 |
- Opcode: 0x49 |
| 700 |
Data: 0 |
| 701 |
- Opcode: DW_LNS_set_column |
| 702 |
Data: 5 |
| 703 |
- Opcode: DW_LNS_set_epilogue_begin |
| 704 |
Data: 0 |
| 705 |
- Opcode: 0x46 |
| 706 |
Data: 0 |
| 707 |
- Opcode: DW_LNS_advance_pc |
| 708 |
Data: 8 |
| 709 |
- Opcode: DW_LNS_extended_op |
| 710 |
ExtLen: 1 |
| 711 |
SubOpcode: DW_LNE_end_sequence |
| 712 |
Data: 0 |
| 713 |
... |
| 714 |
|
| 715 |
|
| 716 |
################################################################################### |
| 717 |
############################# yaml generation script ############################## |
| 718 |
# #!/bin/bash |
| 719 |
# set -ex |
| 720 |
# # Global variable for LLVM toolchain path |
| 721 |
# TOOLCHAIN_PATH=[...] |
| 722 |
# # Switch to the script directory |
| 723 |
# cd "$(dirname "$0")" |
| 724 |
# # Create and clean 'out' directory |
| 725 |
# mkdir -p out |
| 726 |
# rm -rf out/* |
| 727 |
# # Generate C++ files |
| 728 |
# for i in {1..3}; do |
| 729 |
# cat << EOF > out/file_0${i}.cpp |
| 730 |
# extern "C" int my_func_0${i}( |
| 731 |
# int a, |
| 732 |
# int b) |
| 733 |
# { |
| 734 |
# return |
| 735 |
# a |
| 736 |
# * |
| 737 |
# a |
| 738 |
# + |
| 739 |
# b; |
| 740 |
# } |
| 741 |
# EOF |
| 742 |
# done |
| 743 |
# # Compile to object files with debug info |
| 744 |
# for i in {1..3}; do |
| 745 |
# ${TOOLCHAIN_PATH}/bin/clang++ \ |
| 746 |
# -fno-unwind-tables -fno-asynchronous-unwind-tables \ |
| 747 |
# -target arm64-apple-macos -c -g out/file_0${i}.cpp -o out/file_0${i}.o |
| 748 |
# done |
| 749 |
# # Link object files to dylib using lld directly |
| 750 |
# ${TOOLCHAIN_PATH}/bin/ld64.lld \ |
| 751 |
# -dylib \ |
| 752 |
# -arch arm64 \ |
| 753 |
# -platform_version macos 11.0 11.0 \ |
| 754 |
# -o out/libmyfuncs.dylib \ |
| 755 |
# --icf=all --keep-icf-stabs \ |
| 756 |
# -o out/mydylib out/file_01.o out/file_02.o out/file_03.o |
| 757 |
# # Create dsym with --flat option |
| 758 |
# "$TOOLCHAIN_PATH/bin/dsymutil" --flat out/mydylib -o out/mydylib.dSYM |
| 759 |
# # Convert dsym to yaml |
| 760 |
# "$TOOLCHAIN_PATH/bin/obj2yaml" out/mydylib.dSYM > out/mydylib.yaml |
| 761 |
################################################################################### |