Skip to content

Commit 927f454

Browse files
committed
auto merge of #7432 : michaelwoerister/rust/WP3, r=jdm
2 parents 63afb8c + 2f5e33d commit 927f454

16 files changed

+1317
-97
lines changed

src/librustc/middle/trans/debuginfo.rs

+177-68
Large diffs are not rendered by default.

src/test/debug-info/basic-types.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
// check:$2 = -1
2727
// debugger:print c
2828
// check:$3 = 97
29-
// debugger:print i8
30-
// check:$4 = 68 'D'
29+
// debugger:print/d i8
30+
// check:$4 = 68
3131
// debugger:print i16
3232
// check:$5 = -16
3333
// debugger:print i32
@@ -36,8 +36,8 @@
3636
// check:$7 = -64
3737
// debugger:print u
3838
// check:$8 = 1
39-
// debugger:print u8
40-
// check:$9 = 100 'd'
39+
// debugger:print/d u8
40+
// check:$9 = 100
4141
// debugger:print u16
4242
// check:$10 = 16
4343
// debugger:print u32

src/test/debug-info/tuple.rs renamed to src/test/debug-info/destructured-local.rs

+15-8
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,26 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-win32 Broken because of LLVM bug: http://llvm.org/bugs/show_bug.cgi?id=16249
11+
// xfail-test
12+
13+
// GDB doesn't know about UTF-32 character encoding and will print a rust char as only its numerical
14+
// value.
1215

1316
// compile-flags:-Z extra-debug-info
14-
// debugger:set print pretty off
15-
// debugger:break _zzz
17+
// debugger:break zzz
1618
// debugger:run
1719
// debugger:finish
18-
// debugger:print t
19-
// check:$1 = {4, 5.5, true}
20+
21+
// debugger:print a
22+
// check:$1 = 9898
23+
24+
// debugger:print b
25+
// check:$2 = false
2026

2127
fn main() {
22-
let t = (4, 5.5, true);
23-
_zzz();
28+
let (a, b) : (int, bool) = (9898, false);
29+
30+
zzz();
2431
}
2532

26-
fn _zzz() {()}
33+
fn zzz() {()}
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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-test
12+
13+
// GDB doesn't know about UTF-32 character encoding and will print a rust char as only its numerical
14+
// value.
15+
16+
// compile-flags:-Z extra-debug-info
17+
// debugger:break zzz
18+
// debugger:run
19+
// debugger:finish
20+
21+
// debugger:print x
22+
// check:$1 = 111102
23+
// debugger:print y
24+
// check:$2 = true
25+
26+
// debugger:continue
27+
// debugger:finish
28+
29+
// debugger:print a
30+
// check:$3 = 2000
31+
// debugger:print b
32+
// check:$4 = 3000
33+
34+
fn main() {
35+
36+
fun(111102, true);
37+
nested(2000, 3000);
38+
39+
fn nested(a: i32, b: i64) -> (i32, i64) {
40+
zzz()
41+
(a, b)
42+
}
43+
}
44+
45+
fn fun(x: int, y: bool) -> (int, bool) {
46+
zzz();
47+
48+
(x, y)
49+
}
50+
51+
fn zzz() {()}
+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
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-win32 Broken because of LLVM bug: http://llvm.org/bugs/show_bug.cgi?id=16249
12+
13+
// Caveats - gdb prints any 8-bit value (meaning rust i8 and u8 values)
14+
// as its numerical value along with its associated ASCII char, there
15+
// doesn't seem to be any way around this. Also, gdb doesn't know
16+
// about UTF-32 character encoding and will print a rust char as only
17+
// its numerical value.
18+
19+
// compile-flags:-Z extra-debug-info
20+
// debugger:break zzz
21+
// debugger:run
22+
// debugger:finish
23+
// debugger:print *bool_ref
24+
// check:$1 = true
25+
26+
// debugger:print *int_ref
27+
// check:$2 = -1
28+
29+
// debugger:print *char_ref
30+
// check:$3 = 97
31+
32+
// debugger:print *i8_ref
33+
// check:$4 = 68 'D'
34+
35+
// debugger:print *i16_ref
36+
// check:$5 = -16
37+
38+
// debugger:print *i32_ref
39+
// check:$6 = -32
40+
41+
// debugger:print *i64_ref
42+
// check:$7 = -64
43+
44+
// debugger:print *uint_ref
45+
// check:$8 = 1
46+
47+
// debugger:print *u8_ref
48+
// check:$9 = 100 'd'
49+
50+
// debugger:print *u16_ref
51+
// check:$10 = 16
52+
53+
// debugger:print *u32_ref
54+
// check:$11 = 32
55+
56+
// debugger:print *u64_ref
57+
// check:$12 = 64
58+
59+
// debugger:print *float_ref
60+
// check:$13 = 1.5
61+
62+
// debugger:print *f32_ref
63+
// check:$14 = 2.5
64+
65+
// debugger:print *f64_ref
66+
// check:$15 = 3.5
67+
68+
fn main() {
69+
let bool_val: bool = true;
70+
let bool_ref : &bool = &bool_val;
71+
72+
let int_val: int = -1;
73+
let int_ref : &int = &int_val;
74+
75+
let char_val: char = 'a';
76+
let char_ref : &char = &char_val;
77+
78+
let i8_val: i8 = 68;
79+
let i8_ref : &i8 = &i8_val;
80+
81+
let i16_val: i16 = -16;
82+
let i16_ref : &i16 = &i16_val;
83+
84+
let i32_val: i32 = -32;
85+
let i32_ref : &i32 = &i32_val;
86+
87+
let uint_val: i64 = -64;
88+
let i64_ref : &i64 = &uint_val;
89+
90+
let uint_val: uint = 1;
91+
let uint_ref : &uint = &uint_val;
92+
93+
let u8_val: u8 = 100;
94+
let u8_ref : &u8 = &u8_val;
95+
96+
let u16_val: u16 = 16;
97+
let u16_ref : &u16 = &u16_val;
98+
99+
let u32_val: u32 = 32;
100+
let u32_ref : &u32 = &u32_val;
101+
102+
let u64_val: u64 = 64;
103+
let u64_ref : &u64 = &u64_val;
104+
105+
let float_val: float = 1.5;
106+
let float_ref : &float = &float_val;
107+
108+
let f32_val: f32 = 2.5;
109+
let f32_ref : &f32 = &f32_val;
110+
111+
let f64_val: f64 = 3.5;
112+
let f64_ref : &f64 = &f64_val;
113+
zzz();
114+
}
115+
116+
fn zzz() {()}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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-win32 Broken because of LLVM bug: http://llvm.org/bugs/show_bug.cgi?id=16249
12+
13+
// Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
14+
// its numerical value.
15+
16+
// compile-flags:-Z extra-debug-info
17+
// debugger:break zzz
18+
// debugger:run
19+
// debugger:finish
20+
// debugger:print *bool_ref
21+
// check:$1 = true
22+
23+
// debugger:print *int_ref
24+
// check:$2 = -1
25+
26+
// debugger:print *char_ref
27+
// check:$3 = 97
28+
29+
// debugger:print/d *i8_ref
30+
// check:$4 = 68
31+
32+
// debugger:print *i16_ref
33+
// check:$5 = -16
34+
35+
// debugger:print *i32_ref
36+
// check:$6 = -32
37+
38+
// debugger:print *i64_ref
39+
// check:$7 = -64
40+
41+
// debugger:print *uint_ref
42+
// check:$8 = 1
43+
44+
// debugger:print/d *u8_ref
45+
// check:$9 = 100
46+
47+
// debugger:print *u16_ref
48+
// check:$10 = 16
49+
50+
// debugger:print *u32_ref
51+
// check:$11 = 32
52+
53+
// debugger:print *u64_ref
54+
// check:$12 = 64
55+
56+
// debugger:print *float_ref
57+
// check:$13 = 1.5
58+
59+
// debugger:print *f32_ref
60+
// check:$14 = 2.5
61+
62+
// debugger:print *f64_ref
63+
// check:$15 = 3.5
64+
65+
66+
fn main() {
67+
let bool_box: @bool = @true;
68+
let bool_ref : &bool = bool_box;
69+
70+
let int_box: @int = @-1;
71+
let int_ref : &int = int_box;
72+
73+
let char_box: @char = @'a';
74+
let char_ref : &char = char_box;
75+
76+
let i8_box: @i8 = @68;
77+
let i8_ref : &i8 = i8_box;
78+
79+
let i16_box: @i16 = @-16;
80+
let i16_ref : &i16 = i16_box;
81+
82+
let i32_box: @i32 = @-32;
83+
let i32_ref : &i32 = i32_box;
84+
85+
let i64_box: @i64 = @-64;
86+
let i64_ref : &i64 = i64_box;
87+
88+
let uint_box: @uint = @1;
89+
let uint_ref : &uint = uint_box;
90+
91+
let u8_box: @u8 = @100;
92+
let u8_ref : &u8 = u8_box;
93+
94+
let u16_box: @u16 = @16;
95+
let u16_ref : &u16 = u16_box;
96+
97+
let u32_box: @u32 = @32;
98+
let u32_ref : &u32 = u32_box;
99+
100+
let u64_box: @u64 = @64;
101+
let u64_ref : &u64 = u64_box;
102+
103+
let float_box: @float = @1.5;
104+
let float_ref : &float = float_box;
105+
106+
let f32_box: @f32 = @2.5;
107+
let f32_ref : &f32 = f32_box;
108+
109+
let f64_box: @f64 = @3.5;
110+
let f64_ref : &f64 = f64_box;
111+
zzz();
112+
}
113+
114+
fn zzz() {()}

0 commit comments

Comments
 (0)