dw2-basic.S 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. .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_int-.Lcu1_begin /* 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. .Ltype_int:
  56. .uleb128 3 /* Abbrev: DW_TAG_base_type */
  57. .ascii "int\0" /* DW_AT_name */
  58. .byte 4 /* DW_AT_byte_size */
  59. .byte 5 /* DW_AT_encoding */
  60. .byte 0 /* End of children of CU */
  61. .Lcu1_end:
  62. /* Abbrev table */
  63. .section .debug_abbrev
  64. .Labbrev1_begin:
  65. .uleb128 1 /* Abbrev code */
  66. .uleb128 0x11 /* DW_TAG_compile_unit */
  67. .byte 1 /* has_children */
  68. .uleb128 0x10 /* DW_AT_stmt_list */
  69. .uleb128 0x6 /* DW_FORM_data4 */
  70. .uleb128 0x12 /* DW_AT_high_pc */
  71. .uleb128 0x1 /* DW_FORM_addr */
  72. .uleb128 0x11 /* DW_AT_low_pc */
  73. .uleb128 0x1 /* DW_FORM_addr */
  74. .uleb128 0x3 /* DW_AT_name */
  75. .uleb128 0x8 /* DW_FORM_string */
  76. .uleb128 0x25 /* DW_AT_producer */
  77. .uleb128 0x8 /* DW_FORM_string */
  78. .uleb128 0x13 /* DW_AT_language */
  79. .uleb128 0xb /* DW_FORM_data1 */
  80. .byte 0x0 /* Terminator */
  81. .byte 0x0 /* Terminator */
  82. .uleb128 2 /* Abbrev code */
  83. .uleb128 0x2e /* DW_TAG_subprogram */
  84. .byte 0 /* has_children */
  85. .uleb128 0x3f /* DW_AT_external */
  86. .uleb128 0xc /* DW_FORM_flag */
  87. .uleb128 0x3a /* DW_AT_decl_file */
  88. .uleb128 0xb /* DW_FORM_data1 */
  89. .uleb128 0x3b /* DW_AT_decl_line */
  90. .uleb128 0xb /* DW_FORM_data1 */
  91. .uleb128 0x3 /* DW_AT_name */
  92. .uleb128 0x8 /* DW_FORM_string */
  93. .uleb128 0x49 /* DW_AT_type */
  94. .uleb128 0x13 /* DW_FORM_ref4 */
  95. .uleb128 0x11 /* DW_AT_low_pc */
  96. .uleb128 0x1 /* DW_FORM_addr */
  97. .uleb128 0x12 /* DW_AT_high_pc */
  98. .uleb128 0x1 /* DW_FORM_addr */
  99. .uleb128 0x40 /* DW_AT_frame_base */
  100. .uleb128 0xa /* DW_FORM_block1 */
  101. .byte 0x0 /* Terminator */
  102. .byte 0x0 /* Terminator */
  103. .uleb128 3 /* Abbrev code */
  104. .uleb128 0x24 /* DW_TAG_base_type */
  105. .byte 0 /* has_children */
  106. .uleb128 0x3 /* DW_AT_name */
  107. .uleb128 0x8 /* DW_FORM_string */
  108. .uleb128 0xb /* DW_AT_byte_size */
  109. .uleb128 0xb /* DW_FORM_data1 */
  110. .uleb128 0x3e /* DW_AT_encoding */
  111. .uleb128 0xb /* DW_FORM_data1 */
  112. .byte 0x0 /* Terminator */
  113. .byte 0x0 /* Terminator */
  114. .byte 0x0 /* Terminator */
  115. .byte 0x0 /* Terminator */
  116. /* Line table */
  117. .section .debug_line
  118. .Lline1_begin:
  119. .4byte .Lline1_end - .Lline1_start /* Initial length */
  120. .Lline1_start:
  121. .2byte 2 /* Version */
  122. .4byte .Lline1_lines - .Lline1_hdr /* header_length */
  123. .Lline1_hdr:
  124. .byte 1 /* Minimum insn length */
  125. .byte 1 /* default_is_stmt */
  126. .byte 1 /* line_base */
  127. .byte 1 /* line_range */
  128. .byte 0x10 /* opcode_base */
  129. /* Standard lengths */
  130. .byte 0
  131. .byte 1
  132. .byte 1
  133. .byte 1
  134. .byte 1
  135. .byte 0
  136. .byte 0
  137. .byte 0
  138. .byte 1
  139. .byte 0
  140. .byte 0
  141. .byte 1
  142. .byte 0
  143. .byte 0
  144. .byte 0
  145. /* Include directories */
  146. .byte 0
  147. /* File names */
  148. .ascii "file1.txt\0"
  149. .uleb128 0
  150. .uleb128 0
  151. .uleb128 0
  152. .byte 0
  153. .Lline1_lines:
  154. .byte 0 /* DW_LNE_set_address */
  155. .uleb128 5
  156. .byte 2
  157. .4byte .Lbegin_func_cu1
  158. .byte 3 /* DW_LNS_advance_line */
  159. .sleb128 3 /* ... to 4 */
  160. .byte 1 /* DW_LNS_copy */
  161. .byte 1 /* DW_LNS_copy (second time as an end-of-prologue marker) */
  162. .byte 0 /* DW_LNE_set_address */
  163. .uleb128 5
  164. .byte 2
  165. .4byte .Lend_func_cu1
  166. .byte 0 /* DW_LNE_end_of_sequence */
  167. .uleb128 1
  168. .byte 1
  169. .Lline1_end: