• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Tests that the symbol table properly merges the two entries for
2# global_constant, even when the debug symbol comes last.
3# RUN: mkdir -p %t
4# RUN: yaml2obj %s -o %t/a.out
5# RUN: %lldb %t/a.out -o "target modules dump symtab a.out" | FileCheck %s
6# CHECK: global_constant
7# CHECK-NOT: global_constant
8--- !mach-o
9FileHeader:
10  magic:           0xFEEDFACF
11  cputype:         0x01000007
12  cpusubtype:      0x80000003
13  filetype:        0x00000002
14  ncmds:           20
15  sizeofcmds:      1992
16  flags:           0x00200085
17  reserved:        0x00000000
18LoadCommands:
19  - cmd:             LC_SEGMENT_64
20    cmdsize:         72
21    segname:         __PAGEZERO
22    vmaddr:          0
23    vmsize:          4294967296
24    fileoff:         0
25    filesize:        0
26    maxprot:         0
27    initprot:        0
28    nsects:          0
29    flags:           0
30  - cmd:             LC_SEGMENT_64
31    cmdsize:         552
32    segname:         __TEXT
33    vmaddr:          4294967296
34    vmsize:          4096
35    fileoff:         0
36    filesize:        4096
37    maxprot:         5
38    initprot:        5
39    nsects:          6
40    flags:           0
41    Sections:
42      - sectname:        __text
43        segname:         __TEXT
44        addr:            0x0000000100000DE0
45        size:            383
46        offset:          0x00000DE0
47        align:           4
48        reloff:          0x00000000
49        nreloc:          0
50        flags:           0x80000400
51        reserved1:       0x00000000
52        reserved2:       0x00000000
53        reserved3:       0x00000000
54      - sectname:        __stubs
55        segname:         __TEXT
56        addr:            0x0000000100000F60
57        size:            18
58        offset:          0x00000F60
59        align:           1
60        reloff:          0x00000000
61        nreloc:          0
62        flags:           0x80000408
63        reserved1:       0x00000000
64        reserved2:       0x00000006
65        reserved3:       0x00000000
66      - sectname:        __stub_helper
67        segname:         __TEXT
68        addr:            0x0000000100000F74
69        size:            46
70        offset:          0x00000F74
71        align:           2
72        reloff:          0x00000000
73        nreloc:          0
74        flags:           0x80000400
75        reserved1:       0x00000000
76        reserved2:       0x00000000
77        reserved3:       0x00000000
78      - sectname:        __swift5_typeref
79        segname:         __TEXT
80        addr:            0x0000000100000FA2
81        size:            7
82        offset:          0x00000FA2
83        align:           1
84        reloff:          0x00000000
85        nreloc:          0
86        flags:           0x00000000
87        reserved1:       0x00000000
88        reserved2:       0x00000000
89        reserved3:       0x00000000
90      - sectname:        __const
91        segname:         __TEXT
92        addr:            0x0000000100000FAA
93        size:            2
94        offset:          0x00000FAA
95        align:           1
96        reloff:          0x00000000
97        nreloc:          0
98        flags:           0x00000000
99        reserved1:       0x00000000
100        reserved2:       0x00000000
101        reserved3:       0x00000000
102      - sectname:        __unwind_info
103        segname:         __TEXT
104        addr:            0x0000000100000FAC
105        size:            80
106        offset:          0x00000FAC
107        align:           2
108        reloff:          0x00000000
109        nreloc:          0
110        flags:           0x00000000
111        reserved1:       0x00000000
112        reserved2:       0x00000000
113        reserved3:       0x00000000
114  - cmd:             LC_SEGMENT_64
115    cmdsize:         232
116    segname:         __DATA_CONST
117    vmaddr:          4294971392
118    vmsize:          4096
119    fileoff:         4096
120    filesize:        4096
121    maxprot:         3
122    initprot:        3
123    nsects:          2
124    flags:           16
125    Sections:
126      - sectname:        __got
127        segname:         __DATA_CONST
128        addr:            0x0000000100001000
129        size:            8
130        offset:          0x00001000
131        align:           3
132        reloff:          0x00000000
133        nreloc:          0
134        flags:           0x00000006
135        reserved1:       0x00000003
136        reserved2:       0x00000000
137        reserved3:       0x00000000
138      - sectname:        __objc_imageinfo
139        segname:         __DATA_CONST
140        addr:            0x0000000100001008
141        size:            8
142        offset:          0x00001008
143        align:           2
144        reloff:          0x00000000
145        nreloc:          0
146        flags:           0x00000000
147        reserved1:       0x00000000
148        reserved2:       0x00000000
149        reserved3:       0x00000000
150  - cmd:             LC_SEGMENT_64
151    cmdsize:         312
152    segname:         __DATA
153    vmaddr:          4294975488
154    vmsize:          4096
155    fileoff:         8192
156    filesize:        4096
157    maxprot:         3
158    initprot:        3
159    nsects:          3
160    flags:           0
161    Sections:
162      - sectname:        __la_symbol_ptr
163        segname:         __DATA
164        addr:            0x0000000100002000
165        size:            24
166        offset:          0x00002000
167        align:           3
168        reloff:          0x00000000
169        nreloc:          0
170        flags:           0x00000007
171        reserved1:       0x00000004
172        reserved2:       0x00000000
173        reserved3:       0x00000000
174      - sectname:        __data
175        segname:         __DATA
176        addr:            0x0000000100002018
177        size:            16
178        offset:          0x00002018
179        align:           3
180        reloff:          0x00000000
181        nreloc:          0
182        flags:           0x00000000
183        reserved1:       0x00000000
184        reserved2:       0x00000000
185        reserved3:       0x00000000
186      - sectname:        __common
187        segname:         __DATA
188        addr:            0x0000000100002028
189        size:            16
190        offset:          0x00000000
191        align:           3
192        reloff:          0x00000000
193        nreloc:          0
194        flags:           0x00000001
195        reserved1:       0x00000000
196        reserved2:       0x00000000
197        reserved3:       0x00000000
198  - cmd:             LC_SEGMENT_64
199    cmdsize:         72
200    segname:         __LINKEDIT
201    vmaddr:          4294979584
202    vmsize:          4096
203    fileoff:         12288
204    filesize:        1924
205    maxprot:         1
206    initprot:        1
207    nsects:          0
208    flags:           0
209  - cmd:             LC_DYLD_INFO_ONLY
210    cmdsize:         48
211    rebase_off:      12288
212    rebase_size:     8
213    bind_off:        12296
214    bind_size:       24
215    weak_bind_off:   0
216    weak_bind_size:  0
217    lazy_bind_off:   12320
218    lazy_bind_size:  96
219    export_off:      12416
220    export_size:     48
221  - cmd:             LC_SYMTAB
222    cmdsize:         24
223    symoff:          12472
224    nsyms:           41
225    stroff:          13156
226    strsize:         1056
227  - cmd:             LC_DYSYMTAB
228    cmdsize:         80
229    ilocalsym:       0
230    nlocalsym:       35
231    iextdefsym:      35
232    nextdefsym:      2
233    iundefsym:       37
234    nundefsym:       4
235    tocoff:          0
236    ntoc:            0
237    modtaboff:       0
238    nmodtab:         0
239    extrefsymoff:    0
240    nextrefsyms:     0
241    indirectsymoff:  13128
242    nindirectsyms:   7
243    extreloff:       0
244    nextrel:         0
245    locreloff:       0
246    nlocrel:         0
247  - cmd:             LC_LOAD_DYLINKER
248    cmdsize:         32
249    name:            12
250    PayloadString:   '/usr/lib/dyld'
251    ZeroPadBytes:    7
252  - cmd:             LC_UUID
253    cmdsize:         24
254    uuid:            A89F9D23-8190-3946-A70B-B8E833E68640
255  - cmd:             LC_BUILD_VERSION
256    cmdsize:         32
257    platform:        1
258    minos:           659200
259    sdk:             659200
260    ntools:          1
261    Tools:
262      - tool:            3
263        version:         36176384
264  - cmd:             LC_SOURCE_VERSION
265    cmdsize:         16
266    version:         0
267  - cmd:             LC_MAIN
268    cmdsize:         24
269    entryoff:        3552
270    stacksize:       0
271  - cmd:             LC_LOAD_DYLIB
272    cmdsize:         56
273    dylib:
274      name:            24
275      timestamp:       2
276      current_version: 14942208
277      compatibility_version: 65536
278    PayloadString:   '/usr/lib/libobjc.A.dylib'
279    ZeroPadBytes:    8
280  - cmd:             LC_LOAD_DYLIB
281    cmdsize:         56
282    dylib:
283      name:            24
284      timestamp:       2
285      current_version: 83951616
286      compatibility_version: 65536
287    PayloadString:   '/usr/lib/libSystem.B.dylib'
288    ZeroPadBytes:    6
289  - cmd:             LC_LOAD_DYLIB
290    cmdsize:         64
291    dylib:
292      name:            24
293      timestamp:       2
294      current_version: 0
295      compatibility_version: 65536
296    PayloadString:   '/usr/lib/swift/libswiftCore.dylib'
297    ZeroPadBytes:    7
298  - cmd:             LC_RPATH
299    cmdsize:         136
300    path:            12
301    PayloadString:   '/Volumes/Jonas/internal-stable/build/Ninja-RelWithDebInfoAssert+stdlib-RelWithDebInfo/swift-macosx-x86_64/lib/swift/macosx'
302    ZeroPadBytes:    2
303  - cmd:             LC_RPATH
304    cmdsize:         128
305    path:            12
306    PayloadString:   '/Applications/XcodeY.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift'
307    ZeroPadBytes:    2
308  - cmd:             LC_FUNCTION_STARTS
309    cmdsize:         16
310    dataoff:         12464
311    datasize:        8
312  - cmd:             LC_DATA_IN_CODE
313    cmdsize:         16
314    dataoff:         12472
315    datasize:        0
316LinkEditData:
317  RebaseOpcodes:
318    - Opcode:          REBASE_OPCODE_SET_TYPE_IMM
319      Imm:             1
320    - Opcode:          REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
321      Imm:             3
322      ExtraData:
323        - 0x0000000000000000
324    - Opcode:          REBASE_OPCODE_DO_REBASE_IMM_TIMES
325      Imm:             3
326    - Opcode:          REBASE_OPCODE_DONE
327      Imm:             0
328  BindOpcodes:
329    - Opcode:          BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
330      Imm:             2
331      Symbol:          ''
332    - Opcode:          BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
333      Imm:             0
334      Symbol:          dyld_stub_binder
335    - Opcode:          BIND_OPCODE_SET_TYPE_IMM
336      Imm:             1
337      Symbol:          ''
338    - Opcode:          BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
339      Imm:             2
340      ULEBExtraData:
341        - 0x0000000000000000
342      Symbol:          ''
343    - Opcode:          BIND_OPCODE_DO_BIND
344      Imm:             0
345      Symbol:          ''
346    - Opcode:          BIND_OPCODE_DONE
347      Imm:             0
348      Symbol:          ''
349  LazyBindOpcodes:
350    - Opcode:          BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
351      Imm:             3
352      ULEBExtraData:
353        - 0x0000000000000000
354      Symbol:          ''
355    - Opcode:          BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
356      Imm:             3
357      Symbol:          ''
358    - Opcode:          BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
359      Imm:             0
360      Symbol:          _swift_beginAccess
361    - Opcode:          BIND_OPCODE_DO_BIND
362      Imm:             0
363      Symbol:          ''
364    - Opcode:          BIND_OPCODE_DONE
365      Imm:             0
366      Symbol:          ''
367    - Opcode:          BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
368      Imm:             3
369      ULEBExtraData:
370        - 0x0000000000000008
371      Symbol:          ''
372    - Opcode:          BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
373      Imm:             3
374      Symbol:          ''
375    - Opcode:          BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
376      Imm:             0
377      Symbol:          _swift_endAccess
378    - Opcode:          BIND_OPCODE_DO_BIND
379      Imm:             0
380      Symbol:          ''
381    - Opcode:          BIND_OPCODE_DONE
382      Imm:             0
383      Symbol:          ''
384    - Opcode:          BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
385      Imm:             3
386      ULEBExtraData:
387        - 0x0000000000000010
388      Symbol:          ''
389    - Opcode:          BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
390      Imm:             3
391      Symbol:          ''
392    - Opcode:          BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
393      Imm:             0
394      Symbol:          _swift_getTypeByMangledNameInContext
395    - Opcode:          BIND_OPCODE_DO_BIND
396      Imm:             0
397      Symbol:          ''
398    - Opcode:          BIND_OPCODE_DONE
399      Imm:             0
400      Symbol:          ''
401    - Opcode:          BIND_OPCODE_DONE
402      Imm:             0
403      Symbol:          ''
404    - Opcode:          BIND_OPCODE_DONE
405      Imm:             0
406      Symbol:          ''
407    - Opcode:          BIND_OPCODE_DONE
408      Imm:             0
409      Symbol:          ''
410    - Opcode:          BIND_OPCODE_DONE
411      Imm:             0
412      Symbol:          ''
413    - Opcode:          BIND_OPCODE_DONE
414      Imm:             0
415      Symbol:          ''
416  ExportTrie:
417    TerminalSize:    0
418    NodeOffset:      0
419    Name:            ''
420    Flags:           0x0000000000000000
421    Address:         0x0000000000000000
422    Other:           0x0000000000000000
423    ImportName:      ''
424    Children:
425      - TerminalSize:    0
426        NodeOffset:      5
427        Name:            _
428        Flags:           0x0000000000000000
429        Address:         0x0000000000000000
430        Other:           0x0000000000000000
431        ImportName:      ''
432        Children:
433          - TerminalSize:    2
434            NodeOffset:      33
435            Name:            _mh_execute_header
436            Flags:           0x0000000000000000
437            Address:         0x0000000000000000
438            Other:           0x0000000000000000
439            ImportName:      ''
440          - TerminalSize:    3
441            NodeOffset:      37
442            Name:            main
443            Flags:           0x0000000000000000
444            Address:         0x0000000000000DE0
445            Other:           0x0000000000000000
446            ImportName:      ''
447  NameList:
448    - n_strx:          118
449      n_type:          0x1E
450      n_sect:          1
451      n_desc:          0
452      n_value:         4294970976
453    - n_strx:          133
454      n_type:          0x1E
455      n_sect:          1
456      n_desc:          0
457      n_value:         4294971008
458    - n_strx:          151
459      n_type:          0x1E
460      n_sect:          1
461      n_desc:          128
462      n_value:         4294971104
463    - n_strx:          199
464      n_type:          0x1E
465      n_sect:          4
466      n_desc:          128
467      n_value:         4294971298
468    - n_strx:          216
469      n_type:          0x1E
470      n_sect:          5
471      n_desc:          128
472      n_value:         4294971306
473    - n_strx:          244
474      n_type:          0x0E
475      n_sect:          10
476      n_desc:          0
477      n_value:         4294975512
478    - n_strx:          259
479      n_type:          0x1E
480      n_sect:          10
481      n_desc:          128
482      n_value:         4294975520
483    - n_strx:          271
484      n_type:          0x1E
485      n_sect:          11
486      n_desc:          0
487      n_value:         4294975528
488    - n_strx:          298
489      n_type:          0x1E
490      n_sect:          11
491      n_desc:          0
492      n_value:         4294975536
493    - n_strx:          325
494      n_type:          0x32
495      n_sect:          0
496      n_desc:          0
497      n_value:         1570141141
498    - n_strx:          540
499      n_type:          0x64
500      n_sect:          0
501      n_desc:          0
502      n_value:         0
503    - n_strx:          633
504      n_type:          0x64
505      n_sect:          0
506      n_desc:          0
507      n_value:         0
508    - n_strx:          644
509      n_type:          0x66
510      n_sect:          3
511      n_desc:          1
512      n_value:         1570141203
513    - n_strx:          1
514      n_type:          0x2E
515      n_sect:          1
516      n_desc:          0
517      n_value:         4294970848
518    - n_strx:          852
519      n_type:          0x24
520      n_sect:          1
521      n_desc:          0
522      n_value:         4294970848
523    - n_strx:          1
524      n_type:          0x24
525      n_sect:          0
526      n_desc:          0
527      n_value:         128
528    - n_strx:          1
529      n_type:          0x4E
530      n_sect:          1
531      n_desc:          0
532      n_value:         128
533    - n_strx:          1
534      n_type:          0x2E
535      n_sect:          1
536      n_desc:          0
537      n_value:         4294970976
538    - n_strx:          858
539      n_type:          0x24
540      n_sect:          1
541      n_desc:          0
542      n_value:         4294970976
543    - n_strx:          1
544      n_type:          0x24
545      n_sect:          0
546      n_desc:          0
547      n_value:         32
548    - n_strx:          1
549      n_type:          0x4E
550      n_sect:          1
551      n_desc:          0
552      n_value:         32
553    - n_strx:          1
554      n_type:          0x2E
555      n_sect:          1
556      n_desc:          0
557      n_value:         4294971008
558    - n_strx:          873
559      n_type:          0x24
560      n_sect:          1
561      n_desc:          0
562      n_value:         4294971008
563    - n_strx:          1
564      n_type:          0x24
565      n_sect:          0
566      n_desc:          0
567      n_value:         96
568    - n_strx:          1
569      n_type:          0x4E
570      n_sect:          1
571      n_desc:          0
572      n_value:         96
573    - n_strx:          1
574      n_type:          0x2E
575      n_sect:          1
576      n_desc:          0
577      n_value:         4294971104
578    - n_strx:          891
579      n_type:          0x24
580      n_sect:          1
581      n_desc:          0
582      n_value:         4294971104
583    - n_strx:          1
584      n_type:          0x24
585      n_sect:          0
586      n_desc:          0
587      n_value:         127
588    - n_strx:          1
589      n_type:          0x4E
590      n_sect:          1
591      n_desc:          0
592      n_value:         127
593    - n_strx:          939
594      n_type:          0x20
595      n_sect:          0
596      n_desc:          0
597      n_value:         0
598    - n_strx:          956
599      n_type:          0x20
600      n_sect:          0
601      n_desc:          0
602      n_value:         0
603    - n_strx:          984
604      n_type:          0x20
605      n_sect:          0
606      n_desc:          0
607      n_value:         0
608    - n_strx:          996
609      n_type:          0x20
610      n_sect:          0
611      n_desc:          0
612      n_value:         0
613    - n_strx:          1023
614      n_type:          0x20
615      n_sect:          0
616      n_desc:          0
617      n_value:         0
618    - n_strx:          1
619      n_type:          0x64
620      n_sect:          1
621      n_desc:          0
622      n_value:         0
623    - n_strx:          2
624      n_type:          0x0F
625      n_sect:          1
626      n_desc:          16
627      n_value:         4294967296
628    - n_strx:          22
629      n_type:          0x0F
630      n_sect:          1
631      n_desc:          0
632      n_value:         4294970848
633    - n_strx:          28
634      n_type:          0x01
635      n_sect:          0
636      n_desc:          768
637      n_value:         0
638    - n_strx:          47
639      n_type:          0x01
640      n_sect:          0
641      n_desc:          768
642      n_value:         0
643    - n_strx:          64
644      n_type:          0x01
645      n_sect:          0
646      n_desc:          768
647      n_value:         0
648    - n_strx:          101
649      n_type:          0x01
650      n_sect:          0
651      n_desc:          512
652      n_value:         0
653  StringTable:
654    - ' '
655    - __mh_execute_header
656    - _main
657    - _swift_beginAccess
658    - _swift_endAccess
659    - _swift_getTypeByMangledNameInContext
660    - dyld_stub_binder
661    - '_$s1a3useyyxlF'
662    - '_$s1a1fyySi_SiztF'
663    - ___swift_instantiateConcreteTypeFromMangledName
664    - _symbolic Si_Sit
665    - ___swift_reflection_version
666    - __dyld_private
667    - '_$sSi_SitMD'
668    - '_$s1a15global_constantSivp'
669    - '_$s1a15global_variableSivp'
670    - '/Volumes/Jonas/internal-stable/build/Ninja-RelWithDebInfoAssert+stdlib-RelWithDebInfo/lldb-macosx-x86_64/lldb-test-build.noindex/lang/swift/variables/let/TestSwiftLetConstants.test_let_constants_dwarf/a.swiftmodule'
671    - '/Volumes/Jonas/internal-stable/lldb/packages/Python/lldbsuite/test/lang/swift/variables/let/'
672    - main.swift
673    - '/Volumes/Jonas/internal-stable/build/Ninja-RelWithDebInfoAssert+stdlib-RelWithDebInfo/lldb-macosx-x86_64/lldb-test-build.noindex/lang/swift/variables/let/TestSwiftLetConstants.test_let_constants_dwarf/main.o'
674    - _main
675    - '_$s1a3useyyxlF'
676    - '_$s1a1fyySi_SiztF'
677    - ___swift_instantiateConcreteTypeFromMangledName
678    - _symbolic Si_Sit
679    - ___swift_reflection_version
680    - '_$sSi_SitMD'
681    - '_$s1a15global_constantSivp'
682    - '_$s1a15global_variableSivp'
683    - ''
684    - ''
685    - ''
686    - ''
687    - ''
688    - ''
689...
690