dw2-unresolved.S 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /* This testcase is part of GDB, the GNU debugger.
  2. Copyright 2007-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. #define CONCAT1(a, b) CONCAT2(a, b)
  14. #define CONCAT2(a, b) a ## b
  15. #ifdef SYMBOL_PREFIX
  16. # define SYMBOL(str) CONCAT1(SYMBOL_PREFIX, str)
  17. #else
  18. # define SYMBOL(str) str
  19. #endif
  20. .data
  21. /* VAR1 is wrong here, in the real inferior it is located on stack. As both
  22. places are never modified and they are initialized to the same value it
  23. makes no difference. Ensure the name clash for "var". */
  24. SYMBOL(var1): .byte 1
  25. .globl SYMBOL(var)
  26. SYMBOL(var): .byte 2
  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 cu_text_end /* DW_AT_high_pc */
  39. .4byte cu_text_start /* DW_AT_low_pc */
  40. .ascii "dw2-unresolved-main.c\0" /* DW_AT_name */
  41. .ascii "GNU C 4.3.2\0" /* DW_AT_producer */
  42. .byte 1 /* DW_AT_language (C) */
  43. .Ltype_uchar:
  44. .uleb128 2 /* Abbrev: DW_TAG_base_type */
  45. .ascii "unsigned char\0" /* DW_AT_name */
  46. .byte 1 /* DW_AT_byte_size */
  47. .byte 7 /* DW_AT_encoding */
  48. /* main */
  49. .uleb128 3 /* Abbrev: DW_TAG_subprogram */
  50. .byte 1 /* DW_AT_decl_file */
  51. .byte 2 /* DW_AT_decl_line */
  52. .ascii "main\0" /* DW_AT_name */
  53. .4byte .Ltype_uchar-.Lcu1_begin /* DW_AT_type */
  54. .4byte cu_text_start /* DW_AT_low_pc */
  55. .4byte cu_text_end /* DW_AT_high_pc */
  56. .uleb128 4 /* Abbrev: DW_TAG_variable (location) */
  57. .ascii "var\0" /* DW_AT_name */
  58. .byte 2f - 1f /* DW_AT_location */
  59. 1: .byte 3 /* DW_OP_addr */
  60. /* See VAR1 definition why this DIE is not correct. */
  61. .4byte SYMBOL(var1) /* <addr> */
  62. 2: .4byte .Ltype_uchar-.Lcu1_begin /* DW_AT_type */
  63. .uleb128 6 /* Abbrev: DW_TAG_lexical_block */
  64. .4byte SYMBOL(extern_block_start) /* DW_AT_low_pc */
  65. .4byte SYMBOL(extern_block_end) /* DW_AT_high_pc */
  66. .uleb128 5 /* Abbrev: DW_TAG_variable (extern) */
  67. .ascii "var\0" /* DW_AT_name */
  68. .4byte .Ltype_uchar-.Lcu1_begin /* DW_AT_type */
  69. .byte 1 /* DW_AT_external */
  70. .byte 0 /* End of children of the lexical block */
  71. .byte 0 /* End of children of main */
  72. .byte 0 /* End of children of CU */
  73. .Lcu1_end:
  74. /* Abbrev table */
  75. .section .debug_abbrev
  76. .Labbrev1_begin:
  77. .uleb128 1 /* Abbrev code */
  78. .uleb128 0x11 /* DW_TAG_compile_unit */
  79. .byte 1 /* has_children */
  80. .uleb128 0x12 /* DW_AT_high_pc */
  81. .uleb128 0x1 /* DW_FORM_addr */
  82. .uleb128 0x11 /* DW_AT_low_pc */
  83. .uleb128 0x1 /* DW_FORM_addr */
  84. .uleb128 0x3 /* DW_AT_name */
  85. .uleb128 0x8 /* DW_FORM_string */
  86. .uleb128 0x25 /* DW_AT_producer */
  87. .uleb128 0x8 /* DW_FORM_string */
  88. .uleb128 0x13 /* DW_AT_language */
  89. .uleb128 0xb /* DW_FORM_data1 */
  90. .byte 0x0 /* Terminator */
  91. .byte 0x0 /* Terminator */
  92. .uleb128 2 /* Abbrev code */
  93. .uleb128 0x24 /* DW_TAG_base_type */
  94. .byte 0 /* has_children */
  95. .uleb128 0x3 /* DW_AT_name */
  96. .uleb128 0x8 /* DW_FORM_string */
  97. .uleb128 0xb /* DW_AT_byte_size */
  98. .uleb128 0xb /* DW_FORM_data1 */
  99. .uleb128 0x3e /* DW_AT_encoding */
  100. .uleb128 0xb /* DW_FORM_data1 */
  101. .byte 0x0 /* Terminator */
  102. .byte 0x0 /* Terminator */
  103. .uleb128 3 /* Abbrev code */
  104. .uleb128 0x2e /* DW_TAG_subprogram */
  105. .byte 1 /* has_children */
  106. .uleb128 0x3a /* DW_AT_decl_file */
  107. .uleb128 0xb /* DW_FORM_data1 */
  108. .uleb128 0x3b /* DW_AT_decl_line */
  109. .uleb128 0xb /* DW_FORM_data1 */
  110. .uleb128 0x3 /* DW_AT_name */
  111. .uleb128 0x8 /* DW_FORM_string */
  112. .uleb128 0x49 /* DW_AT_type */
  113. .uleb128 0x13 /* DW_FORM_ref4 */
  114. .uleb128 0x11 /* DW_AT_low_pc */
  115. .uleb128 0x1 /* DW_FORM_addr */
  116. .uleb128 0x12 /* DW_AT_high_pc */
  117. .uleb128 0x1 /* DW_FORM_addr */
  118. .byte 0x0 /* Terminator */
  119. .byte 0x0 /* Terminator */
  120. .uleb128 4 /* Abbrev code (location) */
  121. .uleb128 0x34 /* DW_TAG_variable */
  122. .byte 0 /* has_children */
  123. .uleb128 0x3 /* DW_AT_name */
  124. .uleb128 0x8 /* DW_FORM_string */
  125. .uleb128 0x2 /* DW_AT_location */
  126. .uleb128 0xa /* DW_FORM_block1 */
  127. .uleb128 0x49 /* DW_AT_type */
  128. .uleb128 0x13 /* DW_FORM_ref4 */
  129. .byte 0x0 /* Terminator */
  130. .byte 0x0 /* Terminator */
  131. .uleb128 5 /* Abbrev code (extern) */
  132. .uleb128 0x34 /* DW_TAG_variable */
  133. .byte 0 /* has_children */
  134. .uleb128 0x3 /* DW_AT_name */
  135. .uleb128 0x8 /* DW_FORM_string */
  136. .uleb128 0x49 /* DW_AT_type */
  137. .uleb128 0x13 /* DW_FORM_ref4 */
  138. .uleb128 0x3f /* DW_AT_external */
  139. .uleb128 0xc /* DW_FORM_flag */
  140. .byte 0x0 /* Terminator */
  141. .byte 0x0 /* Terminator */
  142. .uleb128 6 /* Abbrev code */
  143. .uleb128 0x0b /* DW_TAG_lexical_block */
  144. .byte 1 /* has_children */
  145. .uleb128 0x11 /* DW_AT_low_pc */
  146. .uleb128 0x1 /* DW_FORM_addr */
  147. .uleb128 0x12 /* DW_AT_high_pc */
  148. .uleb128 0x1 /* DW_FORM_addr */
  149. .byte 0x0 /* Terminator */
  150. .byte 0x0 /* Terminator */
  151. .byte 0x0 /* Terminator */
  152. .byte 0x0 /* Terminator */