Skip to content

Commit 9253e12

Browse files
committed
adapt debuginfo tests for gdb with native rust support
1 parent 5db21c3 commit 9253e12

File tree

65 files changed

+983
-494
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+983
-494
lines changed

src/test/debuginfo/associated-types.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
// gdb-command:run
1717

1818
// gdb-command:print arg
19-
// gdb-check:$1 = {b = -1, b1 = 0}
19+
// gdbg-check:$1 = {b = -1, b1 = 0}
20+
// gdbr-check:$1 = associated_types::Struct<i32> {b: -1, b1: 0}
2021
// gdb-command:continue
2122

2223
// gdb-command:print inferred
@@ -30,7 +31,8 @@
3031
// gdb-command:continue
3132

3233
// gdb-command:print arg
33-
// gdb-check:$5 = {__0 = 4, __1 = 5}
34+
// gdbg-check:$5 = {__0 = 4, __1 = 5}
35+
// gdbr-check:$5 = (4, 5)
3436
// gdb-command:continue
3537

3638
// gdb-command:print a

src/test/debuginfo/basic-types-globals-metadata.rs

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,47 @@
1212

1313
// compile-flags:-g
1414
// gdb-command:run
15-
// gdb-command:whatis 'basic_types_globals_metadata::B'
15+
// gdbg-command:whatis 'basic_types_globals_metadata::B'
16+
// gdbr-command:whatis basic_types_globals_metadata::B
1617
// gdb-check:type = bool
17-
// gdb-command:whatis 'basic_types_globals_metadata::I'
18+
// gdbg-command:whatis 'basic_types_globals_metadata::I'
19+
// gdbr-command:whatis basic_types_globals_metadata::I
1820
// gdb-check:type = isize
19-
// gdb-command:whatis 'basic_types_globals_metadata::C'
21+
// gdbg-command:whatis 'basic_types_globals_metadata::C'
22+
// gdbr-command:whatis basic_types_globals_metadata::C
2023
// gdb-check:type = char
21-
// gdb-command:whatis 'basic_types_globals_metadata::I8'
24+
// gdbg-command:whatis 'basic_types_globals_metadata::I8'
25+
// gdbr-command:whatis basic_types_globals_metadata::I8
2226
// gdb-check:type = i8
23-
// gdb-command:whatis 'basic_types_globals_metadata::I16'
27+
// gdbg-command:whatis 'basic_types_globals_metadata::I16'
28+
// gdbr-command:whatis basic_types_globals_metadata::I16
2429
// gdb-check:type = i16
25-
// gdb-command:whatis 'basic_types_globals_metadata::I32'
30+
// gdbg-command:whatis 'basic_types_globals_metadata::I32'
31+
// gdbr-command:whatis basic_types_globals_metadata::I32
2632
// gdb-check:type = i32
27-
// gdb-command:whatis 'basic_types_globals_metadata::I64'
33+
// gdbg-command:whatis 'basic_types_globals_metadata::I64'
34+
// gdbr-command:whatis basic_types_globals_metadata::I64
2835
// gdb-check:type = i64
29-
// gdb-command:whatis 'basic_types_globals_metadata::U'
36+
// gdbg-command:whatis 'basic_types_globals_metadata::U'
37+
// gdbr-command:whatis basic_types_globals_metadata::U
3038
// gdb-check:type = usize
31-
// gdb-command:whatis 'basic_types_globals_metadata::U8'
39+
// gdbg-command:whatis 'basic_types_globals_metadata::U8'
40+
// gdbr-command:whatis basic_types_globals_metadata::U8
3241
// gdb-check:type = u8
33-
// gdb-command:whatis 'basic_types_globals_metadata::U16'
42+
// gdbg-command:whatis 'basic_types_globals_metadata::U16'
43+
// gdbr-command:whatis basic_types_globals_metadata::U16
3444
// gdb-check:type = u16
35-
// gdb-command:whatis 'basic_types_globals_metadata::U32'
45+
// gdbg-command:whatis 'basic_types_globals_metadata::U32'
46+
// gdbr-command:whatis basic_types_globals_metadata::U32
3647
// gdb-check:type = u32
37-
// gdb-command:whatis 'basic_types_globals_metadata::U64'
48+
// gdbg-command:whatis 'basic_types_globals_metadata::U64'
49+
// gdbr-command:whatis basic_types_globals_metadata::U64
3850
// gdb-check:type = u64
39-
// gdb-command:whatis 'basic_types_globals_metadata::F32'
51+
// gdbg-command:whatis 'basic_types_globals_metadata::F32'
52+
// gdbr-command:whatis basic_types_globals_metadata::F32
4053
// gdb-check:type = f32
41-
// gdb-command:whatis 'basic_types_globals_metadata::F64'
54+
// gdbg-command:whatis 'basic_types_globals_metadata::F64'
55+
// gdbr-command:whatis basic_types_globals_metadata::F64
4256
// gdb-check:type = f64
4357
// gdb-command:continue
4458

src/test/debuginfo/basic-types-globals.rs

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,48 @@
1818

1919
// compile-flags:-g
2020
// gdb-command:run
21-
// gdb-command:print 'basic_types_globals::B'
21+
// gdbg-command:print 'basic_types_globals::B'
22+
// gdbr-command:print B
2223
// gdb-check:$1 = false
23-
// gdb-command:print 'basic_types_globals::I'
24+
// gdbg-command:print 'basic_types_globals::I'
25+
// gdbr-command:print I
2426
// gdb-check:$2 = -1
25-
// gdb-command:print 'basic_types_globals::C'
26-
// gdb-check:$3 = 97
27-
// gdb-command:print/d 'basic_types_globals::I8'
27+
// gdbg-command:print 'basic_types_globals::C'
28+
// gdbr-command:print C
29+
// gdbg-check:$3 = 97
30+
// gdbr-check:$3 = 97 'a'
31+
// gdbg-command:print/d 'basic_types_globals::I8'
32+
// gdbr-command:print I8
2833
// gdb-check:$4 = 68
29-
// gdb-command:print 'basic_types_globals::I16'
34+
// gdbg-command:print 'basic_types_globals::I16'
35+
// gdbr-command:print I16
3036
// gdb-check:$5 = -16
31-
// gdb-command:print 'basic_types_globals::I32'
37+
// gdbg-command:print 'basic_types_globals::I32'
38+
// gdbr-command:print I32
3239
// gdb-check:$6 = -32
33-
// gdb-command:print 'basic_types_globals::I64'
40+
// gdbg-command:print 'basic_types_globals::I64'
41+
// gdbr-command:print I64
3442
// gdb-check:$7 = -64
35-
// gdb-command:print 'basic_types_globals::U'
43+
// gdbg-command:print 'basic_types_globals::U'
44+
// gdbr-command:print U
3645
// gdb-check:$8 = 1
37-
// gdb-command:print/d 'basic_types_globals::U8'
46+
// gdbg-command:print/d 'basic_types_globals::U8'
47+
// gdbr-command:print U8
3848
// gdb-check:$9 = 100
39-
// gdb-command:print 'basic_types_globals::U16'
49+
// gdbg-command:print 'basic_types_globals::U16'
50+
// gdbr-command:print U16
4051
// gdb-check:$10 = 16
41-
// gdb-command:print 'basic_types_globals::U32'
52+
// gdbg-command:print 'basic_types_globals::U32'
53+
// gdbr-command:print U32
4254
// gdb-check:$11 = 32
43-
// gdb-command:print 'basic_types_globals::U64'
55+
// gdbg-command:print 'basic_types_globals::U64'
56+
// gdbr-command:print U64
4457
// gdb-check:$12 = 64
45-
// gdb-command:print 'basic_types_globals::F32'
58+
// gdbg-command:print 'basic_types_globals::F32'
59+
// gdbr-command:print F32
4660
// gdb-check:$13 = 2.5
47-
// gdb-command:print 'basic_types_globals::F64'
61+
// gdbg-command:print 'basic_types_globals::F64'
62+
// gdbr-command:print F64
4863
// gdb-check:$14 = 3.5
4964
// gdb-command:continue
5065

src/test/debuginfo/basic-types-metadata.rs

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,29 @@
4545
// gdb-command:whatis fnptr
4646
// gdb-check:type = [...] (*)([...])
4747
// gdb-command:info functions _yyy
48-
// gdb-check:[...]![...]_yyy([...]);
48+
// gdbg-check:[...]![...]_yyy([...]);
49+
// gdbr-check:static fn basic_types_metadata::_yyy() -> !;
4950
// gdb-command:ptype closure_0
50-
// gdb-check: type = struct closure {
51-
// gdb-check: <no data fields>
52-
// gdb-check: }
51+
// gdbr-check: type = struct closure
52+
// gdbg-check: type = struct closure {
53+
// gdbg-check: <no data fields>
54+
// gdbg-check: }
5355
// gdb-command:ptype closure_1
54-
// gdb-check: type = struct closure {
55-
// gdb-check: bool *__0;
56-
// gdb-check: }
56+
// gdbg-check: type = struct closure {
57+
// gdbg-check: bool *__0;
58+
// gdbg-check: }
59+
// gdbr-check: type = struct closure (
60+
// gdbr-check: bool *,
61+
// gdbr-check: )
5762
// gdb-command:ptype closure_2
58-
// gdb-check: type = struct closure {
59-
// gdb-check: bool *__0;
60-
// gdb-check: isize *__1;
61-
// gdb-check: }
63+
// gdbg-check: type = struct closure {
64+
// gdbg-check: bool *__0;
65+
// gdbg-check: isize *__1;
66+
// gdbg-check: }
67+
// gdbr-check: type = struct closure (
68+
// gdbr-check: bool *,
69+
// gdbr-check: isize *,
70+
// gdbr-check: )
6271

6372
//
6473
// gdb-command:continue

src/test/debuginfo/basic-types-mut-globals.rs

Lines changed: 60 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,64 +21,94 @@
2121
// gdb-command:run
2222

2323
// Check initializers
24-
// gdb-command:print 'basic_types_mut_globals::B'
24+
// gdbg-command:print 'basic_types_mut_globals::B'
25+
// gdbr-command:print B
2526
// gdb-check:$1 = false
26-
// gdb-command:print 'basic_types_mut_globals::I'
27+
// gdbg-command:print 'basic_types_mut_globals::I'
28+
// gdbr-command:print I
2729
// gdb-check:$2 = -1
28-
// gdb-command:print 'basic_types_mut_globals::C'
29-
// gdb-check:$3 = 97
30-
// gdb-command:print/d 'basic_types_mut_globals::I8'
30+
// gdbg-command:print/d 'basic_types_mut_globals::C'
31+
// gdbr-command:print C
32+
// gdbg-check:$3 = 97
33+
// gdbr-check:$3 = 97 'a'
34+
// gdbg-command:print/d 'basic_types_mut_globals::I8'
35+
// gdbr-command:print I8
3136
// gdb-check:$4 = 68
32-
// gdb-command:print 'basic_types_mut_globals::I16'
37+
// gdbg-command:print 'basic_types_mut_globals::I16'
38+
// gdbr-command:print I16
3339
// gdb-check:$5 = -16
34-
// gdb-command:print 'basic_types_mut_globals::I32'
40+
// gdbg-command:print 'basic_types_mut_globals::I32'
41+
// gdbr-command:print I32
3542
// gdb-check:$6 = -32
36-
// gdb-command:print 'basic_types_mut_globals::I64'
43+
// gdbg-command:print 'basic_types_mut_globals::I64'
44+
// gdbr-command:print I64
3745
// gdb-check:$7 = -64
38-
// gdb-command:print 'basic_types_mut_globals::U'
46+
// gdbg-command:print 'basic_types_mut_globals::U'
47+
// gdbr-command:print U
3948
// gdb-check:$8 = 1
40-
// gdb-command:print/d 'basic_types_mut_globals::U8'
49+
// gdbg-command:print/d 'basic_types_mut_globals::U8'
50+
// gdbr-command:print U8
4151
// gdb-check:$9 = 100
42-
// gdb-command:print 'basic_types_mut_globals::U16'
52+
// gdbg-command:print 'basic_types_mut_globals::U16'
53+
// gdbr-command:print U16
4354
// gdb-check:$10 = 16
44-
// gdb-command:print 'basic_types_mut_globals::U32'
55+
// gdbg-command:print 'basic_types_mut_globals::U32'
56+
// gdbr-command:print U32
4557
// gdb-check:$11 = 32
46-
// gdb-command:print 'basic_types_mut_globals::U64'
58+
// gdbg-command:print 'basic_types_mut_globals::U64'
59+
// gdbr-command:print U64
4760
// gdb-check:$12 = 64
48-
// gdb-command:print 'basic_types_mut_globals::F32'
61+
// gdbg-command:print 'basic_types_mut_globals::F32'
62+
// gdbr-command:print F32
4963
// gdb-check:$13 = 2.5
50-
// gdb-command:print 'basic_types_mut_globals::F64'
64+
// gdbg-command:print 'basic_types_mut_globals::F64'
65+
// gdbr-command:print F64
5166
// gdb-check:$14 = 3.5
5267
// gdb-command:continue
5368

5469
// Check new values
55-
// gdb-command:print 'basic_types_mut_globals'::B
70+
// gdbg-command:print 'basic_types_mut_globals'::B
71+
// gdbr-command:print B
5672
// gdb-check:$15 = true
57-
// gdb-command:print 'basic_types_mut_globals'::I
73+
// gdbg-command:print 'basic_types_mut_globals'::I
74+
// gdbr-command:print I
5875
// gdb-check:$16 = 2
59-
// gdb-command:print 'basic_types_mut_globals'::C
60-
// gdb-check:$17 = 102
61-
// gdb-command:print/d 'basic_types_mut_globals'::I8
76+
// gdbg-command:print/d 'basic_types_mut_globals'::C
77+
// gdbr-command:print C
78+
// gdbg-check:$17 = 102
79+
// gdbr-check:$17 = 102 'f'
80+
// gdbg-command:print/d 'basic_types_mut_globals'::I8
81+
// gdbr-command:print/d I8
6282
// gdb-check:$18 = 78
63-
// gdb-command:print 'basic_types_mut_globals'::I16
83+
// gdbg-command:print 'basic_types_mut_globals'::I16
84+
// gdbr-command:print I16
6485
// gdb-check:$19 = -26
65-
// gdb-command:print 'basic_types_mut_globals'::I32
86+
// gdbg-command:print 'basic_types_mut_globals'::I32
87+
// gdbr-command:print I32
6688
// gdb-check:$20 = -12
67-
// gdb-command:print 'basic_types_mut_globals'::I64
89+
// gdbg-command:print 'basic_types_mut_globals'::I64
90+
// gdbr-command:print I64
6891
// gdb-check:$21 = -54
69-
// gdb-command:print 'basic_types_mut_globals'::U
92+
// gdbg-command:print 'basic_types_mut_globals'::U
93+
// gdbr-command:print U
7094
// gdb-check:$22 = 5
71-
// gdb-command:print/d 'basic_types_mut_globals'::U8
95+
// gdbg-command:print/d 'basic_types_mut_globals'::U8
96+
// gdbr-command:print/d U8
7297
// gdb-check:$23 = 20
73-
// gdb-command:print 'basic_types_mut_globals'::U16
98+
// gdbg-command:print 'basic_types_mut_globals'::U16
99+
// gdbr-command:print U16
74100
// gdb-check:$24 = 32
75-
// gdb-command:print 'basic_types_mut_globals'::U32
101+
// gdbg-command:print 'basic_types_mut_globals'::U32
102+
// gdbr-command:print U32
76103
// gdb-check:$25 = 16
77-
// gdb-command:print 'basic_types_mut_globals'::U64
104+
// gdbg-command:print 'basic_types_mut_globals'::U64
105+
// gdbr-command:print U64
78106
// gdb-check:$26 = 128
79-
// gdb-command:print 'basic_types_mut_globals'::F32
107+
// gdbg-command:print 'basic_types_mut_globals'::F32
108+
// gdbr-command:print F32
80109
// gdb-check:$27 = 5.75
81-
// gdb-command:print 'basic_types_mut_globals'::F64
110+
// gdbg-command:print 'basic_types_mut_globals'::F64
111+
// gdbr-command:print F64
82112
// gdb-check:$28 = 9.25
83113

84114
#![allow(unused_variables)]

src/test/debuginfo/basic-types.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
// gdb-command:print i
2727
// gdb-check:$2 = -1
2828
// gdb-command:print c
29-
// gdb-check:$3 = 97
29+
// gdbg-check:$3 = 97
30+
// gdbr-check:$3 = 97 'a'
3031
// gdb-command:print/d i8
3132
// gdb-check:$4 = 68
3233
// gdb-command:print i16

src/test/debuginfo/borrowed-basic.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@
2525
// gdb-check:$2 = -1
2626

2727
// gdb-command:print *char_ref
28-
// gdb-check:$3 = 97
28+
// gdbg-check:$3 = 97
29+
// gdbr-check:$3 = 97 'a'
2930

3031
// gdb-command:print *i8_ref
31-
// gdb-check:$4 = 68 'D'
32+
// gdbg-check:$4 = 68 'D'
33+
// gdbr-check:$4 = 68
3234

3335
// gdb-command:print *i16_ref
3436
// gdb-check:$5 = -16
@@ -43,7 +45,8 @@
4345
// gdb-check:$8 = 1
4446

4547
// gdb-command:print *u8_ref
46-
// gdb-check:$9 = 100 'd'
48+
// gdbg-check:$9 = 100 'd'
49+
// gdbr-check:$9 = 100
4750

4851
// gdb-command:print *u16_ref
4952
// gdb-check:$10 = 16

src/test/debuginfo/borrowed-c-style-enum.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@
1717
// gdb-command:run
1818

1919
// gdb-command:print *the_a_ref
20-
// gdb-check:$1 = TheA
20+
// gdbg-check:$1 = TheA
21+
// gdbr-check:$1 = borrowed_c_style_enum::ABC::TheA
2122

2223
// gdb-command:print *the_b_ref
23-
// gdb-check:$2 = TheB
24+
// gdbg-check:$2 = TheB
25+
// gdbr-check:$2 = borrowed_c_style_enum::ABC::TheB
2426

2527
// gdb-command:print *the_c_ref
26-
// gdb-check:$3 = TheC
28+
// gdbg-check:$3 = TheC
29+
// gdbr-check:$3 = borrowed_c_style_enum::ABC::TheC
2730

2831

2932
// === LLDB TESTS ==================================================================================

src/test/debuginfo/borrowed-enum.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@
1818
// gdb-command:run
1919

2020
// gdb-command:print *the_a_ref
21-
// gdb-check:$1 = {{RUST$ENUM$DISR = TheA, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = TheA, __0 = 0, __1 = 2088533116, __2 = 2088533116}}
21+
// gdbg-check:$1 = {{RUST$ENUM$DISR = TheA, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = TheA, __0 = 0, __1 = 2088533116, __2 = 2088533116}}
22+
// gdbr-check:$1 = borrowed_enum::ABC::TheA{x: 0, y: 8970181431921507452}
2223

2324
// gdb-command:print *the_b_ref
24-
// gdb-check:$2 = {{RUST$ENUM$DISR = TheB, x = 0, y = 1229782938247303441}, {RUST$ENUM$DISR = TheB, __0 = 0, __1 = 286331153, __2 = 286331153}}
25+
// gdbg-check:$2 = {{RUST$ENUM$DISR = TheB, x = 0, y = 1229782938247303441}, {RUST$ENUM$DISR = TheB, __0 = 0, __1 = 286331153, __2 = 286331153}}
26+
// gdbr-check:$2 = borrowed_enum::ABC::TheB(0, 286331153, 286331153)
2527

2628
// gdb-command:print *univariant_ref
27-
// gdb-check:$3 = {{__0 = 4820353753753434}}
29+
// gdbg-check:$3 = {{__0 = 4820353753753434}}
30+
// gdbr-check:$3 = borrowed_enum::Univariant::TheOnlyCase(4820353753753434)
2831

2932

3033
// === LLDB TESTS ==================================================================================

0 commit comments

Comments
 (0)