# Test that we report pcpair ranges from DIEs that have: # 0x00000010: DW_TAG_subprogram # DW_AT_low_pc (0x0000000000001000) # DW_AT_high_pc (0x0000000000001010) # # This is the most common way of getting data for the compileunits # data source. # RUN: %yaml2obj %s --docnum=1 -o %t.obj # RUN: %yaml2obj %s --docnum=2 -o %t.dwo # RUN: %bloaty %t.obj --debug-file %t.dwo -d compileunits --raw-map --domain=vm | %FileCheck %s --- !ELF FileHeader: Class: ELFCLASS64 Data: ELFDATA2LSB Type: ET_DYN Machine: EM_X86_64 Entry: 0x1040 ProgramHeaders: - Type: PT_LOAD Flags: [ PF_X, PF_R ] FirstSec: .text LastSec: .text VAddr: 0x1000 Align: 0x1000 Sections: - Name: .note.gnu.build-id Type: SHT_NOTE Notes: - Name: GNU Desc: 6CF422D909772A0FB5400518A689D9F15F14BF57 Type: 0x3 # NT_GNU_BUILD_ID - Name: .text Type: SHT_PROGBITS Flags: [ SHF_ALLOC, SHF_EXECINSTR ] Address: 0x1000 AddressAlign: 0x10 Size: 0x20 ... --- !ELF FileHeader: Class: ELFCLASS64 Data: ELFDATA2LSB Type: ET_DYN Machine: EM_X86_64 Entry: 0x1040 Sections: - Name: .note.gnu.build-id Type: SHT_NOTE Notes: - Name: GNU Desc: 6CF422D909772A0FB5400518A689D9F15F14BF57 Type: 0x3 # NT_GNU_BUILD_ID DWARF: debug_str: - foo.c - bar.c debug_abbrev: - ID: 0 Table: - Code: 0x1 Tag: DW_TAG_compile_unit Children: DW_CHILDREN_yes Attributes: - Attribute: DW_AT_name Form: DW_FORM_strp - Code: 0x2 Tag: DW_TAG_subprogram Children: DW_CHILDREN_no Attributes: - Attribute: DW_AT_low_pc Form: DW_FORM_addr - Attribute: DW_AT_high_pc Form: DW_FORM_data4 # high_pc as size - Code: 0x3 Tag: DW_TAG_subprogram Children: DW_CHILDREN_no Attributes: - Attribute: DW_AT_low_pc Form: DW_FORM_addr - Attribute: DW_AT_high_pc Form: DW_FORM_addr # high_pc as addr debug_info: # 0x0000000b: DW_TAG_compile_unit # DW_AT_name [DW_FORM_strp] ("foo.c") # # 0x00000010: DW_TAG_subprogram # DW_AT_low_pc [DW_FORM_addr] (0x0000000000001010) # DW_AT_high_pc [DW_FORM_data4] (0x00000010) - Version: 4 AbbrevTableID: 0 AbbrOffset: 0x0 AddrSize: 8 Entries: - AbbrCode: 0x1 Values: - Value: 0x0 - AbbrCode: 0x2 Values: - Value: 0x1010 - Value: 0x10 - AbbrCode: 0x0 # 0x00000029: DW_TAG_compile_unit # DW_AT_name [DW_FORM_strp] ("bar.c") # # 0x0000002e: DW_TAG_subprogram # DW_AT_low_pc [DW_FORM_addr] (0x0000000000001000) # DW_AT_high_pc [DW_FORM_addr] (0x0000000000001010) - Version: 4 AbbrevTableID: 0 AbbrOffset: 0x0 AddrSize: 8 Entries: - AbbrCode: 0x1 Values: - Value: 0x6 - AbbrCode: 0x3 Values: - Value: 0x1000 - Value: 0x1010 - AbbrCode: 0x0 ... # CHECK: VM MAP: # CHECK: 0000-1000 4096 [-- Nothing mapped --] # CHECK: 1000-1010 16 bar.c # CHECK: 1010-1020 16 foo.c