dw2-op-call.S revision 1.1.1.8 1 1.1 christos /* This testcase is part of GDB, the GNU debugger.
2 1.1 christos
3 1.1.1.8 christos Copyright 2009-2024 Free Software Foundation, Inc.
4 1.1 christos
5 1.1 christos This program is free software; you can redistribute it and/or modify
6 1.1 christos it under the terms of the GNU General Public License as published by
7 1.1 christos the Free Software Foundation; either version 3 of the License, or
8 1.1 christos (at your option) any later version.
9 1.1 christos
10 1.1 christos This program is distributed in the hope that it will be useful,
11 1.1 christos but WITHOUT ANY WARRANTY; without even the implied warranty of
12 1.1 christos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 1.1 christos GNU General Public License for more details.
14 1.1 christos
15 1.1 christos You should have received a copy of the GNU General Public License
16 1.1 christos along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 1.1 christos
18 1.1 christos /* Test DW_OP_call2 and DW_OP_call4, PR gdb/10640. */
19 1.1 christos
20 1.1 christos .section .data
21 1.1 christos array1: .2byte 1
22 1.1 christos array2: .2byte 2
23 1.1 christos array3: .2byte 3
24 1.1 christos
25 1.1 christos .section .debug_info
26 1.1 christos .Lcu0_begin:
27 1.1 christos /* CU header */
28 1.1 christos .4byte .Lcu0_end - .Lcu0_start /* Length of Compilation Unit */
29 1.1 christos .Lcu0_start:
30 1.1 christos .2byte 2 /* DWARF Version */
31 1.1 christos .4byte .Labbrev1_begin /* Offset into abbrev section */
32 1.1 christos .byte 4 /* Pointer size */
33 1.1 christos
34 1.1 christos /* CU die */
35 1.1 christos .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
36 1.1 christos .ascii "file0.txt\0" /* DW_AT_name */
37 1.1 christos .ascii "GNU C 3.3.3\0" /* DW_AT_producer */
38 1.1 christos .byte 2 /* DW_LANG_C (C) */
39 1.1 christos
40 1.1 christos .byte 0 /* End of children of CU */
41 1.1 christos .Lcu0_end:
42 1.1 christos
43 1.1 christos .Lcu1_begin:
44 1.1 christos /* CU header */
45 1.1 christos .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
46 1.1 christos .Lcu1_start:
47 1.1 christos .2byte 2 /* DWARF Version */
48 1.1 christos .4byte .Labbrev1_begin /* Offset into abbrev section */
49 1.1 christos .byte 4 /* Pointer size */
50 1.1 christos
51 1.1 christos /* CU die */
52 1.1 christos .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
53 1.1 christos .ascii "file1.txt\0" /* DW_AT_name */
54 1.1 christos .ascii "GNU C 3.3.3\0" /* DW_AT_producer */
55 1.1 christos .byte 2 /* DW_LANG_C (C) */
56 1.1 christos
57 1.1 christos .L2byte_type:
58 1.1 christos .uleb128 2 /* Abbrev: DW_TAG_base_type */
59 1.1 christos .ascii "2byte\0" /* DW_AT_name */
60 1.1 christos .byte 2 /* DW_AT_byte_size */
61 1.1 christos .byte 7 /* DW_AT_encoding: DW_ATE_unsigned */
62 1.1 christos
63 1.1 christos .Larray1:
64 1.1 christos .uleb128 3 /* Abbrev: DW_TAG_variable */
65 1.1 christos .ascii "array1\0" /* DW_AT_name */
66 1.1 christos .4byte .L2byte_type-.Lcu1_begin /* DW_AT_type */
67 1.1 christos .byte 2f - 1f /* DW_AT_location */
68 1.1 christos 1: .byte 3 /* DW_OP_addr */
69 1.1 christos .4byte array1 /* <addr> */
70 1.1 christos 2:
71 1.1 christos
72 1.1 christos .uleb128 3 /* Abbrev: DW_TAG_variable */
73 1.1 christos .ascii "array2\0" /* DW_AT_name */
74 1.1 christos .4byte .L2byte_type-.Lcu1_begin /* DW_AT_type */
75 1.1 christos .byte 2f - 1f /* DW_AT_location */
76 1.1 christos 1: .byte 0x98 /* DW_OP_call2 */
77 1.1 christos .2byte .Larray1-.Lcu1_begin /* <current CU offset> */
78 1.1 christos .byte 0x23 /* DW_OP_plus_uconst */
79 1.1 christos .uleb128 array2-array1 /* <uconst> */
80 1.1 christos 2:
81 1.1 christos
82 1.1 christos .uleb128 3 /* Abbrev: DW_TAG_variable */
83 1.1 christos .ascii "array3\0" /* DW_AT_name */
84 1.1 christos .4byte .L2byte_type-.Lcu1_begin /* DW_AT_type */
85 1.1 christos .byte 2f - 1f /* DW_AT_location */
86 1.1 christos 1: .byte 0x99 /* DW_OP_call4 */
87 1.1 christos .4byte .Larray1-.Lcu1_begin /* <current CU offset> */
88 1.1 christos .byte 0x23 /* DW_OP_plus_uconst */
89 1.1 christos .uleb128 array3-array1 /* <uconst> */
90 1.1 christos 2:
91 1.1 christos
92 1.1 christos .uleb128 3 /* Abbrev: DW_TAG_variable */
93 1.1 christos .ascii "arraycallnoloc\0" /* DW_AT_name */
94 1.1 christos .4byte .L2byte_type-.Lcu1_begin /* DW_AT_type */
95 1.1 christos .byte 2f - 1f /* DW_AT_location */
96 1.1 christos 1: .byte 0x99 /* DW_OP_call4 */
97 1.1 christos .4byte .Larraynoloc-.Lcu1_begin /* <current CU offset> */
98 1.1 christos 2:
99 1.1 christos
100 1.1 christos .Larraynoloc:
101 1.1 christos .uleb128 4 /* Abbrev: DW_TAG_variable-loclist */
102 1.1 christos .ascii "arraynoloc\0" /* DW_AT_name */
103 1.1 christos .4byte .L2byte_type-.Lcu1_begin /* DW_AT_type */
104 1.1 christos .4byte loclist /* DW_AT_location */
105 1.1 christos
106 1.1 christos .byte 0 /* End of children of CU */
107 1.1 christos
108 1.1 christos .Lcu1_end:
109 1.1 christos
110 1.1 christos /* Location list. */
111 1.1 christos .section .debug_loc
112 1.1 christos loclist:
113 1.1 christos /* Location list end. */
114 1.1 christos .4byte 0, 0
115 1.1 christos
116 1.1 christos /* Abbrev table */
117 1.1 christos .section .debug_abbrev
118 1.1 christos .Labbrev1_begin:
119 1.1 christos .uleb128 1 /* Abbrev code */
120 1.1 christos .uleb128 0x11 /* DW_TAG_compile_unit */
121 1.1 christos .byte 1 /* has_children */
122 1.1 christos .uleb128 0x3 /* DW_AT_name */
123 1.1 christos .uleb128 0x8 /* DW_FORM_string */
124 1.1 christos .uleb128 0x25 /* DW_AT_producer */
125 1.1 christos .uleb128 0x8 /* DW_FORM_string */
126 1.1 christos .uleb128 0x13 /* DW_AT_language */
127 1.1 christos .uleb128 0xb /* DW_FORM_data1 */
128 1.1 christos .byte 0x0 /* Terminator */
129 1.1 christos .byte 0x0 /* Terminator */
130 1.1 christos
131 1.1 christos .uleb128 2 /* Abbrev code */
132 1.1 christos .uleb128 0x24 /* DW_TAG_base_type */
133 1.1 christos .byte 0 /* has_children */
134 1.1 christos .uleb128 0x3 /* DW_AT_name */
135 1.1 christos .uleb128 0x8 /* DW_FORM_string */
136 1.1 christos .uleb128 0xb /* DW_AT_byte_size */
137 1.1 christos .uleb128 0xb /* DW_FORM_data1 */
138 1.1 christos .uleb128 0x3e /* DW_AT_encoding */
139 1.1 christos .uleb128 0xb /* DW_FORM_data1 */
140 1.1 christos .byte 0x0 /* Terminator */
141 1.1 christos .byte 0x0 /* Terminator */
142 1.1 christos
143 1.1 christos .uleb128 3 /* Abbrev code */
144 1.1 christos .uleb128 0x34 /* DW_TAG_variable */
145 1.1 christos .byte 0 /* has_children */
146 1.1 christos .uleb128 0x3 /* DW_AT_name */
147 1.1 christos .uleb128 0x8 /* DW_FORM_string */
148 1.1 christos .uleb128 0x49 /* DW_AT_type */
149 1.1 christos .uleb128 0x13 /* DW_FORM_ref4 */
150 1.1 christos .uleb128 0x2 /* DW_AT_location */
151 1.1 christos .uleb128 0xa /* DW_FORM_block1 */
152 1.1 christos .byte 0x0 /* Terminator */
153 1.1 christos .byte 0x0 /* Terminator */
154 1.1 christos
155 1.1 christos .uleb128 4 /* Abbrev code */
156 1.1 christos .uleb128 0x34 /* DW_TAG_variable-loclist */
157 1.1 christos .byte 0 /* has_children */
158 1.1 christos .uleb128 0x3 /* DW_AT_name */
159 1.1 christos .uleb128 0x8 /* DW_FORM_string */
160 1.1 christos .uleb128 0x49 /* DW_AT_type */
161 1.1 christos .uleb128 0x13 /* DW_FORM_ref4 */
162 1.1 christos .uleb128 0x2 /* DW_AT_location */
163 1.1 christos .uleb128 0x06 /* DW_FORM_data4 */
164 1.1 christos .byte 0x0 /* Terminator */
165 1.1 christos .byte 0x0 /* Terminator */
166 1.1 christos
167 1.1 christos .byte 0x0 /* Terminator */
168 1.1 christos .byte 0x0 /* Terminator */
169 1.1.1.8 christos #ifdef __arm__
170 1.1.1.8 christos .section .note.GNU-stack,"",%progbits
171 1.1.1.8 christos #else
172 1.1.1.7 christos .section .note.GNU-stack,"",@progbits
173 1.1.1.8 christos #endif
174