gdb/
[external/binutils.git] / gdb / testsuite / gdb.dwarf2 / implptr-64bit.S
1 /* Copyright 2010, 2011 Free Software Foundation, Inc.
2
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
8    This program is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11    GNU General Public License for more details.
12
13    You should have received a copy of the GNU General Public License
14    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
15
16         .section        .debug_info
17 d:
18         /* Length of Compilation Unit Info */
19 #if OFFSET_SIZE == 4
20 # define OFFSET .4byte
21         .4byte  debug_end - 1f
22 #elif OFFSET_SIZE == 8
23 # define OFFSET .8byte
24         .4byte  0xffffffff
25         .8byte  debug_end - 1f
26 #else
27 # error
28 #endif
29 #if ADDR_SIZE == 4
30 # define ADDR .4byte
31 #elif ADDR_SIZE == 8
32 # define ADDR .8byte
33 #else
34 # error
35 #endif
36 #if REF_ADDR_SIZE == 4
37 # define REF_ADDR .4byte
38 #elif REF_ADDR_SIZE == 8
39 # define REF_ADDR .8byte
40 #else
41 # error
42 #endif
43 1:
44         .2byte  DWARF_VERSION   /* DWARF version number */
45         OFFSET  .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
46         .byte   ADDR_SIZE       /* Pointer Size (in bytes) */
47
48         .uleb128 0x1    /* (DIE (0xb) DW_TAG_compile_unit) */
49         .ascii "GNU C 4.4.3\0"  /* DW_AT_producer */
50         .byte   0x1     /* DW_AT_language */
51         .ascii "1.c\0"  /* DW_AT_name */
52
53 .Ltype_int:
54         .uleb128 0x7    /* DW_TAG_base_type */
55         .byte   0x4     /* DW_AT_byte_size */
56         .byte   0x5     /* DW_AT_encoding */
57         .ascii "int\0"  /* DW_AT_name */
58
59 .Ltype_struct:
60         .uleb128 0x2    /* DW_TAG_structure_type */
61         .ascii "s\0"    /* DW_AT_name */
62         .byte   4       /* DW_AT_byte_size */
63
64         .uleb128 0x3    /* DW_TAG_member */
65         .ascii "f\0"    /* DW_AT_name */
66         .4byte  .Ltype_int - d  /* DW_AT_type */
67         .byte   0       /* DW_AT_data_member_location */
68
69         .byte   0x0     /* end of children of DW_TAG_structure_type */
70
71         .uleb128        6                       /* Abbrev: DW_TAG_subprogram */
72         .ascii          "main\0"                /* DW_AT_name */
73         ADDR            main                    /* DW_AT_low_pc */
74         ADDR            main + 0x100            /* DW_AT_high_pc */
75         .4byte          .Ltype_int - d          /* DW_AT_type */
76         .byte           1                       /* DW_AT_external */
77
78 .Ltype_structptr:
79         .uleb128 0x5    /* DW_TAG_pointer_type */
80         .byte   ADDR_SIZE       /* DW_AT_byte_size */
81         .4byte  .Ltype_struct - d       /* DW_AT_type */
82
83 .Lvar_out:
84         .uleb128 0x4    /* (DW_TAG_variable) */
85         .ascii "v\0"    /* DW_AT_name */
86         .byte   2f - 1f /* DW_AT_location: DW_FORM_block1 */
87 1:
88         .byte   0x9e    /* DW_OP_implicit_value */
89         .uleb128  2f - 3f
90 3:
91         .byte   1, 1, 1, 1
92 2:
93         .4byte  .Ltype_struct - d       /* DW_AT_type */
94
95         .uleb128 0x4    /* (DW_TAG_variable) */
96         .ascii "p\0"    /* DW_AT_name */
97         .byte   2f - 1f /* DW_AT_location: DW_FORM_block1 */
98 1:
99         .byte   0xf2    /* DW_OP_GNU_implicit_pointer */
100         REF_ADDR        .Lvar_out - d   /* referenced DIE */
101         .sleb128        0       /* offset */
102 2:
103         .4byte  .Ltype_structptr - d    /* DW_AT_type */
104
105         .byte   0x0     /* end of children of main */
106
107         .byte   0x0     /* end of children of CU */
108 debug_end:
109
110         .section        .debug_abbrev
111 .Ldebug_abbrev0:
112
113         .uleb128 0x1    /* (abbrev code) */
114         .uleb128 0x11   /* (TAG: DW_TAG_compile_unit) */
115         .byte   0x1     /* DW_children_yes */
116         .uleb128 0x25   /* (DW_AT_producer) */
117         .uleb128 0x8    /* (DW_FORM_string) */
118         .uleb128 0x13   /* (DW_AT_language) */
119         .uleb128 0xb    /* (DW_FORM_data1) */
120         .uleb128 0x3    /* (DW_AT_name) */
121         .uleb128 0x8    /* (DW_FORM_string) */
122         .byte   0x0
123         .byte   0x0
124
125         .uleb128 0x2    /* (abbrev code) */
126         .uleb128 0x13   /* (TAG: DW_TAG_structure_type) */
127         .byte   0x1     /* DW_children_yes */
128         .uleb128 0x3    /* (DW_AT_name) */
129         .uleb128 0x8    /* (DW_FORM_string) */
130         .uleb128 0xb    /* (DW_AT_byte_size) */
131         .uleb128 0xb    /* (DW_FORM_data1) */
132         .byte   0
133         .byte   0
134
135         .uleb128 0x3    /* (abbrev code) */
136         .uleb128 0xd    /* (TAG: DW_TAG_member) */
137         .byte   0       /* DW_children_no */
138         .uleb128 0x3    /* (DW_AT_name) */
139         .uleb128 0x8    /* (DW_FORM_string) */
140         .uleb128 0x49   /* (DW_AT_type) */
141         .uleb128 0x13   /* (DW_FORM_ref4) */
142         .uleb128 0x38   /* (DW_AT_data_member_location) */
143         .uleb128 0xb    /* (DW_FORM_data1) */
144         .byte   0
145         .byte   0
146
147         .uleb128 0x4    /* (abbrev code) */
148         .uleb128 0x34   /* (TAG: DW_TAG_variable) */
149         .byte   0x0     /* DW_children_yes */
150         .uleb128 0x3    /* (DW_AT_name) */
151         .uleb128 0x8    /* (DW_FORM_string) */
152         .uleb128 0x02   /* (DW_AT_location) */
153         .uleb128 0xa    /* (DW_FORM_block1) */
154         .uleb128 0x49   /* (DW_AT_type) */
155         .uleb128 0x13   /* (DW_FORM_ref4) */
156         .byte   0x0
157         .byte   0x0
158
159         .uleb128 0x5    /* (abbrev code) */
160         .uleb128 0xf    /* (TAG: DW_TAG_pointer_type) */
161         .byte   0x0     /* DW_children_no */
162         .uleb128 0xb    /* (DW_AT_byte_size) */
163         .uleb128 0xb    /* (DW_FORM_data1) */
164         .uleb128 0x49   /* (DW_AT_type) */
165         .uleb128 0x13   /* (DW_FORM_ref4) */
166         .byte   0x0
167         .byte   0x0
168
169         .uleb128        6                       /* Abbrev code */
170         .uleb128        0x2e                    /* DW_TAG_subprogram */
171         .byte           1                       /* has_children */
172         .uleb128        0x3                     /* DW_AT_name */
173         .uleb128        0x8                     /* DW_FORM_string */
174         .uleb128        0x11                    /* DW_AT_low_pc */
175         .uleb128        0x1                     /* DW_FORM_addr */
176         .uleb128        0x12                    /* DW_AT_high_pc */
177         .uleb128        0x1                     /* DW_FORM_addr */
178         .uleb128        0x49                    /* DW_AT_type */
179         .uleb128        0x13                    /* DW_FORM_ref4 */
180         .uleb128        0x3f                    /* DW_AT_external */
181         .uleb128        0xc                     /* DW_FORM_flag */
182         .byte           0x0                     /* Terminator */
183         .byte           0x0                     /* Terminator */
184
185         .uleb128 0x7    /* (abbrev code) */
186         .uleb128 0x24   /* (TAG: DW_TAG_base_type) */
187         .byte   0       /* DW_children_no */
188         .uleb128 0xb    /* (DW_AT_byte_size) */
189         .uleb128 0xb    /* (DW_FORM_data1) */
190         .uleb128 0x3e   /* (DW_AT_encoding) */
191         .uleb128 0xb    /* (DW_FORM_data1) */
192         .uleb128 0x3    /* (DW_AT_name) */
193         .uleb128 0x8    /* (DW_FORM_string) */
194         .byte   0
195         .byte   0
196
197         .byte   0x0