Skip to content

Commit 2cc3193

Browse files
---
yaml --- r: 147269 b: refs/heads/try2 c: 89b47d5 h: refs/heads/master i: 147267: 21de848 v: v3
1 parent e85abfe commit 2cc3193

File tree

4 files changed

+495
-2
lines changed

4 files changed

+495
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 91efb2a67f387773750b4ebc2290f16b14bf8e13
8+
refs/heads/try2: 89b47d5557b52e0da7b95e70ed61f76db152664b
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/trans/debuginfo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2235,7 +2235,7 @@ fn populate_scope_map(cx: &mut CrateContext,
22352235
})
22362236
}
22372237

2238-
// Clang creates separate scope functions bodies, so let's do this too
2238+
// Clang creates a separate scope for function bodies, so let's do this too
22392239
with_new_scope(cx,
22402240
fn_entry_block.span,
22412241
&mut scope_stack,
Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
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.
4+
//
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.
10+
11+
// xfail-android: FIXME(#10381)
12+
13+
// This test case checks if function arguments already have the correct value when breaking at the
14+
// first line of the function, that is if the function prologue has already been executed at the
15+
// first line. Note that because of the __morestack part of the prologue GDB incorrectly breaks at
16+
// before the arguments have been properly loaded when setting the breakpoint via the function name.
17+
// Therefore the setup here sets them using line numbers (so be careful when changing this file).
18+
19+
// compile-flags:-Z extra-debug-info
20+
// debugger:set print pretty off
21+
// debugger:break function-arg-initialization.rs:139
22+
// debugger:break function-arg-initialization.rs:154
23+
// debugger:break function-arg-initialization.rs:158
24+
// debugger:break function-arg-initialization.rs:162
25+
// debugger:break function-arg-initialization.rs:166
26+
// debugger:break function-arg-initialization.rs:170
27+
// debugger:break function-arg-initialization.rs:174
28+
// debugger:break function-arg-initialization.rs:178
29+
// debugger:break function-arg-initialization.rs:182
30+
// debugger:break function-arg-initialization.rs:190
31+
// debugger:break function-arg-initialization.rs:197
32+
33+
34+
// debugger:run
35+
36+
// IMMEDIATE ARGS
37+
// debugger:print a
38+
// check:$1 = 1
39+
// debugger:print b
40+
// check:$2 = true
41+
// debugger:print c
42+
// check:$3 = 2.5
43+
// debugger:continue
44+
45+
// NON IMMEDIATE ARGS
46+
// debugger:print a
47+
// check:$4 = {a = 3, b = 4, c = 5, d = 6, e = 7, f = 8, g = 9, h = 10}
48+
// debugger:print b
49+
// check:$5 = {a = 11, b = 12, c = 13, d = 14, e = 15, f = 16, g = 17, h = 18}
50+
// debugger:continue
51+
52+
// BINDING
53+
// debugger:print a
54+
// check:$6 = 19
55+
// debugger:print b
56+
// check:$7 = 20
57+
// debugger:print c
58+
// check:$8 = 21.5
59+
// debugger:continue
60+
61+
// ASSIGNMENT
62+
// debugger:print a
63+
// check:$9 = 22
64+
// debugger:print b
65+
// check:$10 = 23
66+
// debugger:print c
67+
// check:$11 = 24.5
68+
// debugger:continue
69+
70+
// FUNCTION CALL
71+
// debugger:print x
72+
// check:$12 = 25
73+
// debugger:print y
74+
// check:$13 = 26
75+
// debugger:print z
76+
// check:$14 = 27.5
77+
// debugger:continue
78+
79+
// EXPR
80+
// debugger:print x
81+
// check:$15 = 28
82+
// debugger:print y
83+
// check:$16 = 29
84+
// debugger:print z
85+
// check:$17 = 30.5
86+
// debugger:continue
87+
88+
// RETURN EXPR
89+
// debugger:print x
90+
// check:$18 = 31
91+
// debugger:print y
92+
// check:$19 = 32
93+
// debugger:print z
94+
// check:$20 = 33.5
95+
// debugger:continue
96+
97+
// ARITHMETIC EXPR
98+
// debugger:print x
99+
// check:$21 = 34
100+
// debugger:print y
101+
// check:$22 = 35
102+
// debugger:print z
103+
// check:$23 = 36.5
104+
// debugger:continue
105+
106+
// IF EXPR
107+
// debugger:print x
108+
// check:$24 = 37
109+
// debugger:print y
110+
// check:$25 = 38
111+
// debugger:print z
112+
// check:$26 = 39.5
113+
// debugger:continue
114+
115+
// WHILE EXPR
116+
// debugger:print x
117+
// check:$27 = 40
118+
// debugger:print y
119+
// check:$28 = 41
120+
// debugger:print z
121+
// check:$29 = 42
122+
// debugger:continue
123+
124+
// LOOP EXPR
125+
// debugger:print x
126+
// check:$30 = 43
127+
// debugger:print y
128+
// check:$31 = 44
129+
// debugger:print z
130+
// check:$32 = 45
131+
// debugger:continue
132+
133+
#[allow(unused_variable)];
134+
135+
136+
137+
138+
fn immediate_args(a: int, b: bool, c: f64) {
139+
()
140+
}
141+
142+
struct BigStruct {
143+
a: u64,
144+
b: u64,
145+
c: u64,
146+
d: u64,
147+
e: u64,
148+
f: u64,
149+
g: u64,
150+
h: u64
151+
}
152+
153+
fn non_immediate_args(a: BigStruct, b: BigStruct) {
154+
()
155+
}
156+
157+
fn binding(a: i64, b: u64, c: f64) {
158+
let x = 0;
159+
}
160+
161+
fn assignment(mut a: u64, b: u64, c: f64) {
162+
a = b;
163+
}
164+
165+
fn function_call(x: u64, y: u64, z: f64) {
166+
print("Hi!")
167+
}
168+
169+
fn identifier(x: u64, y: u64, z: f64) -> u64 {
170+
x
171+
}
172+
173+
fn return_expr(x: u64, y: u64, z: f64) -> u64 {
174+
return x;
175+
}
176+
177+
fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 {
178+
x + y
179+
}
180+
181+
fn if_expr(x: u64, y: u64, z: f64) -> u64 {
182+
if x + y < 1000 {
183+
x
184+
} else {
185+
y
186+
}
187+
}
188+
189+
fn while_expr(mut x: u64, y: u64, z: u64) -> u64 {
190+
while x + y < 1000 {
191+
x += z
192+
}
193+
return x;
194+
}
195+
196+
fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 {
197+
loop {
198+
x += z;
199+
200+
if x + y > 1000 {
201+
return x;
202+
}
203+
}
204+
}
205+
206+
fn main() {
207+
immediate_args(1, true, 2.5);
208+
209+
non_immediate_args(
210+
BigStruct {
211+
a: 3,
212+
b: 4,
213+
c: 5,
214+
d: 6,
215+
e: 7,
216+
f: 8,
217+
g: 9,
218+
h: 10
219+
},
220+
BigStruct {
221+
a: 11,
222+
b: 12,
223+
c: 13,
224+
d: 14,
225+
e: 15,
226+
f: 16,
227+
g: 17,
228+
h: 18
229+
}
230+
);
231+
232+
binding(19, 20, 21.5);
233+
assignment(22, 23, 24.5);
234+
function_call(25, 26, 27.5);
235+
identifier(28, 29, 30.5);
236+
return_expr(31, 32, 33.5);
237+
arithmetic_expr(34, 35, 36.5);
238+
if_expr(37, 38, 39.5);
239+
while_expr(40, 41, 42);
240+
loop_expr(43, 44, 45);
241+
}
242+
243+
244+

0 commit comments

Comments
 (0)