pcpair.test 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. # Test that we report pcpair ranges from DIEs that have:
  2. # 0x00000010: DW_TAG_subprogram
  3. # DW_AT_low_pc (0x0000000000001000)
  4. # DW_AT_high_pc (0x0000000000001010)
  5. #
  6. # This is the most common way of getting data for the compileunits
  7. # data source.
  8. # RUN: %yaml2obj %s --docnum=1 -o %t.obj
  9. # RUN: %yaml2obj %s --docnum=2 -o %t.dwo
  10. # RUN: %bloaty %t.obj --debug-file %t.dwo -d compileunits --raw-map --domain=vm | %FileCheck %s
  11. --- !ELF
  12. FileHeader:
  13. Class: ELFCLASS64
  14. Data: ELFDATA2LSB
  15. Type: ET_DYN
  16. Machine: EM_X86_64
  17. Entry: 0x1040
  18. ProgramHeaders:
  19. - Type: PT_LOAD
  20. Flags: [ PF_X, PF_R ]
  21. FirstSec: .text
  22. LastSec: .text
  23. VAddr: 0x1000
  24. Align: 0x1000
  25. Sections:
  26. - Name: .note.gnu.build-id
  27. Type: SHT_NOTE
  28. Notes:
  29. - Name: GNU
  30. Desc: 6CF422D909772A0FB5400518A689D9F15F14BF57
  31. Type: 0x3 # NT_GNU_BUILD_ID
  32. - Name: .text
  33. Type: SHT_PROGBITS
  34. Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
  35. Address: 0x1000
  36. AddressAlign: 0x10
  37. Size: 0x20
  38. ...
  39. --- !ELF
  40. FileHeader:
  41. Class: ELFCLASS64
  42. Data: ELFDATA2LSB
  43. Type: ET_DYN
  44. Machine: EM_X86_64
  45. Entry: 0x1040
  46. Sections:
  47. - Name: .note.gnu.build-id
  48. Type: SHT_NOTE
  49. Notes:
  50. - Name: GNU
  51. Desc: 6CF422D909772A0FB5400518A689D9F15F14BF57
  52. Type: 0x3 # NT_GNU_BUILD_ID
  53. DWARF:
  54. debug_str:
  55. - foo.c
  56. - bar.c
  57. debug_abbrev:
  58. - ID: 0
  59. Table:
  60. - Code: 0x1
  61. Tag: DW_TAG_compile_unit
  62. Children: DW_CHILDREN_yes
  63. Attributes:
  64. - Attribute: DW_AT_name
  65. Form: DW_FORM_strp
  66. - Code: 0x2
  67. Tag: DW_TAG_subprogram
  68. Children: DW_CHILDREN_no
  69. Attributes:
  70. - Attribute: DW_AT_low_pc
  71. Form: DW_FORM_addr
  72. - Attribute: DW_AT_high_pc
  73. Form: DW_FORM_data4 # high_pc as size
  74. - Code: 0x3
  75. Tag: DW_TAG_subprogram
  76. Children: DW_CHILDREN_no
  77. Attributes:
  78. - Attribute: DW_AT_low_pc
  79. Form: DW_FORM_addr
  80. - Attribute: DW_AT_high_pc
  81. Form: DW_FORM_addr # high_pc as addr
  82. debug_info:
  83. # 0x0000000b: DW_TAG_compile_unit
  84. # DW_AT_name [DW_FORM_strp] ("foo.c")
  85. #
  86. # 0x00000010: DW_TAG_subprogram
  87. # DW_AT_low_pc [DW_FORM_addr] (0x0000000000001010)
  88. # DW_AT_high_pc [DW_FORM_data4] (0x00000010)
  89. - Version: 4
  90. AbbrevTableID: 0
  91. AbbrOffset: 0x0
  92. AddrSize: 8
  93. Entries:
  94. - AbbrCode: 0x1
  95. Values:
  96. - Value: 0x0
  97. - AbbrCode: 0x2
  98. Values:
  99. - Value: 0x1010
  100. - Value: 0x10
  101. - AbbrCode: 0x0
  102. # 0x00000029: DW_TAG_compile_unit
  103. # DW_AT_name [DW_FORM_strp] ("bar.c")
  104. #
  105. # 0x0000002e: DW_TAG_subprogram
  106. # DW_AT_low_pc [DW_FORM_addr] (0x0000000000001000)
  107. # DW_AT_high_pc [DW_FORM_addr] (0x0000000000001010)
  108. - Version: 4
  109. AbbrevTableID: 0
  110. AbbrOffset: 0x0
  111. AddrSize: 8
  112. Entries:
  113. - AbbrCode: 0x1
  114. Values:
  115. - Value: 0x6
  116. - AbbrCode: 0x3
  117. Values:
  118. - Value: 0x1000
  119. - Value: 0x1010
  120. - AbbrCode: 0x0
  121. ...
  122. # CHECK: VM MAP:
  123. # CHECK: 0000-1000 4096 [-- Nothing mapped --]
  124. # CHECK: 1000-1010 16 bar.c
  125. # CHECK: 1010-1020 16 foo.c