diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-10-09 16:38:47 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-10-09 16:38:47 +0000 |
| commit | 22314179f0660c172514b397060fd8f34b586e82 (patch) | |
| tree | afb3f04cd285733772ffceec4ccf3d8539dca91c /lldb/test/Shell/ObjectFile/MachO | |
| parent | df14bd315db94d286c0c75b4b6ee5d760f311399 (diff) | |
| download | bcm5719-llvm-22314179f0660c172514b397060fd8f34b586e82.tar.gz bcm5719-llvm-22314179f0660c172514b397060fd8f34b586e82.zip | |
[test] Split LLDB tests into API, Shell & Unit
LLDB has three major testing strategies: unit tests, tests that exercise
the SB API though dotest.py and what we currently call lit tests. The
later is rather confusing as we're now using lit as the driver for all
three types of tests. As most of this grew organically, the directory
structure in the LLDB repository doesn't really make this clear.
The 'lit' tests are part of the root and among these tests there's a
Unit and Suite folder for the unit and dotest-tests. This layout makes
it impossible to run just the lit tests.
This patch changes the directory layout to match the 3 testing
strategies, each with their own directory and their own configuration
file. This means there are now 3 directories under lit with 3
corresponding targets:
- API (check-lldb-api): Test exercising the SB API.
- Shell (check-lldb-shell): Test exercising command line utilities.
- Unit (check-lldb-unit): Unit tests.
Finally, there's still the `check-lldb` target that runs all three test
suites.
Finally, this also renames the lit folder to `test` to match the LLVM
repository layout.
Differential revision: https://reviews.llvm.org/D68606
llvm-svn: 374184
Diffstat (limited to 'lldb/test/Shell/ObjectFile/MachO')
| -rw-r--r-- | lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml | 219 | ||||
| -rw-r--r-- | lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml | 206 | ||||
| -rw-r--r-- | lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml | 205 | ||||
| -rw-r--r-- | lldb/test/Shell/ObjectFile/MachO/subsections.yaml | 126 | ||||
| -rw-r--r-- | lldb/test/Shell/ObjectFile/MachO/symtab.yaml | 699 |
5 files changed, 1455 insertions, 0 deletions
diff --git a/lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml b/lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml new file mode 100644 index 00000000000..763525c6e5b --- /dev/null +++ b/lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml @@ -0,0 +1,219 @@ +# RUN: yaml2obj %s > %t.out +# RUN: lldb-test symbols %t.out | FileCheck %s +# Test that the deployment target is parsed from the load commands. +# CHECK: x86_64-apple-macosx10.14.0 +# CHECK: x86_64-apple-ios12.0.0-macabi +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x80000003 + filetype: 0x00000002 + ncmds: 15 + sizeofcmds: 776 + flags: 0x00200085 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __PAGEZERO + vmaddr: 0 + vmsize: 4294967296 + fileoff: 0 + filesize: 0 + maxprot: 0 + initprot: 0 + nsects: 0 + flags: 0 + - cmd: LC_SEGMENT_64 + cmdsize: 232 + segname: __TEXT + vmaddr: 4294967296 + vmsize: 4096 + fileoff: 0 + filesize: 4096 + maxprot: 7 + initprot: 5 + nsects: 2 + flags: 0 + Sections: + - sectname: __text + segname: __TEXT + addr: 0x0000000100000FB0 + size: 8 + offset: 0x00000FB0 + align: 4 + reloff: 0x00000000 + nreloc: 0 + flags: 0x80000400 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - sectname: __unwind_info + segname: __TEXT + addr: 0x0000000100000FB8 + size: 72 + offset: 0x00000FB8 + align: 2 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __LINKEDIT + vmaddr: 4294971392 + vmsize: 4096 + fileoff: 4096 + filesize: 152 + maxprot: 7 + initprot: 1 + nsects: 0 + flags: 0 + - cmd: LC_DYLD_INFO_ONLY + cmdsize: 48 + rebase_off: 0 + rebase_size: 0 + bind_off: 0 + bind_size: 0 + weak_bind_off: 0 + weak_bind_size: 0 + lazy_bind_off: 0 + lazy_bind_size: 0 + export_off: 4096 + export_size: 48 + - cmd: LC_SYMTAB + cmdsize: 24 + symoff: 4152 + nsyms: 3 + stroff: 4200 + strsize: 48 + - cmd: LC_DYSYMTAB + cmdsize: 80 + ilocalsym: 0 + nlocalsym: 0 + iextdefsym: 0 + nextdefsym: 2 + iundefsym: 2 + nundefsym: 1 + tocoff: 0 + ntoc: 0 + modtaboff: 0 + nmodtab: 0 + extrefsymoff: 0 + nextrefsyms: 0 + indirectsymoff: 0 + nindirectsyms: 0 + extreloff: 0 + nextrel: 0 + locreloff: 0 + nlocrel: 0 + - cmd: LC_LOAD_DYLINKER + cmdsize: 32 + name: 12 + PayloadString: /usr/lib/dyld + ZeroPadBytes: 7 + - cmd: LC_UUID + cmdsize: 24 + uuid: 8F41E140-23B9-3720-AC28-4E7AF9D159BA + - cmd: LC_BUILD_VERSION + cmdsize: 32 + platform: 1 + minos: 658944 + sdk: 658944 + ntools: 1 + Tools: + - tool: 3 + version: 26738944 + - cmd: LC_SOURCE_VERSION + cmdsize: 16 + version: 0 + - cmd: LC_MAIN + cmdsize: 24 + entryoff: 4016 + stacksize: 0 + - cmd: LC_LOAD_DYLIB + cmdsize: 56 + dylib: + name: 24 + timestamp: 2 + current_version: 82102276 + compatibility_version: 65536 + PayloadString: /usr/lib/libSystem.B.dylib + ZeroPadBytes: 6 + - cmd: LC_FUNCTION_STARTS + cmdsize: 16 + dataoff: 4144 + datasize: 8 + - cmd: LC_DATA_IN_CODE + cmdsize: 16 + dataoff: 4152 + datasize: 0 + - cmd: LC_BUILD_VERSION + cmdsize: 32 + platform: 6 + minos: 786432 + sdk: 786432 + ntools: 1 + Tools: + - tool: 3 + version: 26738944 +LinkEditData: + ExportTrie: + TerminalSize: 0 + NodeOffset: 0 + Name: '' + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + Children: + - TerminalSize: 0 + NodeOffset: 5 + Name: _ + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + Children: + - TerminalSize: 2 + NodeOffset: 33 + Name: _mh_execute_header + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + - TerminalSize: 3 + NodeOffset: 37 + Name: main + Flags: 0x0000000000000000 + Address: 0x0000000000000FB0 + Other: 0x0000000000000000 + ImportName: '' + NameList: + - n_strx: 2 + n_type: 0x0F + n_sect: 1 + n_desc: 16 + n_value: 4294967296 + - n_strx: 22 + n_type: 0x0F + n_sect: 1 + n_desc: 0 + n_value: 4294971312 + - n_strx: 28 + n_type: 0x01 + n_sect: 0 + n_desc: 256 + n_value: 0 + StringTable: + - ' ' + - __mh_execute_header + - _main + - dyld_stub_binder + - '' + - '' + - '' +... diff --git a/lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml b/lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml new file mode 100644 index 00000000000..f84c71aff6a --- /dev/null +++ b/lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml @@ -0,0 +1,206 @@ +# RUN: yaml2obj %s > %t.out +# RUN: lldb-test symbols %t.out | FileCheck %s +# Test that the deployment target is parsed from the load commands. +# CHECK: x86_64-apple-macosx10.14.0 +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x80000003 + filetype: 0x00000002 + ncmds: 14 + sizeofcmds: 738 + flags: 0x00200085 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __PAGEZERO + vmaddr: 0 + vmsize: 4294967296 + fileoff: 0 + filesize: 0 + maxprot: 0 + initprot: 0 + nsects: 0 + flags: 0 + - cmd: LC_SEGMENT_64 + cmdsize: 232 + segname: __TEXT + vmaddr: 4294967296 + vmsize: 4096 + fileoff: 0 + filesize: 4096 + maxprot: 7 + initprot: 5 + nsects: 2 + flags: 0 + Sections: + - sectname: __text + segname: __TEXT + addr: 0x0000000100000FB0 + size: 8 + offset: 0x00000FB0 + align: 4 + reloff: 0x00000000 + nreloc: 0 + flags: 0x80000400 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - sectname: __unwind_info + segname: __TEXT + addr: 0x0000000100000FB8 + size: 72 + offset: 0x00000FB8 + align: 2 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __LINKEDIT + vmaddr: 4294971392 + vmsize: 4096 + fileoff: 4096 + filesize: 152 + maxprot: 7 + initprot: 1 + nsects: 0 + flags: 0 + - cmd: LC_DYLD_INFO_ONLY + cmdsize: 48 + rebase_off: 0 + rebase_size: 0 + bind_off: 0 + bind_size: 0 + weak_bind_off: 0 + weak_bind_size: 0 + lazy_bind_off: 0 + lazy_bind_size: 0 + export_off: 4096 + export_size: 48 + - cmd: LC_SYMTAB + cmdsize: 24 + symoff: 4152 + nsyms: 3 + stroff: 4200 + strsize: 48 + - cmd: LC_DYSYMTAB + cmdsize: 80 + ilocalsym: 0 + nlocalsym: 0 + iextdefsym: 0 + nextdefsym: 2 + iundefsym: 2 + nundefsym: 1 + tocoff: 0 + ntoc: 0 + modtaboff: 0 + nmodtab: 0 + extrefsymoff: 0 + nextrefsyms: 0 + indirectsymoff: 0 + nindirectsyms: 0 + extreloff: 0 + nextrel: 0 + locreloff: 0 + nlocrel: 0 + - cmd: LC_LOAD_DYLINKER + cmdsize: 32 + name: 12 + PayloadString: /usr/lib/dyld + ZeroPadBytes: 7 + - cmd: LC_UUID + cmdsize: 24 + uuid: 8F41E140-23B9-3720-AC28-4E7AF9D159BA + - cmd: LC_BUILD_VERSION + cmdsize: 24 + platform: 1 + minos: 658944 + sdk: 658944 + ntools: 0 + - cmd: LC_SOURCE_VERSION + cmdsize: 16 + version: 0 + - cmd: LC_MAIN + cmdsize: 24 + entryoff: 4016 + stacksize: 0 + - cmd: LC_LOAD_DYLIB + cmdsize: 56 + dylib: + name: 24 + timestamp: 2 + current_version: 82102276 + compatibility_version: 65536 + PayloadString: /usr/lib/libSystem.B.dylib + ZeroPadBytes: 6 + - cmd: LC_FUNCTION_STARTS + cmdsize: 16 + dataoff: 4144 + datasize: 8 + - cmd: LC_DATA_IN_CODE + cmdsize: 16 + dataoff: 4152 + datasize: 0 +LinkEditData: + ExportTrie: + TerminalSize: 0 + NodeOffset: 0 + Name: '' + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + Children: + - TerminalSize: 0 + NodeOffset: 5 + Name: _ + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + Children: + - TerminalSize: 2 + NodeOffset: 33 + Name: _mh_execute_header + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + - TerminalSize: 3 + NodeOffset: 37 + Name: main + Flags: 0x0000000000000000 + Address: 0x0000000000000FB0 + Other: 0x0000000000000000 + ImportName: '' + NameList: + - n_strx: 2 + n_type: 0x0F + n_sect: 1 + n_desc: 16 + n_value: 4294967296 + - n_strx: 22 + n_type: 0x0F + n_sect: 1 + n_desc: 0 + n_value: 4294971312 + - n_strx: 28 + n_type: 0x01 + n_sect: 0 + n_desc: 256 + n_value: 0 + StringTable: + - ' ' + - __mh_execute_header + - _main + - dyld_stub_binder + - '' + - '' + - '' +... diff --git a/lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml b/lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml new file mode 100644 index 00000000000..e79107069f3 --- /dev/null +++ b/lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml @@ -0,0 +1,205 @@ +# RUN: yaml2obj %s > %t.out +# RUN: lldb-test object-file %t.out | FileCheck %s + +# Test that the deployment target is parsed from the load commands. +# CHECK: Architecture: x86_64-apple-macosx10.9.0 +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x80000003 + filetype: 0x00000002 + ncmds: 14 + sizeofcmds: 728 + flags: 0x00200085 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __PAGEZERO + vmaddr: 0 + vmsize: 4294967296 + fileoff: 0 + filesize: 0 + maxprot: 0 + initprot: 0 + nsects: 0 + flags: 0 + - cmd: LC_SEGMENT_64 + cmdsize: 232 + segname: __TEXT + vmaddr: 4294967296 + vmsize: 4096 + fileoff: 0 + filesize: 4096 + maxprot: 7 + initprot: 5 + nsects: 2 + flags: 0 + Sections: + - sectname: __text + segname: __TEXT + addr: 0x0000000100000FB0 + size: 8 + offset: 0x00000FB0 + align: 0 + reloff: 0x00000000 + nreloc: 0 + flags: 0x80000400 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - sectname: __unwind_info + segname: __TEXT + addr: 0x0000000100000FB8 + size: 72 + offset: 0x00000FB8 + align: 2 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __LINKEDIT + vmaddr: 4294971392 + vmsize: 4096 + fileoff: 4096 + filesize: 152 + maxprot: 7 + initprot: 1 + nsects: 0 + flags: 0 + - cmd: LC_DYLD_INFO_ONLY + cmdsize: 48 + rebase_off: 0 + rebase_size: 0 + bind_off: 0 + bind_size: 0 + weak_bind_off: 0 + weak_bind_size: 0 + lazy_bind_off: 0 + lazy_bind_size: 0 + export_off: 4096 + export_size: 48 + - cmd: LC_SYMTAB + cmdsize: 24 + symoff: 4152 + nsyms: 3 + stroff: 4200 + strsize: 48 + - cmd: LC_DYSYMTAB + cmdsize: 80 + ilocalsym: 0 + nlocalsym: 0 + iextdefsym: 0 + nextdefsym: 2 + iundefsym: 2 + nundefsym: 1 + tocoff: 0 + ntoc: 0 + modtaboff: 0 + nmodtab: 0 + extrefsymoff: 0 + nextrefsyms: 0 + indirectsymoff: 0 + nindirectsyms: 0 + extreloff: 0 + nextrel: 0 + locreloff: 0 + nlocrel: 0 + - cmd: LC_LOAD_DYLINKER + cmdsize: 32 + name: 12 + PayloadString: /usr/lib/dyld + ZeroPadBytes: 7 + - cmd: LC_UUID + cmdsize: 24 + uuid: E75E737C-4FB3-312D-9B17-10987F48F957 + - cmd: LC_VERSION_MIN_MACOSX + cmdsize: 16 + version: 657664 + sdk: 658944 + - cmd: LC_SOURCE_VERSION + cmdsize: 16 + version: 0 + - cmd: LC_MAIN + cmdsize: 24 + entryoff: 4016 + stacksize: 0 + - cmd: LC_LOAD_DYLIB + cmdsize: 56 + dylib: + name: 24 + timestamp: 2 + current_version: 82102276 + compatibility_version: 65536 + PayloadString: /usr/lib/libSystem.B.dylib + ZeroPadBytes: 6 + - cmd: LC_FUNCTION_STARTS + cmdsize: 16 + dataoff: 4144 + datasize: 8 + - cmd: LC_DATA_IN_CODE + cmdsize: 16 + dataoff: 4152 + datasize: 0 +LinkEditData: + ExportTrie: + TerminalSize: 0 + NodeOffset: 0 + Name: '' + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + Children: + - TerminalSize: 0 + NodeOffset: 5 + Name: _ + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + Children: + - TerminalSize: 2 + NodeOffset: 33 + Name: _mh_execute_header + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + - TerminalSize: 3 + NodeOffset: 37 + Name: main + Flags: 0x0000000000000000 + Address: 0x0000000000000FB0 + Other: 0x0000000000000000 + ImportName: '' + NameList: + - n_strx: 2 + n_type: 0x0F + n_sect: 1 + n_desc: 16 + n_value: 4294967296 + - n_strx: 22 + n_type: 0x0F + n_sect: 1 + n_desc: 0 + n_value: 4294971312 + - n_strx: 28 + n_type: 0x01 + n_sect: 0 + n_desc: 256 + n_value: 0 + StringTable: + - ' ' + - __mh_execute_header + - _main + - dyld_stub_binder + - '' + - '' + - '' +... diff --git a/lldb/test/Shell/ObjectFile/MachO/subsections.yaml b/lldb/test/Shell/ObjectFile/MachO/subsections.yaml new file mode 100644 index 00000000000..a92ef41d79f --- /dev/null +++ b/lldb/test/Shell/ObjectFile/MachO/subsections.yaml @@ -0,0 +1,126 @@ +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +#CHECK: Showing 2 sections +#CHECK-NEXT: Index: 0 +#CHECK-NEXT: ID: 0x100 +#CHECK-NEXT: Name: __PAGEZERO +#CHECK-NEXT: Type: container +#CHECK-NEXT: Permissions: --- +#CHECK-NEXT: Thread specific: no +#CHECK-NEXT: VM address: 0x0 +#CHECK-NEXT: VM size: 4294967296 +#CHECK-NEXT: File size: 0 +#CHECK-NEXT: There are no subsections +#CHECK-EMPTY: +#CHECK-NEXT: Index: 1 +#CHECK-NEXT: ID: 0x200 +#CHECK-NEXT: Name: __TEXT +#CHECK-NEXT: Type: container +#CHECK-NEXT: Permissions: r-x +#CHECK-NEXT: Thread specific: no +#CHECK-NEXT: VM address: 0x100000000 +#CHECK-NEXT: VM size: 4096 +#CHECK-NEXT: File size: 4096 +#CHECK-NEXT: Showing 3 subsections +#CHECK-NEXT: Index: 0 +#CHECK-NEXT: ID: 0x1 +#CHECK-NEXT: Name: __text +#CHECK-NEXT: Type: code +#CHECK-NEXT: Permissions: r-x +#CHECK-NEXT: Thread specific: no +#CHECK-NEXT: VM address: 0x100000f30 +#CHECK-NEXT: VM size: 22 +#CHECK-NEXT: File size: 22 +#CHECK-EMPTY: +#CHECK-NEXT: Index: 1 +#CHECK-NEXT: ID: 0x2 +#CHECK-NEXT: Name: __unwind_info +#CHECK-NEXT: Type: compact-unwind +#CHECK-NEXT: Permissions: r-x +#CHECK-NEXT: Thread specific: no +#CHECK-NEXT: VM address: 0x100000f48 +#CHECK-NEXT: VM size: 76 +#CHECK-NEXT: File size: 76 +#CHECK-EMPTY: +#CHECK-NEXT: Index: 2 +#CHECK-NEXT: ID: 0x3 +#CHECK-NEXT: Name: __eh_frame +#CHECK-NEXT: Type: eh-frame +#CHECK-NEXT: Permissions: r-x +#CHECK-NEXT: Thread specific: no +#CHECK-NEXT: VM address: 0x100000f98 +#CHECK-NEXT: VM size: 104 +#CHECK-NEXT: File size: 104 + +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x00000003 + filetype: 0x00000002 + ncmds: 12 + sizeofcmds: 728 + flags: 0x00000085 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __PAGEZERO + vmaddr: 0 + vmsize: 4294967296 + fileoff: 0 + filesize: 0 + maxprot: 0 + initprot: 0 + nsects: 0 + flags: 0 + - cmd: LC_SEGMENT_64 + cmdsize: 312 + segname: __TEXT + vmaddr: 4294967296 + vmsize: 4096 + fileoff: 0 + filesize: 4096 + maxprot: 7 + initprot: 5 + nsects: 3 + flags: 0 + Sections: + - sectname: __text + segname: __TEXT + addr: 0x0000000100000F30 + size: 22 + offset: 0x00000F30 + align: 4 + reloff: 0x00000000 + nreloc: 0 + flags: 0x80000400 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - sectname: __unwind_info + segname: __TEXT + addr: 0x0000000100000F48 + size: 76 + offset: 0x00000F48 + align: 2 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - sectname: __eh_frame + segname: __TEXT + addr: 0x0000000100000F98 + size: 104 + offset: 0x00000F98 + align: 3 + reloff: 0x00000000 + nreloc: 0 + flags: 0x0000000B + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 +... diff --git a/lldb/test/Shell/ObjectFile/MachO/symtab.yaml b/lldb/test/Shell/ObjectFile/MachO/symtab.yaml new file mode 100644 index 00000000000..e50ba6b6c22 --- /dev/null +++ b/lldb/test/Shell/ObjectFile/MachO/symtab.yaml @@ -0,0 +1,699 @@ +# Tests that the symbol table properly merges the two entries for +# global_constant, even when the debug symbol comes last. +# RUN: mkdir -p %t +# RUN: yaml2obj %s -o %t/a.out +# RUN: %lldb %t/a.out -o "target modules dump symtab a.out" | FileCheck %s +# CHECK: global_constant +# CHECK-NOT: global_constant +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x80000003 + filetype: 0x00000002 + ncmds: 20 + sizeofcmds: 1992 + flags: 0x00200085 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __PAGEZERO + vmaddr: 0 + vmsize: 4294967296 + fileoff: 0 + filesize: 0 + maxprot: 0 + initprot: 0 + nsects: 0 + flags: 0 + - cmd: LC_SEGMENT_64 + cmdsize: 552 + segname: __TEXT + vmaddr: 4294967296 + vmsize: 4096 + fileoff: 0 + filesize: 4096 + maxprot: 5 + initprot: 5 + nsects: 6 + flags: 0 + Sections: + - sectname: __text + segname: __TEXT + addr: 0x0000000100000DE0 + size: 383 + offset: 0x00000DE0 + align: 4 + reloff: 0x00000000 + nreloc: 0 + flags: 0x80000400 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + content: 554889E54883EC30488D054112000031C948C7052C1200005704000048C70529120000AE080000488B151A120000897DE44889C7488D45E8488975D84889C6B821000000488955D04889C2E830010000488B7DD0488D35F5110000E840000000488D7DE8E81D01000031C04883C4305DC3662E0F1F8400000000000F1F440000554889E548C745F000000000488975F848897DF05DC3662E0F1F840000000000554889E54883EC3048C745F80000000048C745F00000000048C745E80000000048897DF8488975F0488B06488945E848897DD8488945E0488D3D62110000E81D000000488D7DD84889C6E891FFFFFF4883C4305DC3662E0F1F840000000000904883EC284889F8488B0F4883F9000F9CC2F6C2014889CE48897C2420488944241848894C24104889742408750A488B4424084883C428C3488B44241048C1F82048F7D8488B4C241089CA4863F2488B7C24204801F731D289D6488934244889C6488B1424488B0C24E81F0000004889C1488B54241848890248894C2408EBAE + - sectname: __stubs + segname: __TEXT + addr: 0x0000000100000F60 + size: 18 + offset: 0x00000F60 + align: 1 + reloff: 0x00000000 + nreloc: 0 + flags: 0x80000408 + reserved1: 0x00000000 + reserved2: 0x00000006 + reserved3: 0x00000000 + content: FF259A100000FF259C100000FF259E100000 + - sectname: __stub_helper + segname: __TEXT + addr: 0x0000000100000F74 + size: 46 + offset: 0x00000F74 + align: 2 + reloff: 0x00000000 + nreloc: 0 + flags: 0x80000400 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + content: 4C8D1D9D1000004153FF257D000000906800000000E9E6FFFFFF6819000000E9DCFFFFFF6830000000E9D2FFFFFF + - sectname: __swift5_typeref + segname: __TEXT + addr: 0x0000000100000FA2 + size: 7 + offset: 0x00000FA2 + align: 1 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + content: 53695F53697400 + - sectname: __const + segname: __TEXT + addr: 0x0000000100000FAA + size: 2 + offset: 0x00000FAA + align: 1 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + content: '0300' + - sectname: __unwind_info + segname: __TEXT + addr: 0x0000000100000FAC + size: 80 + offset: 0x00000FAC + align: 2 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + content: 010000001C000000000000001C000000000000001C00000002000000E00D00003400000034000000600F00000000000034000000030000000C0002001400020000000001000100000000060200000001 + - cmd: LC_SEGMENT_64 + cmdsize: 232 + segname: __DATA_CONST + vmaddr: 4294971392 + vmsize: 4096 + fileoff: 4096 + filesize: 4096 + maxprot: 3 + initprot: 3 + nsects: 2 + flags: 16 + Sections: + - sectname: __got + segname: __DATA_CONST + addr: 0x0000000100001000 + size: 8 + offset: 0x00001000 + align: 3 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000006 + reserved1: 0x00000003 + reserved2: 0x00000000 + reserved3: 0x00000000 + content: '0000000000000000' + - sectname: __objc_imageinfo + segname: __DATA_CONST + addr: 0x0000000100001008 + size: 8 + offset: 0x00001008 + align: 2 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + content: '0000000040070105' + - cmd: LC_SEGMENT_64 + cmdsize: 312 + segname: __DATA + vmaddr: 4294975488 + vmsize: 4096 + fileoff: 8192 + filesize: 4096 + maxprot: 3 + initprot: 3 + nsects: 3 + flags: 0 + Sections: + - sectname: __la_symbol_ptr + segname: __DATA + addr: 0x0000000100002000 + size: 24 + offset: 0x00002000 + align: 3 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000007 + reserved1: 0x00000004 + reserved2: 0x00000000 + reserved3: 0x00000000 + content: 840F0000010000008E0F000001000000980F000001000000 + - sectname: __data + segname: __DATA + addr: 0x0000000100002018 + size: 16 + offset: 0x00002018 + align: 3 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + content: 000000000000000082EFFFFFFAFFFFFF + - sectname: __common + segname: __DATA + addr: 0x0000000100002028 + size: 16 + offset: 0x00000000 + align: 3 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000001 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __LINKEDIT + vmaddr: 4294979584 + vmsize: 4096 + fileoff: 12288 + filesize: 1924 + maxprot: 1 + initprot: 1 + nsects: 0 + flags: 0 + - cmd: LC_DYLD_INFO_ONLY + cmdsize: 48 + rebase_off: 12288 + rebase_size: 8 + bind_off: 12296 + bind_size: 24 + weak_bind_off: 0 + weak_bind_size: 0 + lazy_bind_off: 12320 + lazy_bind_size: 96 + export_off: 12416 + export_size: 48 + - cmd: LC_SYMTAB + cmdsize: 24 + symoff: 12472 + nsyms: 41 + stroff: 13156 + strsize: 1056 + - cmd: LC_DYSYMTAB + cmdsize: 80 + ilocalsym: 0 + nlocalsym: 35 + iextdefsym: 35 + nextdefsym: 2 + iundefsym: 37 + nundefsym: 4 + tocoff: 0 + ntoc: 0 + modtaboff: 0 + nmodtab: 0 + extrefsymoff: 0 + nextrefsyms: 0 + indirectsymoff: 13128 + nindirectsyms: 7 + extreloff: 0 + nextrel: 0 + locreloff: 0 + nlocrel: 0 + - cmd: LC_LOAD_DYLINKER + cmdsize: 32 + name: 12 + PayloadString: '/usr/lib/dyld' + ZeroPadBytes: 7 + - cmd: LC_UUID + cmdsize: 24 + uuid: A89F9D23-8190-3946-A70B-B8E833E68640 + - cmd: LC_BUILD_VERSION + cmdsize: 32 + platform: 1 + minos: 659200 + sdk: 659200 + ntools: 1 + Tools: + - tool: 3 + version: 36176384 + - cmd: LC_SOURCE_VERSION + cmdsize: 16 + version: 0 + - cmd: LC_MAIN + cmdsize: 24 + entryoff: 3552 + stacksize: 0 + - cmd: LC_LOAD_DYLIB + cmdsize: 56 + dylib: + name: 24 + timestamp: 2 + current_version: 14942208 + compatibility_version: 65536 + PayloadString: '/usr/lib/libobjc.A.dylib' + ZeroPadBytes: 8 + - cmd: LC_LOAD_DYLIB + cmdsize: 56 + dylib: + name: 24 + timestamp: 2 + current_version: 83951616 + compatibility_version: 65536 + PayloadString: '/usr/lib/libSystem.B.dylib' + ZeroPadBytes: 6 + - cmd: LC_LOAD_DYLIB + cmdsize: 64 + dylib: + name: 24 + timestamp: 2 + current_version: 0 + compatibility_version: 65536 + PayloadString: '/usr/lib/swift/libswiftCore.dylib' + ZeroPadBytes: 7 + - cmd: LC_RPATH + cmdsize: 136 + path: 12 + PayloadString: '/Volumes/Jonas/internal-stable/build/Ninja-RelWithDebInfoAssert+stdlib-RelWithDebInfo/swift-macosx-x86_64/lib/swift/macosx' + ZeroPadBytes: 2 + - cmd: LC_RPATH + cmdsize: 128 + path: 12 + PayloadString: '/Applications/XcodeY.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift' + ZeroPadBytes: 2 + - cmd: LC_FUNCTION_STARTS + cmdsize: 16 + dataoff: 12464 + datasize: 8 + - cmd: LC_DATA_IN_CODE + cmdsize: 16 + dataoff: 12472 + datasize: 0 +LinkEditData: + RebaseOpcodes: + - Opcode: REBASE_OPCODE_SET_TYPE_IMM + Imm: 1 + - Opcode: REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB + Imm: 3 + ExtraData: + - 0x0000000000000000 + - Opcode: REBASE_OPCODE_DO_REBASE_IMM_TIMES + Imm: 3 + - Opcode: REBASE_OPCODE_DONE + Imm: 0 + BindOpcodes: + - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM + Imm: 2 + Symbol: '' + - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM + Imm: 0 + Symbol: dyld_stub_binder + - Opcode: BIND_OPCODE_SET_TYPE_IMM + Imm: 1 + Symbol: '' + - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB + Imm: 2 + ULEBExtraData: + - 0x0000000000000000 + Symbol: '' + - Opcode: BIND_OPCODE_DO_BIND + Imm: 0 + Symbol: '' + - Opcode: BIND_OPCODE_DONE + Imm: 0 + Symbol: '' + LazyBindOpcodes: + - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB + Imm: 3 + ULEBExtraData: + - 0x0000000000000000 + Symbol: '' + - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM + Imm: 3 + Symbol: '' + - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM + Imm: 0 + Symbol: _swift_beginAccess + - Opcode: BIND_OPCODE_DO_BIND + Imm: 0 + Symbol: '' + - Opcode: BIND_OPCODE_DONE + Imm: 0 + Symbol: '' + - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB + Imm: 3 + ULEBExtraData: + - 0x0000000000000008 + Symbol: '' + - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM + Imm: 3 + Symbol: '' + - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM + Imm: 0 + Symbol: _swift_endAccess + - Opcode: BIND_OPCODE_DO_BIND + Imm: 0 + Symbol: '' + - Opcode: BIND_OPCODE_DONE + Imm: 0 + Symbol: '' + - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB + Imm: 3 + ULEBExtraData: + - 0x0000000000000010 + Symbol: '' + - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM + Imm: 3 + Symbol: '' + - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM + Imm: 0 + Symbol: _swift_getTypeByMangledNameInContext + - Opcode: BIND_OPCODE_DO_BIND + Imm: 0 + Symbol: '' + - Opcode: BIND_OPCODE_DONE + Imm: 0 + Symbol: '' + - Opcode: BIND_OPCODE_DONE + Imm: 0 + Symbol: '' + - Opcode: BIND_OPCODE_DONE + Imm: 0 + Symbol: '' + - Opcode: BIND_OPCODE_DONE + Imm: 0 + Symbol: '' + - Opcode: BIND_OPCODE_DONE + Imm: 0 + Symbol: '' + - Opcode: BIND_OPCODE_DONE + Imm: 0 + Symbol: '' + ExportTrie: + TerminalSize: 0 + NodeOffset: 0 + Name: '' + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + Children: + - TerminalSize: 0 + NodeOffset: 5 + Name: _ + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + Children: + - TerminalSize: 2 + NodeOffset: 33 + Name: _mh_execute_header + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + - TerminalSize: 3 + NodeOffset: 37 + Name: main + Flags: 0x0000000000000000 + Address: 0x0000000000000DE0 + Other: 0x0000000000000000 + ImportName: '' + NameList: + - n_strx: 118 + n_type: 0x1E + n_sect: 1 + n_desc: 0 + n_value: 4294970976 + - n_strx: 133 + n_type: 0x1E + n_sect: 1 + n_desc: 0 + n_value: 4294971008 + - n_strx: 151 + n_type: 0x1E + n_sect: 1 + n_desc: 128 + n_value: 4294971104 + - n_strx: 199 + n_type: 0x1E + n_sect: 4 + n_desc: 128 + n_value: 4294971298 + - n_strx: 216 + n_type: 0x1E + n_sect: 5 + n_desc: 128 + n_value: 4294971306 + - n_strx: 244 + n_type: 0x0E + n_sect: 10 + n_desc: 0 + n_value: 4294975512 + - n_strx: 259 + n_type: 0x1E + n_sect: 10 + n_desc: 128 + n_value: 4294975520 + - n_strx: 271 + n_type: 0x1E + n_sect: 11 + n_desc: 0 + n_value: 4294975528 + - n_strx: 298 + n_type: 0x1E + n_sect: 11 + n_desc: 0 + n_value: 4294975536 + - n_strx: 325 + n_type: 0x32 + n_sect: 0 + n_desc: 0 + n_value: 1570141141 + - n_strx: 540 + n_type: 0x64 + n_sect: 0 + n_desc: 0 + n_value: 0 + - n_strx: 633 + n_type: 0x64 + n_sect: 0 + n_desc: 0 + n_value: 0 + - n_strx: 644 + n_type: 0x66 + n_sect: 3 + n_desc: 1 + n_value: 1570141203 + - n_strx: 1 + n_type: 0x2E + n_sect: 1 + n_desc: 0 + n_value: 4294970848 + - n_strx: 852 + n_type: 0x24 + n_sect: 1 + n_desc: 0 + n_value: 4294970848 + - n_strx: 1 + n_type: 0x24 + n_sect: 0 + n_desc: 0 + n_value: 128 + - n_strx: 1 + n_type: 0x4E + n_sect: 1 + n_desc: 0 + n_value: 128 + - n_strx: 1 + n_type: 0x2E + n_sect: 1 + n_desc: 0 + n_value: 4294970976 + - n_strx: 858 + n_type: 0x24 + n_sect: 1 + n_desc: 0 + n_value: 4294970976 + - n_strx: 1 + n_type: 0x24 + n_sect: 0 + n_desc: 0 + n_value: 32 + - n_strx: 1 + n_type: 0x4E + n_sect: 1 + n_desc: 0 + n_value: 32 + - n_strx: 1 + n_type: 0x2E + n_sect: 1 + n_desc: 0 + n_value: 4294971008 + - n_strx: 873 + n_type: 0x24 + n_sect: 1 + n_desc: 0 + n_value: 4294971008 + - n_strx: 1 + n_type: 0x24 + n_sect: 0 + n_desc: 0 + n_value: 96 + - n_strx: 1 + n_type: 0x4E + n_sect: 1 + n_desc: 0 + n_value: 96 + - n_strx: 1 + n_type: 0x2E + n_sect: 1 + n_desc: 0 + n_value: 4294971104 + - n_strx: 891 + n_type: 0x24 + n_sect: 1 + n_desc: 0 + n_value: 4294971104 + - n_strx: 1 + n_type: 0x24 + n_sect: 0 + n_desc: 0 + n_value: 127 + - n_strx: 1 + n_type: 0x4E + n_sect: 1 + n_desc: 0 + n_value: 127 + - n_strx: 939 + n_type: 0x20 + n_sect: 0 + n_desc: 0 + n_value: 0 + - n_strx: 956 + n_type: 0x20 + n_sect: 0 + n_desc: 0 + n_value: 0 + - n_strx: 984 + n_type: 0x20 + n_sect: 0 + n_desc: 0 + n_value: 0 + - n_strx: 996 + n_type: 0x20 + n_sect: 0 + n_desc: 0 + n_value: 0 + - n_strx: 1023 + n_type: 0x20 + n_sect: 0 + n_desc: 0 + n_value: 0 + - n_strx: 1 + n_type: 0x64 + n_sect: 1 + n_desc: 0 + n_value: 0 + - n_strx: 2 + n_type: 0x0F + n_sect: 1 + n_desc: 16 + n_value: 4294967296 + - n_strx: 22 + n_type: 0x0F + n_sect: 1 + n_desc: 0 + n_value: 4294970848 + - n_strx: 28 + n_type: 0x01 + n_sect: 0 + n_desc: 768 + n_value: 0 + - n_strx: 47 + n_type: 0x01 + n_sect: 0 + n_desc: 768 + n_value: 0 + - n_strx: 64 + n_type: 0x01 + n_sect: 0 + n_desc: 768 + n_value: 0 + - n_strx: 101 + n_type: 0x01 + n_sect: 0 + n_desc: 512 + n_value: 0 + StringTable: + - ' ' + - __mh_execute_header + - _main + - _swift_beginAccess + - _swift_endAccess + - _swift_getTypeByMangledNameInContext + - dyld_stub_binder + - '_$s1a3useyyxlF' + - '_$s1a1fyySi_SiztF' + - ___swift_instantiateConcreteTypeFromMangledName + - _symbolic Si_Sit + - ___swift_reflection_version + - __dyld_private + - '_$sSi_SitMD' + - '_$s1a15global_constantSivp' + - '_$s1a15global_variableSivp' + - '/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' + - '/Volumes/Jonas/internal-stable/lldb/packages/Python/lldbsuite/test/lang/swift/variables/let/' + - main.swift + - '/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' + - _main + - '_$s1a3useyyxlF' + - '_$s1a1fyySi_SiztF' + - ___swift_instantiateConcreteTypeFromMangledName + - _symbolic Si_Sit + - ___swift_reflection_version + - '_$sSi_SitMD' + - '_$s1a15global_constantSivp' + - '_$s1a15global_variableSivp' + - '' + - '' + - '' + - '' + - '' + - '' +... |

