blob: 16ac641c92472a8b915d38459b163f671637a2e2 [file] [log] [blame]
# Test that we properly ignore DIEs that have DW_AT_declaration=true.
# This indicates a function that was declared, but not defined.
# We don't want to register declarations, only definitions.
# 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
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Address: 0x1000
AddressAlign: 0x10
Size: 0x20
Symbols:
- Name: foo_func
Type: STT_FUNC
Section: .text
Binding: STB_GLOBAL
Value: 0x1000
Size: 0x10
- Name: bar_func
Type: STT_FUNC
Section: .text
Binding: STB_GLOBAL
Value: 0x1010
Size: 0x10
DWARF:
debug_str:
- foo.c
- bar.c
- foo_func
- bar_func
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_linkage_name
Form: DW_FORM_strp
- Attribute: DW_AT_declaration
Form: DW_FORM_flag_present
- Code: 0x3
Tag: DW_TAG_subprogram
Children: DW_CHILDREN_no
Attributes:
- Attribute: DW_AT_linkage_name
Form: DW_FORM_strp
debug_info:
# 0x0000000b: DW_TAG_compile_unit
# DW_AT_name ("foo.c")
#
# 0x00000010: DW_TAG_subprogram
# DW_AT_linkage_name ("bar_func")
# DW_AT_declaration (true)
#
# 0x00000015: DW_TAG_subprogram
# DW_AT_linkage_name ("foo_func")
- Version: 4
AbbrevTableID: 0
AbbrOffset: 0x0
AddrSize: 8
Entries:
- AbbrCode: 0x1
Values:
- Value: 0x0
- AbbrCode: 0x2
Values:
- Value: 0x15
- AbbrCode: 0x3
Values:
- Value: 0xc
- AbbrCode: 0x0
# 0x00000026: DW_TAG_compile_unit
# DW_AT_name ("bar.c")
#
# 0x0000002b: DW_TAG_subprogram
# DW_AT_linkage_name ("bar_func")
- Version: 4
AbbrevTableID: 0
AbbrOffset: 0x0
AddrSize: 8
Entries:
- AbbrCode: 0x1
Values:
- Value: 0x6
- AbbrCode: 0x3
Values:
- Value: 0x15
- AbbrCode: 0x0
...
# CHECK: VM MAP:
# CHECK: 0000-1000 4096 [-- Nothing mapped --]
# CHECK: 1000-1010 16 foo.c
# CHECK: 1010-1020 16 bar.c