Move dw2-producer.* from gdb.arch to gdb.dwarf2 where it was supposed to
[external/binutils.git] / gdb / testsuite / gdb.dwarf2 / dw2-producer.S
1 /* This testcase is part of GDB, the GNU debugger.
2
3    Copyright 2004, 2007 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 2 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, write to the Free Software
17    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18    USA.  */
19
20 /* This file contains some basic DWARF info.  The only particularity about
21    this info is that this compile unit does not have a DW_AT_producer
22    attribute.  The rest is a straight copy of one of the other assembly
23    files available in this directory.
24
25    The intent of this testcase is to verify that GDB is able to handle
26    the lack of the DW_AT_producer attribute without problem.  */
27
28 /* Dummy function to provide debug information for.  */
29
30         .text
31 .Lbegin_text1:
32         .globl func_cu1
33         .type func_cu1, %function
34 func_cu1:
35 .Lbegin_func_cu1:
36         .int 0
37 .Lend_func_cu1:
38         .size func_cu1, .-func_cu1
39 .Lend_text1:
40
41 /* Debug information */
42
43         .section .debug_info
44 .Lcu1_begin:
45         /* CU header */
46         .4byte  .Lcu1_end - .Lcu1_start         /* Length of Compilation Unit */
47 .Lcu1_start:
48         .2byte  2                               /* DWARF Version */
49         .4byte  .Labbrev1_begin                 /* Offset into abbrev section */
50         .byte   4                               /* Pointer size */
51
52         /* CU die */
53         .uleb128 1                              /* Abbrev: DW_TAG_compile_unit */
54         .4byte  .Lline1_begin                   /* DW_AT_stmt_list */
55         .4byte  .Lend_text1                     /* DW_AT_high_pc */
56         .4byte  .Lbegin_text1                   /* DW_AT_low_pc */
57         .ascii  "file1.txt\0"                   /* DW_AT_name */
58         .byte   1                               /* DW_AT_language (C) */
59
60         /* func_cu1 */
61         .uleb128        2                       /* Abbrev: DW_TAG_subprogram */
62         .byte           1                       /* DW_AT_external */
63         .byte           1                       /* DW_AT_decl_file */
64         .byte           2                       /* DW_AT_decl_line */
65         .ascii          "func_cu1\0"            /* DW_AT_name */
66         .4byte          .Ltype_int-.Lcu1_begin  /* DW_AT_type */
67         .4byte          .Lbegin_func_cu1        /* DW_AT_low_pc */
68         .4byte          .Lend_func_cu1          /* DW_AT_high_pc */
69         .byte           1                       /* DW_AT_frame_base: length */
70         .byte           0x55                    /* DW_AT_frame_base: DW_OP_reg5 */
71
72 .Ltype_int:
73         .uleb128        3                       /* Abbrev: DW_TAG_base_type */
74         .ascii          "int\0"                 /* DW_AT_name */
75         .byte           4                       /* DW_AT_byte_size */
76         .byte           5                       /* DW_AT_encoding */
77
78         .byte           0                       /* End of children of CU */
79
80 .Lcu1_end:
81
82 /* Abbrev table */
83         .section .debug_abbrev
84 .Labbrev1_begin:
85         .uleb128        1                       /* Abbrev code */
86         .uleb128        0x11                    /* DW_TAG_compile_unit */
87         .byte           1                       /* has_children */
88         .uleb128        0x10                    /* DW_AT_stmt_list */
89         .uleb128        0x6                     /* DW_FORM_data4 */
90         .uleb128        0x12                    /* DW_AT_high_pc */
91         .uleb128        0x1                     /* DW_FORM_addr */
92         .uleb128        0x11                    /* DW_AT_low_pc */
93         .uleb128        0x1                     /* DW_FORM_addr */
94         .uleb128        0x3                     /* DW_AT_name */
95         .uleb128        0x8                     /* DW_FORM_string */
96         .uleb128        0x13                    /* DW_AT_language */
97         .uleb128        0xb                     /* DW_FORM_data1 */
98         .byte           0x0                     /* Terminator */
99         .byte           0x0                     /* Terminator */
100
101         .uleb128        2                       /* Abbrev code */
102         .uleb128        0x2e                    /* DW_TAG_subprogram */
103         .byte           0                       /* has_children */
104         .uleb128        0x3f                    /* DW_AT_external */
105         .uleb128        0xc                     /* DW_FORM_flag */
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         .uleb128        0x40                    /* DW_AT_frame_base */
119         .uleb128        0xa                     /* DW_FORM_block1 */
120         .byte           0x0                     /* Terminator */
121         .byte           0x0                     /* Terminator */
122
123         .uleb128        3                       /* Abbrev code */
124         .uleb128        0x24                    /* DW_TAG_base_type */
125         .byte           0                       /* has_children */
126         .uleb128        0x3                     /* DW_AT_name */
127         .uleb128        0x8                     /* DW_FORM_string */
128         .uleb128        0xb                     /* DW_AT_byte_size */
129         .uleb128        0xb                     /* DW_FORM_data1 */
130         .uleb128        0x3e                    /* DW_AT_encoding */
131         .uleb128        0xb                     /* DW_FORM_data1 */
132         .byte           0x0                     /* Terminator */
133         .byte           0x0                     /* Terminator */
134
135         .byte           0x0                     /* Terminator */
136         .byte           0x0                     /* Terminator */
137
138 /* Line table */
139         .section .debug_line
140 .Lline1_begin:
141         .4byte          .Lline1_end - .Lline1_start     /* Initial length */
142 .Lline1_start:
143         .2byte          2                       /* Version */
144         .4byte          .Lline1_lines - .Lline1_hdr     /* header_length */
145 .Lline1_hdr:
146         .byte           1                       /* Minimum insn length */
147         .byte           1                       /* default_is_stmt */
148         .byte           1                       /* line_base */
149         .byte           1                       /* line_range */
150         .byte           0x10                    /* opcode_base */
151
152         /* Standard lengths */
153         .byte           0
154         .byte           1
155         .byte           1
156         .byte           1
157         .byte           1
158         .byte           0
159         .byte           0
160         .byte           0
161         .byte           1
162         .byte           0
163         .byte           0
164         .byte           1
165         .byte           0
166         .byte           0
167         .byte           0
168
169         /* Include directories */
170         .byte           0
171
172         /* File names */
173         .ascii          "file1.txt\0"
174         .uleb128        0
175         .uleb128        0
176         .uleb128        0
177
178         .byte           0
179
180 .Lline1_lines:
181         .byte           0       /* DW_LNE_set_address */
182         .uleb128        5
183         .byte           2
184         .4byte          .Lbegin_func_cu1
185
186         .byte           3       /* DW_LNS_advance_line */
187         .sleb128        3       /* ... to 4 */
188
189         .byte           1       /* DW_LNS_copy */
190
191         .byte           1       /* DW_LNS_copy (second time as an end-of-prologue marker) */
192
193         .byte           0       /* DW_LNE_set_address */
194         .uleb128        5
195         .byte           2
196         .4byte          .Lend_func_cu1
197
198         .byte           0       /* DW_LNE_end_of_sequence */
199         .uleb128        1
200         .byte           1
201
202 .Lline1_end: