dw2-anonymous-func.S 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. /* This testcase is part of GDB, the GNU debugger.
  2. Copyright 2004-2022 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. .int 0
  24. .Lend_func_cu1:
  25. .size func_cu1, .-func_cu1
  26. .globl func_cu2
  27. .type func_cu2, %function
  28. func_cu2:
  29. .Lbegin_func_cu2:
  30. .int 0
  31. .Lend_func_cu2:
  32. .size func_cu2, .-func_cu2
  33. .Lend_text1:
  34. /* Debug information */
  35. .section .debug_info
  36. .Lcu1_begin:
  37. /* CU header */
  38. .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
  39. .Lcu1_start:
  40. .2byte 2 /* DWARF Version */
  41. .4byte .Labbrev1_begin /* Offset into abbrev section */
  42. .byte 4 /* Pointer size */
  43. /* CU die */
  44. .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
  45. .4byte .Lline1_begin /* DW_AT_stmt_list */
  46. .4byte .Lend_text1 /* DW_AT_high_pc */
  47. .4byte .Lbegin_text1 /* DW_AT_low_pc */
  48. .ascii "file1.txt\0" /* DW_AT_name */
  49. .ascii "GNU C 3.3.3\0" /* DW_AT_producer */
  50. .byte 0x0d /* DW_AT_language (Ada95) */
  51. /* func_cu1 */
  52. .uleb128 2 /* Abbrev: DW_TAG_subprogram */
  53. .byte 1 /* DW_AT_external */
  54. .byte 1 /* DW_AT_decl_file */
  55. .byte 2 /* DW_AT_decl_line */
  56. .ascii "func_cu1\0" /* DW_AT_name */
  57. .4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */
  58. .4byte .Lbegin_func_cu1 /* DW_AT_low_pc */
  59. .4byte .Lend_func_cu1 /* DW_AT_high_pc */
  60. .byte 1 /* DW_AT_frame_base: length */
  61. .byte 0x55 /* DW_AT_frame_base: DW_OP_reg5 */
  62. /* Nested function missing a name attribute. */
  63. .uleb128 4 /* Abbrev: DW_TAG_subprogram */
  64. .byte 1 /* DW_AT_external */
  65. .byte 1 /* DW_AT_decl_file */
  66. .byte 2 /* DW_AT_decl_line */
  67. .4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */
  68. .4byte .Lbegin_func_cu2 /* DW_AT_low_pc */
  69. .4byte .Lend_func_cu2 /* DW_AT_high_pc */
  70. .byte 1 /* DW_AT_frame_base: length */
  71. .byte 0x55 /* DW_AT_frame_base: DW_OP_reg5 */
  72. .byte 0x0 /* End of children of func_cu1 */
  73. /* Non-nested function missing a name attribute. */
  74. .uleb128 4 /* Abbrev: DW_TAG_subprogram */
  75. .byte 1 /* DW_AT_external */
  76. .byte 1 /* DW_AT_decl_file */
  77. .byte 2 /* DW_AT_decl_line */
  78. .4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */
  79. .4byte .Lbegin_func_cu2 /* DW_AT_low_pc */
  80. .4byte .Lend_func_cu2 /* DW_AT_high_pc */
  81. .byte 1 /* DW_AT_frame_base: length */
  82. .byte 0x55 /* DW_AT_frame_base: DW_OP_reg5 */
  83. .Ltype_int:
  84. .uleb128 3 /* Abbrev: DW_TAG_base_type */
  85. .ascii "int\0" /* DW_AT_name */
  86. .byte 4 /* DW_AT_byte_size */
  87. .byte 5 /* DW_AT_encoding */
  88. .byte 0 /* End of children of CU */
  89. .Lcu1_end:
  90. /* Abbrev table */
  91. .section .debug_abbrev
  92. .Labbrev1_begin:
  93. .uleb128 1 /* Abbrev code */
  94. .uleb128 0x11 /* DW_TAG_compile_unit */
  95. .byte 1 /* has_children */
  96. .uleb128 0x10 /* DW_AT_stmt_list */
  97. .uleb128 0x6 /* DW_FORM_data4 */
  98. .uleb128 0x12 /* DW_AT_high_pc */
  99. .uleb128 0x1 /* DW_FORM_addr */
  100. .uleb128 0x11 /* DW_AT_low_pc */
  101. .uleb128 0x1 /* DW_FORM_addr */
  102. .uleb128 0x3 /* DW_AT_name */
  103. .uleb128 0x8 /* DW_FORM_string */
  104. .uleb128 0x25 /* DW_AT_producer */
  105. .uleb128 0x8 /* DW_FORM_string */
  106. .uleb128 0x13 /* DW_AT_language */
  107. .uleb128 0xb /* DW_FORM_data1 */
  108. .byte 0x0 /* Terminator */
  109. .byte 0x0 /* Terminator */
  110. .uleb128 2 /* Abbrev code */
  111. .uleb128 0x2e /* DW_TAG_subprogram */
  112. .byte 1 /* has_children */
  113. .uleb128 0x3f /* DW_AT_external */
  114. .uleb128 0xc /* DW_FORM_flag */
  115. .uleb128 0x3a /* DW_AT_decl_file */
  116. .uleb128 0xb /* DW_FORM_data1 */
  117. .uleb128 0x3b /* DW_AT_decl_line */
  118. .uleb128 0xb /* DW_FORM_data1 */
  119. .uleb128 0x3 /* DW_AT_name */
  120. .uleb128 0x8 /* DW_FORM_string */
  121. .uleb128 0x49 /* DW_AT_type */
  122. .uleb128 0x13 /* DW_FORM_ref4 */
  123. .uleb128 0x11 /* DW_AT_low_pc */
  124. .uleb128 0x1 /* DW_FORM_addr */
  125. .uleb128 0x12 /* DW_AT_high_pc */
  126. .uleb128 0x1 /* DW_FORM_addr */
  127. .uleb128 0x40 /* DW_AT_frame_base */
  128. .uleb128 0xa /* DW_FORM_block1 */
  129. .byte 0x0 /* Terminator */
  130. .byte 0x0 /* Terminator */
  131. .uleb128 3 /* Abbrev code */
  132. .uleb128 0x24 /* DW_TAG_base_type */
  133. .byte 0 /* has_children */
  134. .uleb128 0x3 /* DW_AT_name */
  135. .uleb128 0x8 /* DW_FORM_string */
  136. .uleb128 0xb /* DW_AT_byte_size */
  137. .uleb128 0xb /* DW_FORM_data1 */
  138. .uleb128 0x3e /* DW_AT_encoding */
  139. .uleb128 0xb /* DW_FORM_data1 */
  140. .byte 0x0 /* Terminator */
  141. .byte 0x0 /* Terminator */
  142. .uleb128 4 /* Abbrev code */
  143. .uleb128 0x2e /* DW_TAG_subprogram */
  144. .byte 0 /* has_children */
  145. .uleb128 0x3f /* DW_AT_external */
  146. .uleb128 0xc /* DW_FORM_flag */
  147. .uleb128 0x3a /* DW_AT_decl_file */
  148. .uleb128 0xb /* DW_FORM_data1 */
  149. .uleb128 0x3b /* DW_AT_decl_line */
  150. .uleb128 0xb /* DW_FORM_data1 */
  151. .uleb128 0x49 /* DW_AT_type */
  152. .uleb128 0x13 /* DW_FORM_ref4 */
  153. .uleb128 0x11 /* DW_AT_low_pc */
  154. .uleb128 0x1 /* DW_FORM_addr */
  155. .uleb128 0x12 /* DW_AT_high_pc */
  156. .uleb128 0x1 /* DW_FORM_addr */
  157. .uleb128 0x40 /* DW_AT_frame_base */
  158. .uleb128 0xa /* DW_FORM_block1 */
  159. .byte 0x0 /* Terminator */
  160. .byte 0x0 /* Terminator */
  161. .byte 0x0 /* Terminator */
  162. .byte 0x0 /* Terminator */
  163. /* Line table */
  164. .section .debug_line
  165. .Lline1_begin:
  166. .4byte .Lline1_end - .Lline1_start /* Initial length */
  167. .Lline1_start:
  168. .2byte 2 /* Version */
  169. .4byte .Lline1_lines - .Lline1_hdr /* header_length */
  170. .Lline1_hdr:
  171. .byte 1 /* Minimum insn length */
  172. .byte 1 /* default_is_stmt */
  173. .byte 1 /* line_base */
  174. .byte 1 /* line_range */
  175. .byte 0x10 /* opcode_base */
  176. /* Standard lengths */
  177. .byte 0
  178. .byte 1
  179. .byte 1
  180. .byte 1
  181. .byte 1
  182. .byte 0
  183. .byte 0
  184. .byte 0
  185. .byte 1
  186. .byte 0
  187. .byte 0
  188. .byte 1
  189. .byte 0
  190. .byte 0
  191. .byte 0
  192. /* Include directories */
  193. .byte 0
  194. /* File names */
  195. .ascii "file1.txt\0"
  196. .uleb128 0
  197. .uleb128 0
  198. .uleb128 0
  199. .byte 0
  200. .Lline1_lines:
  201. .byte 0 /* DW_LNE_set_address */
  202. .uleb128 5
  203. .byte 2
  204. .4byte .Lbegin_func_cu1
  205. .byte 3 /* DW_LNS_advance_line */
  206. .sleb128 3 /* ... to 4 */
  207. .byte 1 /* DW_LNS_copy */
  208. .byte 1 /* DW_LNS_copy (second time as an end-of-prologue marker) */
  209. .byte 0 /* DW_LNE_set_address */
  210. .uleb128 5
  211. .byte 2
  212. .4byte .Lend_func_cu1
  213. .byte 0 /* DW_LNE_end_of_sequence */
  214. .uleb128 1
  215. .byte 1
  216. .Lline1_end: