llvm-dsymutil can produce mach-o files where some sections in __DWARF exceed the 4GB barrier and subsequent sections in the dSYM will be inaccessible because the mach-o section_64 structure only has a 32 bit file offset. This patch enables LLDB to load a large dSYM file by figuring out when this happens and properly adjusting the file offset of the LLDB sections. I was unable to add a test as obj2yaml and yaml2obj are broken for mach-o files and they can't convert a yaml file back into a valid mach-o object file. Any suggestions for adding a test would be appreciated.
14 lines
762 B
Plaintext
14 lines
762 B
Plaintext
RUN: %lldb -b %p/Inputs/section-overflow-binary \
|
|
RUN: -o 'script dwarf = lldb.target.module[0].sections[0]' \
|
|
RUN: -o 'script section = dwarf.GetSubSectionAtIndex(0)' \
|
|
RUN: -o "script print(f'{section.GetName()} file_offset=0x{section.GetFileOffset():016x}')" \
|
|
RUN: -o 'script section = dwarf.GetSubSectionAtIndex(1)' \
|
|
RUN: -o "script print(f'{section.GetName()} file_offset=0x{section.GetFileOffset():016x}')" \
|
|
RUN: -o 'script section = dwarf.GetSubSectionAtIndex(2)' \
|
|
RUN: -o "script print(f'{section.GetName()} file_offset=0x{section.GetFileOffset():016x}')" \
|
|
RUN: | FileCheck %s
|
|
|
|
CHECK: __debug_abbrev file_offset=0x00000000fffffff0
|
|
CHECK: __debug_info file_offset=0x0000000100000010
|
|
CHECK: __debug_line file_offset=0x0000000300000010
|