blob: dc9fb31aaac6b4ba76b5e2ec55b2173536b95098 [file] [edit]
# REQUIRES: python
# RUN: yaml2obj %s -o %t
# RUN: %lldb -b -c %t \
# RUN: -o "script module = lldb.SBModule(lldb.process, 0x180000000)" \
# RUN: -o "script print('sections', module.GetNumSections())" \
# RUN: -o "script print('symbols', module.GetNumSymbols())" \
# RUN: -o "script print('text', module.FindSection('.text').GetSectionData().GetByteSize())" \
# RUN: | FileCheck %s
# A core file that holds only the first 512 bytes of a DLL, at its image base.
# lldb can parse the DLL's headers and sections from that, but llvm::object
# cannot create a COFFObjectFile because the export table and section contents
# are missing. Reading such a module from memory must not crash.
# CHECK: sections 4
# CHECK: symbols 0
# CHECK: text 0
# The memory is the start of the DLL built from symbols-export-table.yaml.
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_CORE
Machine: EM_X86_64
OSABI: ELFOSABI_LINUX
ProgramHeaders:
- Type: PT_NOTE
FirstSec: .note
LastSec: .note
- Type: PT_LOAD
Flags: [ PF_R ]
VAddr: 0x180000000
Align: 0x1000
FirstSec: .memory
LastSec: .memory
Sections:
- Name: .note
Type: SHT_NOTE
Notes:
- Name: CORE
Type: NT_FILE
Desc: 010000000000000000100000000000000000008001000000004000800100000000000000000000002f746d702f746573742e646c6c00
- Name: .memory
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC ]
Address: 0x180000000
AddressAlign: 0x1000
Content: 4D5A0000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005045000064860300000000000006000006000000F00022200B020000000200000002000000000000001000000010000000000080010000000010000000020000060000000000000006000000000000000040000000020000000000000200600100001000000000000010000000000000000010000000000000100000000000000000000010000000002000009C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002E7465787400000021000000001000000002000000020000000000000000000000000000200000602E726461746100009C000000002000000002000000040000000000000000000000000000400000402E646174610000000C000000003000000000000000000000000000000000000000000000400000C0