dw2-3.S 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. /* This testcase is part of GDB, the GNU debugger.
  2. Copyright (C) 2004-2017 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. /* Test a minimal file containing DWARF-2 information. This test also
  14. serves as a skeleton for other DWARF-2 tests. Most other tests will
  15. not be this extensively itemized and commented... */
  16. /* Dummy function to provide debug information for. */
  17. .text
  18. .Lbegin_text1:
  19. .globl func_cu1
  20. .type func_cu1, %function
  21. func_cu1:
  22. .Lbegin_func_cu1:
  23. .4byte 0
  24. .Lend_func_cu1:
  25. .size func_cu1, .-func_cu1
  26. .Lend_text1:
  27. /* Debug information */
  28. .section .debug_info
  29. .Lcu1_begin:
  30. /* CU header */
  31. .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
  32. .Lcu1_start:
  33. .2byte 2 /* DWARF Version */
  34. .4byte .Labbrev1_begin /* Offset into abbrev section */
  35. .byte 4 /* Pointer size */
  36. /* CU die */
  37. .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
  38. .4byte .Lline1_begin /* DW_AT_stmt_list */
  39. .4byte .Lend_text1 /* DW_AT_high_pc */
  40. .4byte .Lbegin_text1 /* DW_AT_low_pc */
  41. .ascii "file1.txt\0" /* DW_AT_name */
  42. .ascii "GNU C 3.3.3\0" /* DW_AT_producer */
  43. .byte 1 /* DW_AT_language (C) */
  44. /* func_cu1 */
  45. .uleb128 2 /* Abbrev: DW_TAG_subprogram */
  46. .byte 1 /* DW_AT_external */
  47. .byte 1 /* DW_AT_decl_file */
  48. .byte 2 /* DW_AT_decl_line */
  49. .ascii "func_cu1\0" /* DW_AT_name */
  50. .4byte .Ltype_int2_in_cu2 /* DW_AT_type */
  51. .4byte .Lbegin_func_cu1 /* DW_AT_low_pc */
  52. .4byte .Lend_func_cu1 /* DW_AT_high_pc */
  53. .byte 1 /* DW_AT_frame_base: length */
  54. .byte 0x55 /* DW_AT_frame_base: DW_OP_reg5 */
  55. /* This type is named "int1" and not "int" to ensure it is unique,
  56. and thus we can easily ensure we expand this CU and not some
  57. other CU with "int". */
  58. .Ltype_int1_in_cu1:
  59. .uleb128 3 /* Abbrev: DW_TAG_base_type */
  60. .ascii "int1\0" /* DW_AT_name */
  61. .byte 4 /* DW_AT_byte_size */
  62. .byte 5 /* DW_AT_encoding */
  63. .Ltype_const_int1_in_cu1:
  64. .uleb128 4 /* Abbrev: DW_TAG_const_type */
  65. .4byte .Ltype_int1_in_cu1-.Lcu1_begin /* DW_AT_type */
  66. .uleb128 5 /* Abbrev: DW_TAG_variable */
  67. .ascii "one\0" /* DW_AT_name */
  68. .4byte .Ltype_const_int1_in_cu1-.Lcu1_begin /* DW_AT_type */
  69. .byte 1 /* DW_AT_const_value */
  70. .byte 0 /* End of children of CU */
  71. .Lcu1_end:
  72. /* Second compilation unit. */
  73. .Lcu2_begin:
  74. /* CU header */
  75. .4byte .Lcu2_end - .Lcu2_start /* Length of Compilation Unit */
  76. .Lcu2_start:
  77. .2byte 2 /* DWARF Version */
  78. .4byte .Labbrev2_begin /* Offset into abbrev section */
  79. .byte 4 /* Pointer size */
  80. /* CU die */
  81. .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
  82. .ascii "file1.txt\0" /* DW_AT_name */
  83. .ascii "GNU C 3.3.3\0" /* DW_AT_producer */
  84. .byte 1 /* DW_AT_language (C) */
  85. /* This type is named "int2" and not "int" to ensure it is unique,
  86. and thus we can easily ensure we expand this CU and not some
  87. other CU with "int". */
  88. .Ltype_int2_in_cu2:
  89. .uleb128 2 /* Abbrev: DW_TAG_base_type */
  90. .ascii "int2\0" /* DW_AT_name */
  91. .byte 4 /* DW_AT_byte_size */
  92. .byte 5 /* DW_AT_encoding */
  93. .Ltype_const_int2_in_cu2:
  94. .uleb128 3 /* Abbrev: DW_TAG_const_type */
  95. .4byte .Ltype_int2_in_cu2-.Lcu2_begin /* DW_AT_type */
  96. .uleb128 4 /* Abbrev: DW_TAG_variable */
  97. .ascii "two\0" /* DW_AT_name */
  98. .4byte .Ltype_const_int2_in_cu2-.Lcu2_begin /* DW_AT_type */
  99. .byte 2 /* DW_AT_const_value */
  100. .byte 0 /* End of children of CU */
  101. .Lcu2_end:
  102. /* Abbrev table */
  103. .section .debug_abbrev
  104. .Labbrev1_begin:
  105. .uleb128 1 /* Abbrev code */
  106. .uleb128 0x11 /* DW_TAG_compile_unit */
  107. .byte 1 /* has_children */
  108. .uleb128 0x10 /* DW_AT_stmt_list */
  109. .uleb128 0x6 /* DW_FORM_data4 */
  110. .uleb128 0x12 /* DW_AT_high_pc */
  111. .uleb128 0x1 /* DW_FORM_addr */
  112. .uleb128 0x11 /* DW_AT_low_pc */
  113. .uleb128 0x1 /* DW_FORM_addr */
  114. .uleb128 0x3 /* DW_AT_name */
  115. .uleb128 0x8 /* DW_FORM_string */
  116. .uleb128 0x25 /* DW_AT_producer */
  117. .uleb128 0x8 /* DW_FORM_string */
  118. .uleb128 0x13 /* DW_AT_language */
  119. .uleb128 0xb /* DW_FORM_data1 */
  120. .byte 0x0 /* Terminator */
  121. .byte 0x0 /* Terminator */
  122. .uleb128 2 /* Abbrev code */
  123. .uleb128 0x2e /* DW_TAG_subprogram */
  124. .byte 0 /* has_children */
  125. .uleb128 0x3f /* DW_AT_external */
  126. .uleb128 0xc /* DW_FORM_flag */
  127. .uleb128 0x3a /* DW_AT_decl_file */
  128. .uleb128 0xb /* DW_FORM_data1 */
  129. .uleb128 0x3b /* DW_AT_decl_line */
  130. .uleb128 0xb /* DW_FORM_data1 */
  131. .uleb128 0x3 /* DW_AT_name */
  132. .uleb128 0x8 /* DW_FORM_string */
  133. .uleb128 0x49 /* DW_AT_type */
  134. .uleb128 0x10 /* DW_FORM_ref_addr */
  135. .uleb128 0x11 /* DW_AT_low_pc */
  136. .uleb128 0x1 /* DW_FORM_addr */
  137. .uleb128 0x12 /* DW_AT_high_pc */
  138. .uleb128 0x1 /* DW_FORM_addr */
  139. .uleb128 0x40 /* DW_AT_frame_base */
  140. .uleb128 0xa /* DW_FORM_block1 */
  141. .byte 0x0 /* Terminator */
  142. .byte 0x0 /* Terminator */
  143. .uleb128 3 /* Abbrev code */
  144. .uleb128 0x24 /* DW_TAG_base_type */
  145. .byte 0 /* has_children */
  146. .uleb128 0x3 /* DW_AT_name */
  147. .uleb128 0x8 /* DW_FORM_string */
  148. .uleb128 0xb /* DW_AT_byte_size */
  149. .uleb128 0xb /* DW_FORM_data1 */
  150. .uleb128 0x3e /* DW_AT_encoding */
  151. .uleb128 0xb /* DW_FORM_data1 */
  152. .byte 0x0 /* Terminator */
  153. .byte 0x0 /* Terminator */
  154. .uleb128 4 /* Abbrev code */
  155. .uleb128 0x26 /* DW_TAG_const_type */
  156. .byte 0x0 /* DW_children_no */
  157. .uleb128 0x49 /* DW_AT_type */
  158. .uleb128 0x13 /* DW_FORM_ref4 */
  159. .byte 0x0 /* Terminator */
  160. .byte 0x0 /* Terminator */
  161. .uleb128 5 /* Abbrev code */
  162. .uleb128 0x34 /* DW_TAG_variable */
  163. .byte 0x0 /* DW_children_no */
  164. .uleb128 0x3 /* DW_AT_name */
  165. .uleb128 0x8 /* DW_FORM_string */
  166. .uleb128 0x49 /* DW_AT_type */
  167. .uleb128 0x13 /* DW_FORM_ref4 */
  168. .uleb128 0x1c /* DW_AT_const_value */
  169. .uleb128 0xb /* DW_FORM_data1 */
  170. .byte 0x0 /* Terminator */
  171. .byte 0x0 /* Terminator */
  172. .byte 0x0 /* Terminator */
  173. .byte 0x0 /* Terminator */
  174. .Labbrev2_begin:
  175. .uleb128 1 /* Abbrev code */
  176. .uleb128 0x11 /* DW_TAG_compile_unit */
  177. .byte 1 /* has_children */
  178. .uleb128 0x3 /* DW_AT_name */
  179. .uleb128 0x8 /* DW_FORM_string */
  180. .uleb128 0x25 /* DW_AT_producer */
  181. .uleb128 0x8 /* DW_FORM_string */
  182. .uleb128 0x13 /* DW_AT_language */
  183. .uleb128 0xb /* DW_FORM_data1 */
  184. .byte 0x0 /* Terminator */
  185. .byte 0x0 /* Terminator */
  186. .uleb128 2 /* Abbrev code */
  187. .uleb128 0x24 /* DW_TAG_base_type */
  188. .byte 0 /* has_children */
  189. .uleb128 0x3 /* DW_AT_name */
  190. .uleb128 0x8 /* DW_FORM_string */
  191. .uleb128 0xb /* DW_AT_byte_size */
  192. .uleb128 0xb /* DW_FORM_data1 */
  193. .uleb128 0x3e /* DW_AT_encoding */
  194. .uleb128 0xb /* DW_FORM_data1 */
  195. .byte 0x0 /* Terminator */
  196. .byte 0x0 /* Terminator */
  197. .uleb128 3 /* Abbrev code */
  198. .uleb128 0x26 /* DW_TAG_const_type */
  199. .byte 0x0 /* DW_children_no */
  200. .uleb128 0x49 /* DW_AT_type */
  201. .uleb128 0x13 /* DW_FORM_ref4 */
  202. .byte 0x0 /* Terminator */
  203. .byte 0x0 /* Terminator */
  204. .uleb128 4 /* Abbrev code */
  205. .uleb128 0x34 /* DW_TAG_variable */
  206. .byte 0x0 /* DW_children_no */
  207. .uleb128 0x3 /* DW_AT_name */
  208. .uleb128 0x8 /* DW_FORM_string */
  209. .uleb128 0x49 /* DW_AT_type */
  210. .uleb128 0x13 /* DW_FORM_ref4 */
  211. .uleb128 0x1c /* DW_AT_const_value */
  212. .uleb128 0xb /* DW_FORM_data1 */
  213. .byte 0x0 /* Terminator */
  214. .byte 0x0 /* Terminator */
  215. .byte 0x0 /* Terminator */
  216. .byte 0x0 /* Terminator */
  217. /* Line table */
  218. .section .debug_line
  219. .Lline1_begin:
  220. .4byte .Lline1_end - .Lline1_start /* Initial length */
  221. .Lline1_start:
  222. .2byte 2 /* Version */
  223. .4byte .Lline1_lines - .Lline1_hdr /* header_length */
  224. .Lline1_hdr:
  225. .byte 1 /* Minimum insn length */
  226. .byte 1 /* default_is_stmt */
  227. .byte 1 /* line_base */
  228. .byte 1 /* line_range */
  229. .byte 0x10 /* opcode_base */
  230. /* Standard lengths */
  231. .byte 0
  232. .byte 1
  233. .byte 1
  234. .byte 1
  235. .byte 1
  236. .byte 0
  237. .byte 0
  238. .byte 0
  239. .byte 1
  240. .byte 0
  241. .byte 0
  242. .byte 1
  243. .byte 0
  244. .byte 0
  245. .byte 0
  246. /* Include directories */
  247. .byte 0
  248. /* File names */
  249. .ascii "file1.txt\0"
  250. .uleb128 0
  251. .uleb128 0
  252. .uleb128 0
  253. .byte 0
  254. .Lline1_lines:
  255. .byte 0 /* DW_LNE_set_address */
  256. .uleb128 5
  257. .byte 2
  258. .4byte .Lbegin_func_cu1
  259. .byte 3 /* DW_LNS_advance_line */
  260. .sleb128 3 /* ... to 4 */
  261. .byte 1 /* DW_LNS_copy */
  262. .byte 1 /* DW_LNS_copy (second time as an end-of-prologue marker) */
  263. .byte 0 /* DW_LNE_set_address */
  264. .uleb128 5
  265. .byte 2
  266. .4byte .Lend_func_cu1
  267. .byte 0 /* DW_LNE_end_of_sequence */
  268. .uleb128 1
  269. .byte 1
  270. .Lline1_end: