dw2-const.S 7.5 KB

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