1 // Copyright 2013 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 // xfail-android: FIXME(#10381)
13 // This test case checks if function arguments already have the correct value when breaking at the
14 // beginning of a function. Functions with the #[no_split_stack] attribute have the same prologue as
15 // regular C functions compiled with GCC or Clang and therefore are better handled by GDB. As a
16 // consequence, and as opposed to regular Rust functions, we can set the breakpoints via the
17 // function name (and don't have to fall back on using line numbers).
19 // compile-flags:-Z extra-debug-info
20 // debugger:set print pretty off
21 // debugger:rbreak immediate_args
22 // debugger:rbreak binding
23 // debugger:rbreak assignment
24 // debugger:rbreak function_call
25 // debugger:rbreak identifier
26 // debugger:rbreak return_expr
27 // debugger:rbreak arithmetic_expr
28 // debugger:rbreak if_expr
29 // debugger:rbreak while_expr
30 // debugger:rbreak loop_expr
44 // check:$4 = {a = 3, b = 4, c = 5, d = 6, e = 7, f = 8, g = 9, h = 10}
46 // check:$5 = {a = 11, b = 12, c = 13, d = 14, e = 15, f = 16, g = 17, h = 18}
130 #[allow(unused_variable)];
133 fn immediate_args(a: int, b: bool, c: f64) {
149 fn non_immediate_args(a: BigStruct, b: BigStruct) {
154 fn binding(a: i64, b: u64, c: f64) {
159 fn assignment(mut a: u64, b: u64, c: f64) {
164 fn function_call(x: u64, y: u64, z: f64) {
165 std::io::stdio::print("Hi!")
169 fn identifier(x: u64, y: u64, z: f64) -> u64 {
174 fn return_expr(x: u64, y: u64, z: f64) -> u64 {
179 fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 {
184 fn if_expr(x: u64, y: u64, z: f64) -> u64 {
193 fn while_expr(mut x: u64, y: u64, z: u64) -> u64 {
201 fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 {
212 immediate_args(1, true, 2.5);
237 binding(19, 20, 21.5);
238 assignment(22, 23, 24.5);
239 function_call(25, 26, 27.5);
240 identifier(28, 29, 30.5);
241 return_expr(31, 32, 33.5);
242 arithmetic_expr(34, 35, 36.5);
243 if_expr(37, 38, 39.5);
244 while_expr(40, 41, 42);
245 loop_expr(43, 44, 45);