gdb
[binutils-gdb.git] / gdb / testsuite / gdb.dwarf2 / dw2-strp.S
1 /* This testcase is part of GDB, the GNU debugger.
2
3 Copyright 2008, 2009 Free Software Foundation, Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17
18 /* Debug information */
19
20 .section .debug_info
21 .Lcu1_begin:
22 .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
23 .Lcu1_start:
24 .2byte 2 /* DWARF version number */
25 .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
26 .byte 4 /* Pointer Size (in bytes) */
27
28 /* CU die */
29 .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
30 .4byte .Lproducer /* DW_AT_producer */
31 /* Use C++ to exploit a bug in parsing DW_AT_name "". */
32 .byte 4 /* DW_AT_language (C++) - */
33
34 .Larray_type:
35 .uleb128 2 /* Abbrev: DW_TAG_array_type */
36 .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */
37
38 .uleb128 3 /* Abbrev: DW_TAG_subrange_type */
39 .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */
40 .byte 0xd /* DW_AT_upper_bound */
41 .byte 0 /* End of children of die */
42
43 .Luint_type:
44 .uleb128 4 /* Abbrev: DW_TAG_base_type */
45 .4byte .Luint_str /* DW_AT_name */
46 .byte 4 /* DW_AT_byte_size */
47 .byte 7 /* DW_AT_encoding */
48
49 .Lchar_type:
50 .uleb128 4 /* Abbrev: DW_TAG_base_type */
51 .4byte .Lchar_str /* DW_AT_name */
52 .byte 1 /* DW_AT_byte_size */
53 .byte 6 /* DW_AT_encoding */
54
55 .uleb128 5 /* Abbrev: DW_TAG_variable */
56 .4byte .Lvarname /* DW_AT_name */
57 .4byte .Lconst_type-.Lcu1_begin/* DW_AT_type */
58 .4byte .Lvarcontents /* DW_AT_const_value */
59 .byte 1 /* DW_AT_external */
60
61 .Lconst_type:
62 .uleb128 6 /* Abbrev: DW_TAG_const_type */
63 .4byte .Larray_type-.Lcu1_begin/* DW_AT_type */
64
65 .uleb128 7 /* Abbrev: DW_TAG_variable (name "") */
66 .4byte .Lemptyname /* DW_AT_name */
67
68 .byte 0 /* End of children of CU */
69 .Lcu1_end:
70
71 .section .debug_abbrev
72 .Ldebug_abbrev0:
73 .uleb128 1 /* Abbrev code */
74 .uleb128 0x11 /* DW_TAG_compile_unit */
75 .byte 0x1 /* has_children */
76 .uleb128 0x25 /* DW_AT_producer */
77 .uleb128 0xe /* DW_FORM_strp */
78 .uleb128 0x13 /* DW_AT_language */
79 .uleb128 0xb /* DW_FORM_data1 */
80 .byte 0x0 /* Terminator */
81 .byte 0x0 /* Terminator */
82
83 .uleb128 2 /* Abbrev code */
84 .uleb128 0x1 /* TAG: DW_TAG_array_type */
85 .byte 0x1 /* DW_children_yes */
86 .uleb128 0x49 /* DW_AT_type */
87 .uleb128 0x13 /* DW_FORM_ref4 */
88 .byte 0x0 /* Terminator */
89 .byte 0x0 /* Terminator */
90
91 .uleb128 3 /* Abbrev code */
92 .uleb128 0x21 /* DW_TAG_subrange_type */
93 .byte 0x0 /* no children */
94 .uleb128 0x49 /* DW_AT_type */
95 .uleb128 0x13 /* DW_FORM_ref4 */
96 .uleb128 0x2f /* DW_AT_upper_bound */
97 .uleb128 0xb /* DW_FORM_data1 */
98 .byte 0x0 /* Terminator */
99 .byte 0x0 /* Terminator */
100
101 .uleb128 4 /* Abbrev code */
102 .uleb128 0x24 /* DW_TAG_base_type */
103 .byte 0x0 /* no_children */
104 .uleb128 0x3 /* DW_AT_name */
105 .uleb128 0xe /* DW_FORM_strp */
106 .uleb128 0xb /* DW_AT_byte_size */
107 .uleb128 0xb /* DW_FORM_data1 */
108 .uleb128 0x3e /* DW_AT_encoding */
109 .uleb128 0xb /* DW_FORM_data1 */
110 .byte 0x0 /* Terminator */
111 .byte 0x0 /* Terminator */
112
113 .uleb128 5 /* Abbrev code */
114 .uleb128 0x34 /* DW_TAG_variable */
115 .byte 0x0 /* no_children */
116 .uleb128 0x3 /* DW_AT_name */
117 .uleb128 0xe /* DW_FORM_strp */
118 .uleb128 0x49 /* DW_AT_type */
119 .uleb128 0x13 /* DW_FORM_ref4 */
120 .uleb128 0x1c /* DW_AT_const_value */
121 .uleb128 0xe /* DW_FORM_strp */
122 .uleb128 0x3f /* DW_AT_external */
123 .uleb128 0xc /* DW_FORM_flag */
124 .byte 0x0 /* Terminator */
125 .byte 0x0 /* Terminator */
126
127 .uleb128 6 /* Abbrev code */
128 .uleb128 0x26 /* DW_TAG_const_type */
129 .byte 0x0 /* DW_children_no */
130 .uleb128 0x49 /* DW_AT_type */
131 .uleb128 0x13 /* DW_FORM_ref4 */
132 .byte 0x0 /* Terminator */
133 .byte 0x0 /* Terminator */
134
135 .uleb128 7 /* Abbrev code */
136 .uleb128 0x34 /* DW_TAG_variable */
137 .byte 0x0 /* DW_children_no */
138 .uleb128 0x3 /* DW_AT_name */
139 .uleb128 0xe /* DW_FORM_strp */
140 .byte 0x0 /* Terminator */
141 .byte 0x0 /* Terminator */
142
143 .byte 0x0 /* Terminator */
144
145 /* String table */
146 .section .debug_str
147 .Lproducer:
148 .string "GNU C 3.3.3"
149 .Lchar_str:
150 .string "char"
151 .Luint_str:
152 .string "unsigned int"
153 .Lvarname:
154 .string "a_string"
155 .Lvarcontents:
156 .string "hello world!\n"
157 .Lemptyname:
158 .string ""