dw2-icc-opaque.S 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. /* Copyright (C) 2011-2022 Free Software Foundation, Inc.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; either version 3 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  12. /* This test demonstrates a failure to resolve opaque structure types in
  13. binaries compiled by the Intel C compiler. This is GDB PR symtab/13277.
  14. The test was derived from opaque-pointer.c, which contains the single line:
  15. struct opaque_struct_t *p_struct;
  16. and opaque_struct.c, which looks like:
  17. struct opaque_struct_t
  18. {
  19. int wrapped_value;
  20. };
  21. struct opaque_struct_t opaque_internal = { 0 };
  22. What follows is a simplified version of the debug info generated by ICC
  23. version 12.0.4.191. */
  24. .file "opaque-pointer.c"
  25. .data
  26. .comm p_struct,8,8
  27. .global p_struct
  28. .section .debug_info
  29. debug_info_seg1:
  30. .4byte debug_info_seg1_end - 1f /* Length of compilation unit info. */
  31. 1:
  32. .2byte 0x0002 /* DWARF version number. */
  33. .4byte .debug_abbrev_seg1 /* Points to abbrev section for this unit. */
  34. .byte 0x04 /* Target address size. */
  35. .byte 0x01 /* DIE 1: DW_TAG_compile_unit. */
  36. .byte 0x01 /* DW_AT_language = DW_LANG_C89. */
  37. .ascii "Intel(R) C Intel(R) 64 Compiler XE " /* DW_AT_producer. */
  38. .ascii "for applications running on Intel(R) 64, "
  39. .ascii "Version 12.0.4.191 Build 20110427\n "
  40. .asciz "Fixes SameLinkageName MemberPointers"
  41. .byte 0x02 /* DIE 2: DW_TAG_variable. */
  42. .byte 0x01 /* DW_AT_accessibility. */
  43. .asciz "p_struct" /* DW_AT_name. */
  44. .4byte 3f - debug_info_seg1 /* DW_AT_type. */
  45. .byte 0x05 /* DW_AT_location: 5 bytes ... */
  46. .byte 0x03 /* DW_OP_addr ... */
  47. .4byte p_struct /* followed by the address of p_struct. */
  48. .byte 0x01 /* DW_AT_external. */
  49. 3:
  50. .byte 0x03 /* DIE 3: DW_TAG_pointer_type. */
  51. .4byte 4f - debug_info_seg1 /* DW_AT_type. */
  52. 4:
  53. .byte 0x04 /* DIE 4: DW_TAG_structure_type. */
  54. .byte 0x01 /* DW_AT_accessibility. */
  55. .byte 0x00 /* DW_AT_byte_size. */
  56. .asciz "opaque_struct_t" /* DW_AT_name. */
  57. .byte 0x00 /* End DIE 1. */
  58. debug_info_seg1_end:
  59. .section .debug_abbrev
  60. .debug_abbrev_seg1:
  61. .byte 0x01 /* Abbrev 1. */
  62. .byte 0x11 /* DW_TAG_compile_unit. */
  63. .byte 0x01 /* DW_CHILDREN_yes. */
  64. .byte 0x13 /* DW_AT_language. */
  65. .byte 0x0b /* DW_FORM_data1. */
  66. .byte 0x25 /* DW_AT_producer. */
  67. .byte 0x08 /* DW_AT_string. */
  68. .2byte 0x0000 /* End abbrev. */
  69. .byte 0x02 /* Abbrev 2. */
  70. .byte 0x34 /* DW_TAG_variable. */
  71. .byte 0x00 /* DW_CHILDREN_no. */
  72. .byte 0x32 /* DW_AT_accessibility. */
  73. .byte 0x0b /* DW_FORM_data1. */
  74. .byte 0x03 /* DW_AT_name. */
  75. .byte 0x08 /* DW_FORM_string. */
  76. .byte 0x49 /* DW_AT_type. */
  77. .byte 0x13 /* DW_FORM_ref4. */
  78. .byte 0x02 /* DW_AT_location. */
  79. .byte 0x0a /* DW_FORM_block1. */
  80. .byte 0x3f /* DW_AT_external. */
  81. .byte 0x0c /* DW_FORM_flag. */
  82. .2byte 0x0000 /* End abbrev. */
  83. .byte 0x03 /* Abbrev 3. */
  84. .byte 0x0f /* DW_TAG_pointer_type. */
  85. .byte 0x00 /* DW_CHILDREN_no. */
  86. .byte 0x49 /* DW_AT_type. */
  87. .byte 0x13 /* DW_FORM_ref4. */
  88. .2byte 0x0000 /* End abbrev. */
  89. .byte 0x04 /* Abbrev 4. */
  90. .byte 0x13 /* DW_TAG_structure_type. */
  91. .byte 0x00 /* DW_CHILDREN_no. */
  92. .byte 0x32 /* DW_AT_accessibility. */
  93. .byte 0x0b /* DW_FORM_data1. */
  94. .byte 0x0b /* DW_AT_byte_size. */
  95. .byte 0x0b /* DW_FORM_data1. */
  96. .byte 0x03 /* DW_AT_name. */
  97. .byte 0x08 /* DW_FORM_string. */
  98. .2byte 0x0000 /* End abbrev. */
  99. .byte 0x00 /* End abbrev table. */
  100. .file "opaque-struct.c"
  101. .section .debug_info
  102. debug_info_seg2:
  103. .4byte debug_info_seg2_end - 1f /* Length of compilation unit info. */
  104. 1:
  105. .2byte 0x0002 /* DWARF version number. */
  106. .4byte .debug_abbrev_seg2 /* Points to abbrev section for this unit. */
  107. .byte 0x04 /* Target address size. */
  108. .byte 0x01 /* DIE 1: DW_TAG_compile_unit. */
  109. .byte 0x01 /* DW_AT_language = DW_LANG_C89. */
  110. .ascii "Intel(R) C Intel(R) 64 Compiler XE " /* DW_AT_producer. */
  111. .ascii "for applications running on Intel(R) 64, "
  112. .ascii "Version 12.0.4.191 Build 20110427\n "
  113. .asciz "Fixes SameLinkageName MemberPointers"
  114. .byte 0x02 /* DIE 2: DW_TAG_structure_type. */
  115. .byte 0x01 /* DW_AT_accessibility. */
  116. .byte 0x04 /* DW_AT_byte_size. */
  117. .asciz "opaque_struct_t" /* DW_AT_name. */
  118. .byte 0x03 /* DIE 3: DW_TAG_member. */
  119. .byte 0x02 /* DW_AT_data_member_location: 2 bytes ... */
  120. .byte 0x23 /* DW_OP_plus_uconst ... */
  121. .byte 0x00 /* followed by zero. */
  122. .asciz "wrapped_value" /* DW_AT_name. */
  123. .4byte 4f - debug_info_seg2 /* DW_AT_type. */
  124. .byte 0x00
  125. 4:
  126. .byte 0x04 /* DIE 4: DW_TAG_base_type. */
  127. .byte 0x04 /* DW_AT_byte_size. */
  128. .byte 0x05 /* DW_AT_encoding. */
  129. .asciz "int" /* DW_AT_name. */
  130. .byte 0x00 /* End DIE 1. */
  131. debug_info_seg2_end:
  132. .section .debug_abbrev
  133. .debug_abbrev_seg2:
  134. .byte 0x01 /* Abbrev 1. */
  135. .byte 0x11 /* DW_TAG_compile_unit. */
  136. .byte 0x01 /* DW_CHILDREN_yes. */
  137. .byte 0x13 /* DW_AT_language. */
  138. .byte 0x0b /* DW_FORM_data1. */
  139. .byte 0x25 /* DW_AT_producer. */
  140. .byte 0x08 /* DW_FORM_string. */
  141. .2byte 0x0000 /* End abbrev. */
  142. .byte 0x02 /* Abbrev 2. */
  143. .byte 0x13 /* DW_TAG_structure_type. */
  144. .byte 0x01 /* DW_CHILDREN_yes. */
  145. .byte 0x32 /* DW_AT_accessibility. */
  146. .byte 0x0b /* DW_FORM_data1. */
  147. .byte 0x0b /* DW_AT_byte_size. */
  148. .byte 0x0b /* DW_FORM_data1. */
  149. .byte 0x03 /* DW_AT_name. */
  150. .byte 0x08 /* DW_FORM_string. */
  151. .2byte 0x0000 /* End abbrev. */
  152. .byte 0x03 /* Abbrev 3. */
  153. .byte 0x0d /* DW_TAG_member. */
  154. .byte 0x00 /* DW_CHILDREN_no. */
  155. .byte 0x38 /* DW_AT_data_member_location. */
  156. .byte 0x0a /* DW_FORM_block1. */
  157. .byte 0x03 /* DW_AT_name. */
  158. .byte 0x08 /* DW_FORM_string. */
  159. .byte 0x49 /* DW_AT_type. */
  160. .byte 0x13 /* DW_FORM_ref4. */
  161. .2byte 0x0000 /* End abbrev. */
  162. .byte 0x04 /* Abbrev 4. */
  163. .byte 0x24 /* DW_TAG_base_type. */
  164. .byte 0x00 /* DW_CHILDREN_no. */
  165. .byte 0x0b /* DW_AT_byte_size. */
  166. .byte 0x0b /* DW_FORM_data1. */
  167. .byte 0x3e /* DW_AT_encoding. */
  168. .byte 0x0b /* DW_FORM_data1. */
  169. .byte 0x03 /* DW_AT_name. */
  170. .byte 0x08 /* DW_FORM_string. */
  171. .2byte 0x0000 /* End abbrev. */
  172. .byte 0x00 /* End abbrev table. */
  173. .file "opaque-pointer2.c"
  174. .section .debug_info
  175. debug_info_seg3:
  176. .4byte debug_info_seg3_end - 1f /* Length of compilation unit info. */
  177. 1:
  178. .2byte 0x0002 /* DWARF version number. */
  179. .4byte .debug_abbrev_seg3 /* Points to abbrev section for this unit. */
  180. .byte 0x04 /* Target address size. */
  181. .byte 0x01 /* DIE 1: DW_TAG_compile_unit. */
  182. .byte 0x01 /* DW_AT_language = DW_LANG_C89. */
  183. .ascii "Intel(R) C Intel(R) 64 Compiler XE " /* DW_AT_producer. */
  184. .ascii "for applications running on Intel(R) 64, "
  185. .ascii "Version 12.0.4.191 Build 20110427\n "
  186. .asciz "Fixes SameLinkageName MemberPointers"
  187. .byte 0x04 /* DIE 4: DW_TAG_structure_type. */
  188. .byte 0x01 /* DW_AT_accessibility. */
  189. .byte 0x00 /* DW_AT_byte_size. */
  190. .asciz "opaque_struct_t" /* DW_AT_name. */
  191. .byte 0x00 /* End DIE 1. */
  192. debug_info_seg3_end:
  193. .section .debug_abbrev
  194. .debug_abbrev_seg3:
  195. .byte 0x01 /* Abbrev 1. */
  196. .byte 0x11 /* DW_TAG_compile_unit. */
  197. .byte 0x01 /* DW_CHILDREN_yes. */
  198. .byte 0x13 /* DW_AT_language. */
  199. .byte 0x0b /* DW_FORM_data1. */
  200. .byte 0x25 /* DW_AT_producer. */
  201. .byte 0x08 /* DW_AT_string. */
  202. .2byte 0x0000 /* End abbrev. */
  203. .byte 0x04 /* Abbrev 4. */
  204. .byte 0x13 /* DW_TAG_structure_type. */
  205. .byte 0x00 /* DW_CHILDREN_no. */
  206. .byte 0x32 /* DW_AT_accessibility. */
  207. .byte 0x0b /* DW_FORM_data1. */
  208. .byte 0x0b /* DW_AT_byte_size. */
  209. .byte 0x0b /* DW_FORM_data1. */
  210. .byte 0x03 /* DW_AT_name. */
  211. .byte 0x08 /* DW_FORM_string. */
  212. .2byte 0x0000 /* End abbrev. */
  213. .byte 0x00 /* End abbrev table. */