dw2-cu-size.S 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* This testcase is part of GDB, the GNU debugger.
  2. Copyright 2008-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 inter-cu reference support where the referenced DIE is within
  14. initial_length_size bytes of the end of the CU, but GDB doesn't take
  15. into account initial_length_size.
  16. GDB still gets the correct answer because it goes looking for the
  17. correct CU, but the search is unnecessary. */
  18. /* Debug information */
  19. .section .debug_info
  20. .Lcu1_begin:
  21. /* CU header */
  22. .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
  23. .Lcu1_start:
  24. .2byte 2 /* DWARF Version */
  25. .4byte .Labbrev1_begin /* Offset into abbrev section */
  26. .byte 4 /* Pointer size */
  27. /* CU die */
  28. .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
  29. .ascii "file1.txt\0" /* DW_AT_name */
  30. .ascii "GNU C 3.3.3\0" /* DW_AT_producer */
  31. .byte 1 /* DW_AT_language (C) */
  32. .uleb128 2 /* Abbrev: DW_TAG_variable */
  33. .ascii "noloc\0" /* DW_AT_name */
  34. .4byte .Ltype_const_int-.Lcu1_begin /* DW_AT_type */
  35. .byte 1 /* DW_AT_external */
  36. .Ltype_int:
  37. .uleb128 3 /* Abbrev: DW_TAG_base_type */
  38. .ascii "int\0" /* DW_AT_name */
  39. .byte 4 /* DW_AT_byte_size */
  40. .byte 5 /* DW_AT_encoding */
  41. .Ltype_const_int:
  42. .uleb128 4 /* Abbrev: DW_TAG_const_type */
  43. .uleb128 .Ltype_int - .Lcu1_begin /* DW_AT_type */
  44. .byte 0 /* End of children of CU */
  45. .Lcu1_end:
  46. /* Abbrev table */
  47. .section .debug_abbrev
  48. .Labbrev1_begin:
  49. .uleb128 1 /* Abbrev code */
  50. .uleb128 0x11 /* DW_TAG_compile_unit */
  51. .byte 1 /* has_children */
  52. .uleb128 0x3 /* DW_AT_name */
  53. .uleb128 0x8 /* DW_FORM_string */
  54. .uleb128 0x25 /* DW_AT_producer */
  55. .uleb128 0x8 /* DW_FORM_string */
  56. .uleb128 0x13 /* DW_AT_language */
  57. .uleb128 0xb /* DW_FORM_data1 */
  58. .byte 0x0 /* Terminator */
  59. .byte 0x0 /* Terminator */
  60. .uleb128 2 /* Abbrev code */
  61. .uleb128 0x34 /* DW_TAG_variable */
  62. .byte 0 /* has_children */
  63. .uleb128 0x3 /* DW_AT_name */
  64. .uleb128 0x8 /* DW_FORM_string */
  65. .uleb128 0x49 /* DW_AT_type */
  66. .uleb128 0x13 /* DW_FORM_ref4 */
  67. .uleb128 0x3f /* DW_AT_external */
  68. .uleb128 0xc /* DW_FORM_flag */
  69. .byte 0x0 /* Terminator */
  70. .byte 0x0 /* Terminator */
  71. .uleb128 3 /* Abbrev code */
  72. .uleb128 0x24 /* DW_TAG_base_type */
  73. .byte 0 /* has_children */
  74. .uleb128 0x3 /* DW_AT_name */
  75. .uleb128 0x8 /* DW_FORM_string */
  76. .uleb128 0xb /* DW_AT_byte_size */
  77. .uleb128 0xb /* DW_FORM_data1 */
  78. .uleb128 0x3e /* DW_AT_encoding */
  79. .uleb128 0xb /* DW_FORM_data1 */
  80. .byte 0x0 /* Terminator */
  81. .byte 0x0 /* Terminator */
  82. .uleb128 4 /* Abbrev code */
  83. .uleb128 0x26 /* DW_TAG_const_type */
  84. .byte 0 /* has_children */
  85. .uleb128 0x49 /* DW_AT_type */
  86. .uleb128 0x15 /* DW_FORM_ref_udata */
  87. .byte 0x0 /* Terminator */
  88. .byte 0x0 /* Terminator */
  89. .byte 0x0 /* Terminator .debug_abbrev
  90. section. */