gdb/doc/
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.dwarf2 / dw2-op-call.S
CommitLineData
5c631832
JK
1/* This testcase is part of GDB, the GNU debugger.
2
7b6bb8da 3 Copyright 2009, 2011 Free Software Foundation, Inc.
5c631832
JK
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/* Test DW_OP_call2 and DW_OP_call4, PR gdb/10640. */
19
20 .section .data
21array1: .2byte 1
22array2: .2byte 2
23array3: .2byte 3
24
25 .section .debug_info
26.Lcu1_begin:
27 /* CU header */
28 .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
29.Lcu1_start:
30 .2byte 2 /* DWARF Version */
31 .4byte .Labbrev1_begin /* Offset into abbrev section */
32 .byte 4 /* Pointer size */
33
34 /* CU die */
35 .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
36 .ascii "file1.txt\0" /* DW_AT_name */
37 .ascii "GNU C 3.3.3\0" /* DW_AT_producer */
38 .byte 2 /* DW_LANG_C (C) */
39
40.L2byte_type:
41 .uleb128 2 /* Abbrev: DW_TAG_base_type */
42 .ascii "2byte\0" /* DW_AT_name */
43 .byte 2 /* DW_AT_byte_size */
44 .byte 7 /* DW_AT_encoding: DW_ATE_unsigned */
45
46.Larray1:
47 .uleb128 3 /* Abbrev: DW_TAG_variable */
48 .ascii "array1\0" /* DW_AT_name */
49 .4byte .L2byte_type-.Lcu1_begin /* DW_AT_type */
50 .byte 2f - 1f /* DW_AT_location */
511: .byte 3 /* DW_OP_addr */
9a771b67 52 .4byte array1 /* <addr> */
5c631832
JK
532:
54
55 .uleb128 3 /* Abbrev: DW_TAG_variable */
56 .ascii "array2\0" /* DW_AT_name */
57 .4byte .L2byte_type-.Lcu1_begin /* DW_AT_type */
58 .byte 2f - 1f /* DW_AT_location */
591: .byte 0x98 /* DW_OP_call2 */
60 .2byte .Larray1-.Lcu1_begin /* <current CU offset> */
61 .byte 0x23 /* DW_OP_plus_uconst */
62 .uleb128 array2-array1 /* <uconst> */
632:
64
65 .uleb128 3 /* Abbrev: DW_TAG_variable */
66 .ascii "array3\0" /* DW_AT_name */
67 .4byte .L2byte_type-.Lcu1_begin /* DW_AT_type */
68 .byte 2f - 1f /* DW_AT_location */
691: .byte 0x99 /* DW_OP_call4 */
70 .4byte .Larray1-.Lcu1_begin /* <current CU offset> */
71 .byte 0x23 /* DW_OP_plus_uconst */
72 .uleb128 array3-array1 /* <uconst> */
732:
74
1d6edc3c
JK
75 .uleb128 3 /* Abbrev: DW_TAG_variable */
76 .ascii "arraycallnoloc\0" /* DW_AT_name */
77 .4byte .L2byte_type-.Lcu1_begin /* DW_AT_type */
78 .byte 2f - 1f /* DW_AT_location */
791: .byte 0x99 /* DW_OP_call4 */
80 .4byte .Larraynoloc-.Lcu1_begin /* <current CU offset> */
812:
82
83.Larraynoloc:
84 .uleb128 4 /* Abbrev: DW_TAG_variable-loclist */
85 .ascii "arraynoloc\0" /* DW_AT_name */
86 .4byte .L2byte_type-.Lcu1_begin /* DW_AT_type */
87 .4byte loclist /* DW_AT_location */
88
5c631832
JK
89 .byte 0 /* End of children of CU */
90
91.Lcu1_end:
92
1d6edc3c
JK
93/* Location list. */
94 .section .debug_loc
95loclist:
96 /* Location list end. */
97 .4byte 0, 0
98
5c631832
JK
99/* Abbrev table */
100 .section .debug_abbrev
101.Labbrev1_begin:
102 .uleb128 1 /* Abbrev code */
103 .uleb128 0x11 /* DW_TAG_compile_unit */
104 .byte 1 /* has_children */
105 .uleb128 0x3 /* DW_AT_name */
106 .uleb128 0x8 /* DW_FORM_string */
107 .uleb128 0x25 /* DW_AT_producer */
108 .uleb128 0x8 /* DW_FORM_string */
109 .uleb128 0x13 /* DW_AT_language */
110 .uleb128 0xb /* DW_FORM_data1 */
111 .byte 0x0 /* Terminator */
112 .byte 0x0 /* Terminator */
113
114 .uleb128 2 /* Abbrev code */
115 .uleb128 0x24 /* DW_TAG_base_type */
116 .byte 0 /* has_children */
117 .uleb128 0x3 /* DW_AT_name */
118 .uleb128 0x8 /* DW_FORM_string */
119 .uleb128 0xb /* DW_AT_byte_size */
120 .uleb128 0xb /* DW_FORM_data1 */
121 .uleb128 0x3e /* DW_AT_encoding */
122 .uleb128 0xb /* DW_FORM_data1 */
123 .byte 0x0 /* Terminator */
124 .byte 0x0 /* Terminator */
125
126 .uleb128 3 /* Abbrev code */
127 .uleb128 0x34 /* DW_TAG_variable */
128 .byte 0 /* has_children */
129 .uleb128 0x3 /* DW_AT_name */
130 .uleb128 0x8 /* DW_FORM_string */
131 .uleb128 0x49 /* DW_AT_type */
132 .uleb128 0x13 /* DW_FORM_ref4 */
133 .uleb128 0x2 /* DW_AT_location */
134 .uleb128 0xa /* DW_FORM_block1 */
135 .byte 0x0 /* Terminator */
136 .byte 0x0 /* Terminator */
137
1d6edc3c
JK
138 .uleb128 4 /* Abbrev code */
139 .uleb128 0x34 /* DW_TAG_variable-loclist */
140 .byte 0 /* has_children */
141 .uleb128 0x3 /* DW_AT_name */
142 .uleb128 0x8 /* DW_FORM_string */
143 .uleb128 0x49 /* DW_AT_type */
144 .uleb128 0x13 /* DW_FORM_ref4 */
145 .uleb128 0x2 /* DW_AT_location */
146 .uleb128 0x06 /* DW_FORM_data4 */
147 .byte 0x0 /* Terminator */
148 .byte 0x0 /* Terminator */
149
5c631832
JK
150 .byte 0x0 /* Terminator */
151 .byte 0x0 /* Terminator */
This page took 0.238854 seconds and 4 git commands to generate.