]>
git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/function-prologue-stepping-no-stack-check.rs
1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // ignore-android: FIXME(#10381)
12 // min-lldb-version: 310
14 // This test case checks if function arguments already have the correct value
15 // when breaking at the beginning of a function. Functions with the
16 // #[no_stack_check] attribute have the same prologue as regular C functions
17 // compiled with GCC or Clang and therefore are better handled by GDB. As a
18 // consequence, and as opposed to regular Rust functions, we can set the
19 // breakpoints via the function name (and don't have to fall back on using line
20 // numbers). For LLDB this shouldn't make a difference because it can handle
25 // === GDB TESTS ===================================================================================
27 // gdb-command:rbreak immediate_args
28 // gdb-command:rbreak binding
29 // gdb-command:rbreak assignment
30 // gdb-command:rbreak function_call
31 // gdb-command:rbreak identifier
32 // gdb-command:rbreak return_expr
33 // gdb-command:rbreak arithmetic_expr
34 // gdb-command:rbreak if_expr
35 // gdb-command:rbreak while_expr
36 // gdb-command:rbreak loop_expr
40 // gdb-command:print a
42 // gdb-command:print b
43 // gdb-check:$2 = true
44 // gdb-command:print c
46 // gdb-command:continue
49 // gdb-command:print a
50 // gdb-check:$4 = {a = 3, b = 4, c = 5, d = 6, e = 7, f = 8, g = 9, h = 10}
51 // gdb-command:print b
52 // gdb-check:$5 = {a = 11, b = 12, c = 13, d = 14, e = 15, f = 16, g = 17, h = 18}
53 // gdb-command:continue
56 // gdb-command:print a
58 // gdb-command:print b
60 // gdb-command:print c
61 // gdb-check:$8 = 21.5
62 // gdb-command:continue
65 // gdb-command:print a
67 // gdb-command:print b
69 // gdb-command:print c
70 // gdb-check:$11 = 24.5
71 // gdb-command:continue
74 // gdb-command:print x
76 // gdb-command:print y
78 // gdb-command:print z
79 // gdb-check:$14 = 27.5
80 // gdb-command:continue
83 // gdb-command:print x
85 // gdb-command:print y
87 // gdb-command:print z
88 // gdb-check:$17 = 30.5
89 // gdb-command:continue
92 // gdb-command:print x
94 // gdb-command:print y
96 // gdb-command:print z
97 // gdb-check:$20 = 33.5
98 // gdb-command:continue
101 // gdb-command:print x
102 // gdb-check:$21 = 34
103 // gdb-command:print y
104 // gdb-check:$22 = 35
105 // gdb-command:print z
106 // gdb-check:$23 = 36.5
107 // gdb-command:continue
110 // gdb-command:print x
111 // gdb-check:$24 = 37
112 // gdb-command:print y
113 // gdb-check:$25 = 38
114 // gdb-command:print z
115 // gdb-check:$26 = 39.5
116 // gdb-command:continue
119 // gdb-command:print x
120 // gdb-check:$27 = 40
121 // gdb-command:print y
122 // gdb-check:$28 = 41
123 // gdb-command:print z
124 // gdb-check:$29 = 42
125 // gdb-command:continue
128 // gdb-command:print x
129 // gdb-check:$30 = 43
130 // gdb-command:print y
131 // gdb-check:$31 = 44
132 // gdb-command:print z
133 // gdb-check:$32 = 45
134 // gdb-command:continue
137 // === LLDB TESTS ==================================================================================
139 // lldb-command:breakpoint set --name immediate_args
140 // lldb-command:breakpoint set --name non_immediate_args
141 // lldb-command:breakpoint set --name binding
142 // lldb-command:breakpoint set --name assignment
143 // lldb-command:breakpoint set --name function_call
144 // lldb-command:breakpoint set --name identifier
145 // lldb-command:breakpoint set --name return_expr
146 // lldb-command:breakpoint set --name arithmetic_expr
147 // lldb-command:breakpoint set --name if_expr
148 // lldb-command:breakpoint set --name while_expr
149 // lldb-command:breakpoint set --name loop_expr
153 // lldb-command:print a
154 // lldb-check:[...]$0 = 1
155 // lldb-command:print b
156 // lldb-check:[...]$1 = true
157 // lldb-command:print c
158 // lldb-check:[...]$2 = 2.5
159 // lldb-command:continue
161 // NON IMMEDIATE ARGS
162 // lldb-command:print a
163 // lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 }
164 // lldb-command:print b
165 // lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 }
166 // lldb-command:continue
169 // lldb-command:print a
170 // lldb-check:[...]$5 = 19
171 // lldb-command:print b
172 // lldb-check:[...]$6 = 20
173 // lldb-command:print c
174 // lldb-check:[...]$7 = 21.5
175 // lldb-command:continue
178 // lldb-command:print a
179 // lldb-check:[...]$8 = 22
180 // lldb-command:print b
181 // lldb-check:[...]$9 = 23
182 // lldb-command:print c
183 // lldb-check:[...]$10 = 24.5
184 // lldb-command:continue
187 // lldb-command:print x
188 // lldb-check:[...]$11 = 25
189 // lldb-command:print y
190 // lldb-check:[...]$12 = 26
191 // lldb-command:print z
192 // lldb-check:[...]$13 = 27.5
193 // lldb-command:continue
196 // lldb-command:print x
197 // lldb-check:[...]$14 = 28
198 // lldb-command:print y
199 // lldb-check:[...]$15 = 29
200 // lldb-command:print z
201 // lldb-check:[...]$16 = 30.5
202 // lldb-command:continue
205 // lldb-command:print x
206 // lldb-check:[...]$17 = 31
207 // lldb-command:print y
208 // lldb-check:[...]$18 = 32
209 // lldb-command:print z
210 // lldb-check:[...]$19 = 33.5
211 // lldb-command:continue
214 // lldb-command:print x
215 // lldb-check:[...]$20 = 34
216 // lldb-command:print y
217 // lldb-check:[...]$21 = 35
218 // lldb-command:print z
219 // lldb-check:[...]$22 = 36.5
220 // lldb-command:continue
223 // lldb-command:print x
224 // lldb-check:[...]$23 = 37
225 // lldb-command:print y
226 // lldb-check:[...]$24 = 38
227 // lldb-command:print z
228 // lldb-check:[...]$25 = 39.5
229 // lldb-command:continue
232 // lldb-command:print x
233 // lldb-check:[...]$26 = 40
234 // lldb-command:print y
235 // lldb-check:[...]$27 = 41
236 // lldb-command:print z
237 // lldb-check:[...]$28 = 42
238 // lldb-command:continue
241 // lldb-command:print x
242 // lldb-check:[...]$29 = 43
243 // lldb-command:print y
244 // lldb-check:[...]$30 = 44
245 // lldb-command:print z
246 // lldb-check:[...]$31 = 45
247 // lldb-command:continue
249 #![allow(dead_code, unused_assignments, unused_variables)]
250 #![omit_gdb_pretty_printer_section]
253 fn immediate_args(a
: isize, b
: bool
, c
: f64) {
269 fn non_immediate_args(a
: BigStruct
, b
: BigStruct
) {
274 fn binding(a
: i64, b
: u64, c
: f64) {
280 fn assignment(mut a
: u64, b
: u64, c
: f64) {
286 fn function_call(x
: u64, y
: u64, z
: f64) {
291 fn identifier(x
: u64, y
: u64, z
: f64) -> u64 {
296 fn return_expr(x
: u64, y
: u64, z
: f64) -> u64 {
301 fn arithmetic_expr(x
: u64, y
: u64, z
: f64) -> u64 {
306 fn if_expr(x
: u64, y
: u64, z
: f64) -> u64 {
315 fn while_expr(mut x
: u64, y
: u64, z
: u64) -> u64 {
323 fn loop_expr(mut x
: u64, y
: u64, z
: u64) -> u64 {
334 immediate_args(1, true, 2.5);
359 binding(19, 20, 21.5);
360 assignment(22, 23, 24.5);
361 function_call(25, 26, 27.5);
362 identifier(28, 29, 30.5);
363 return_expr(31, 32, 33.5);
364 arithmetic_expr(34, 35, 36.5);
365 if_expr(37, 38, 39.5);
366 while_expr(40, 41, 42);
367 loop_expr(43, 44, 45);