Skip to content

Commit a8a6e50

Browse files
committed
Auto merge of rust-lang#128913 - saethlin:unignore-debuginfo-tests, r=<try>
Enable debuginfo tests that were "temporarily disabled" for the past 6 years `tests/debuginfo/drop-locations.rs` No idea why we are setting `-O -Cno-prepopulate-passes`. Nowadays that turns on MIR opts, no idea what it did in 2018. Turning off optimizations makes just loc2 missing. That seems like a bug in debuginfo generation. Turning off all MIR opts and even adding a `drop(s)` on that line doesn't help. Cursed. Keeping this test ignored. `tests/debuginfo/option-like-enum.rs` Debuggers are better at Rust! Also one inexplicable change. No idea why we used to expect that. Deleted. `tests/debuginfo/function-arg-initialization.rs` rust-lang#128945 `tests/debuginfo/macro-stepping.rs` Also broken by SingleUseConsts. I hate tests like this, nobody uses a debugger on code that's just assigning consts to unused variables. Test should be rewritten with realistic code. `tests/debuginfo/basic-types-metadata.rs` Debuggers are better at Rust! Diverging functions don't have -> ! in their whatis output anymore? Not sure if that is a bug. --- More failures on apple! `tests/debuginfo/by-value-non-immediate-argument.rs` `tests/debuginfo/function-arg-initialization.rs` `tests/debuginfo/function-prologue-stepping-regular.rs` I think all of these indicate that lldb on aarch64-apple does not understand indirect by-value non-immediate arguments. Is that known? `tests/debuginfo/method-on-enum.rs` `tests/debuginfo/option-like-enum.rs` `tests/debuginfo/struct-in-enum.rs` lldb on aarch64-apple can't print enums until at least llvm 18. We use an old lldb on apple. try-job: test-various try-job: x86_64-msvc try-job: x86_64-mingw try-job: i686-msvc try-job: i686-mingw try-job: armhf-gnu try-job: dist-various-1
2 parents 04dff01 + 1b68bca commit a8a6e50

21 files changed

+38
-70
lines changed

tests/debuginfo/basic-types-globals-metadata.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ min-lldb-version: 310
2-
//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
32

43
//@ compile-flags:-g
54
// gdb-command:run

tests/debuginfo/basic-types-metadata.rs

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ min-lldb-version: 310
2-
//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
32

43
//@ compile-flags:-g
54
// gdb-command:run
@@ -36,31 +35,31 @@
3635
// gdb-command:whatis f64
3736
// gdb-check:type = f64
3837
// gdb-command:whatis fnptr
39-
// gdb-check:type = [...] (*)([...])
38+
// gdb-check:type = *mut fn ()
4039
// gdb-command:info functions _yyy
4140
// gdbg-check:[...]![...]_yyy([...]);
42-
// gdbr-check:static fn basic_types_metadata::_yyy() -> !;
41+
// gdbr-check:static fn basic_types_metadata::_yyy();
4342
// gdb-command:ptype closure_0
44-
// gdbr-check: type = struct closure
43+
// gdbr-check: type = struct basic_types_metadata::main::{closure_env#0}
4544
// gdbg-check: type = struct closure {
4645
// gdbg-check: <no data fields>
4746
// gdbg-check: }
4847
// gdb-command:ptype closure_1
4948
// gdbg-check: type = struct closure {
5049
// gdbg-check: bool *__0;
5150
// gdbg-check: }
52-
// gdbr-check: type = struct closure (
53-
// gdbr-check: bool *,
54-
// gdbr-check: )
51+
// gdbr-check: type = struct basic_types_metadata::main::{closure_env#1} {
52+
// gdbr-check: *mut bool,
53+
// gdbr-check: }
5554
// gdb-command:ptype closure_2
5655
// gdbg-check: type = struct closure {
5756
// gdbg-check: bool *__0;
5857
// gdbg-check: isize *__1;
5958
// gdbg-check: }
60-
// gdbr-check: type = struct closure (
61-
// gdbr-check: bool *,
62-
// gdbr-check: isize *,
63-
// gdbr-check: )
59+
// gdbr-check: type = struct basic_types_metadata::main::{closure_env#2} {
60+
// gdbr-check: *mut bool,
61+
// gdbr-check: *mut isize,
62+
// gdbr-check: }
6463

6564
//
6665
// gdb-command:continue

tests/debuginfo/basic-types.rs

-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
//@ min-lldb-version: 310
88

9-
// This fails on lldb 6.0.1 on x86-64 Fedora 28; so ignore Linux for now.
10-
//@ ignore-linux
11-
129
//@ compile-flags:-g
1310

1411
// === GDB TESTS ===================================================================================

tests/debuginfo/by-value-non-immediate-argument.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
2-
//@ min-lldb-version: 310
3-
1+
//@ min-lldb-version: 1800
42
//@ compile-flags:-g
53

64
// === GDB TESTS ===================================================================================
@@ -42,11 +40,11 @@
4240
// lldb-command:run
4341

4442
// lldb-command:v s
45-
// lldb-check:[...] Struct { a: 1, b: 2.5 }
43+
// lldb-check:[...] Struct { a = 1 b = 2.5 }
4644
// lldb-command:continue
4745

4846
// lldb-command:v x
49-
// lldb-check:[...] Struct { a: 3, b: 4.5 }
47+
// lldb-check:[...] Struct { a = 3 b = 4.5 }
5048
// lldb-command:v y
5149
// lldb-check:[...] 5
5250
// lldb-command:v z

tests/debuginfo/c-style-enum.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ ignore-aarch64
2-
//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
32
//@ min-lldb-version: 310
43

54
//@ compile-flags:-g

tests/debuginfo/cross-crate-spans.rs

-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33

44
//@ min-lldb-version: 310
55

6-
// This fails on lldb 6.0.1 on x86-64 Fedora 28; so mark it macOS-only
7-
// for now.
8-
//@ only-macos
9-
106
//@ aux-build:cross_crate_spans.rs
117
extern crate cross_crate_spans;
128

tests/debuginfo/destructured-for-loop-variable.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
//@ min-lldb-version: 310
22

3-
// This fails on lldb 6.0.1 on x86-64 Fedora 28; so mark it macOS-only
4-
// for now.
5-
//@ only-macos
6-
73
//@ compile-flags:-g
84

95
// === GDB TESTS ===================================================================================

tests/debuginfo/drop-locations.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
//@ ignore-windows
22
//@ ignore-android
3-
//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
43
//@ min-lldb-version: 310
4+
//@ ignore-test
55

66
#![allow(unused)]
77

8-
//@ compile-flags:-g -O -C no-prepopulate-passes
9-
// -O -C no-prepopulate-passes added to work around https://bugs.llvm.org/show_bug.cgi?id=32123
8+
//@ compile-flags:-g
109

1110
// This test checks that drop glue code gets attributed to scope's closing brace,
1211
// and function epilogues - to function's closing brace.

tests/debuginfo/function-arg-initialization.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
2-
//@ min-lldb-version: 310
3-
41
// This test case checks if function arguments already have the correct value
52
// when breaking at the first line of the function, that is if the function
63
// prologue has already been executed at the first line. Note that because of
74
// the __morestack part of the prologue GDB incorrectly breaks at before the
85
// arguments have been properly loaded when setting the breakpoint via the
96
// function name.
107

11-
//@ compile-flags:-g
8+
//@ min-lldb-version: 1800
9+
//@ compile-flags:-g -Zmir-enable-passes=-SingleUseConsts
1210

1311
// === GDB TESTS ===================================================================================
1412

tests/debuginfo/function-prologue-stepping-regular.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// This test case checks if function arguments already have the correct value when breaking at the
22
// beginning of a function.
33

4-
//@ min-lldb-version: 310
4+
//@ min-lldb-version: 1800
55
//@ ignore-gdb
6-
//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
76
//@ compile-flags:-g
87

98
// lldb-command:breakpoint set --name immediate_args

tests/debuginfo/lexical-scopes-in-block-expression.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ min-lldb-version: 310
2-
//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
32

43
//@ compile-flags:-g
54

tests/debuginfo/limited-debuginfo.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ ignore-lldb
2-
//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
32

43
//@ compile-flags:-C debuginfo=1
54

tests/debuginfo/macro-stepping.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//@ ignore-android
33
//@ ignore-aarch64
44
//@ min-lldb-version: 310
5-
//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
65

76
//@ aux-build:macro-stepping.rs
87

@@ -11,7 +10,7 @@
1110
#[macro_use]
1211
extern crate macro_stepping; // exports new_scope!()
1312

14-
//@ compile-flags:-g
13+
//@ compile-flags:-g -Zmir-enable-passes=-SingleUseConsts
1514

1615
// === GDB TESTS ===================================================================================
1716

tests/debuginfo/method-on-enum.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//@ min-lldb-version: 310
2-
//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
1+
//@ min-lldb-version: 1800
32

43
//@ compile-flags:-g
54

tests/debuginfo/option-like-enum.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
2-
3-
//@ min-lldb-version: 310
1+
//@ min-lldb-version: 1800
42

53
//@ compile-flags:-g
64

@@ -22,19 +20,19 @@
2220

2321
// gdbg-command:print empty_gdb->discr
2422
// gdbr-command:print empty_gdb.discr
25-
// gdb-check:$4 = (isize *) 0x0
23+
// gdb-check:$4 = (*mut isize) 0x1
2624

2725
// gdb-command:print droid
2826
// gdbg-check:$5 = {RUST$ENCODED$ENUM$2$Void = {id = 675675, range = 10000001, internals = 0x43218765}}
2927
// gdbr-check:$5 = option_like_enum::NamedFields::Droid{id: 675675, range: 10000001, internals: 0x43218765}
3028

3129
// gdbg-command:print void_droid_gdb->internals
3230
// gdbr-command:print void_droid_gdb.internals
33-
// gdb-check:$6 = (isize *) 0x0
31+
// gdb-check:$6 = (*mut isize) 0x1
3432

3533
// gdb-command:print nested_non_zero_yep
3634
// gdbg-check:$7 = {RUST$ENCODED$ENUM$1$2$Nope = {__0 = 10.5, __1 = {a = 10, b = 20, c = [...]}}}
37-
// gdbr-check:$7 = option_like_enum::NestedNonZero::Yep(10.5, option_like_enum::NestedNonZeroField {a: 10, b: 20, c: 0x[...] "x[...]"})
35+
// gdbr-check:$7 = option_like_enum::NestedNonZero::Yep(10.5, option_like_enum::NestedNonZeroField {a: 10, b: 20, c: 0x[...]})
3836

3937
// gdb-command:print nested_non_zero_nope
4038
// gdbg-check:$8 = {RUST$ENCODED$ENUM$1$2$Nope = {__0 = [...], __1 = {a = [...], b = [...], c = 0x0}}}

tests/debuginfo/pretty-std.rs

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
// ignore-tidy-linelength
22
//@ ignore-freebsd: gdb package too new
3-
//@ only-cdb // "Temporarily" ignored on GDB/LLDB due to debuginfo tests being disabled, see PR 47155
43
//@ ignore-android: FIXME(#10381)
54
//@ compile-flags:-g
65
//@ min-gdb-version: 7.7
7-
//@ min-lldb-version: 310
6+
//@ min-lldb-version: 1800
87
//@ min-cdb-version: 10.0.18317.1001
98

109
// === GDB TESTS ===================================================================================
1110

1211
// gdb-command: run
1312

1413
// gdb-command: print slice
15-
// gdb-check:$1 = &[i32](len: 4) = {0, 1, 2, 3}
14+
// gdb-check:$1 = &[i32](size=4) = {0, 1, 2, 3}
1615

1716
// gdb-command: print vec
18-
// gdb-check:$2 = Vec<u64, alloc::alloc::Global>(len: 4, cap: [...]) = {4, 5, 6, 7}
17+
// gdb-check:$2 = Vec(size=4) = {4, 5, 6, 7}
1918

2019
// gdb-command: print str_slice
2120
// gdb-check:$3 = "IAMA string slice!"
@@ -24,37 +23,37 @@
2423
// gdb-check:$4 = "IAMA string!"
2524

2625
// gdb-command: print some
27-
// gdb-check:$5 = Some = {8}
26+
// gdb-check:$5 = core::option::Option<i16>::Some(8)
2827

2928
// gdb-command: print none
3029
// gdbg-check:$6 = None
31-
// gdbr-check:$6 = core::option::Option::None
30+
// gdbr-check:$6 = core::option::Option<i64>::None
3231

3332
// gdb-command: print os_string
3433
// gdb-check:$7 = "IAMA OS string 😃"
3534

3635
// gdb-command: print some_string
37-
// gdb-check:$8 = Some = {"IAMA optional string!"}
36+
// gdb-check:$8 = core::option::Option<alloc::string::String>::Some("IAMA optional string!")
3837

39-
// gdb-command: set print length 5
38+
// gdb-command: set print elements 5
4039
// gdb-command: print some_string
41-
// gdb-check:$8 = Some = {"IAMA "...}
40+
// gdb-check:$9 = core::option::Option<alloc::string::String>::Some("IAMA "...)
4241

4342
// === LLDB TESTS ==================================================================================
4443

4544
// lldb-command:run
4645

4746
// lldb-command:v slice
48-
// lldb-check:[...] slice = &[0, 1, 2, 3]
47+
// lldb-check:[...] slice = size=4 { [0] = 0 [1] = 1 [2] = 2 [3] = 3 }
4948

5049
// lldb-command:v vec
51-
// lldb-check:[...] vec = vec![4, 5, 6, 7]
50+
// lldb-check:[...] vec = size=4 { [0] = 4 [1] = 5 [2] = 6 [3] = 7 }
5251

5352
// lldb-command:v str_slice
54-
// lldb-check:[...] str_slice = "IAMA string slice!"
53+
// lldb-check:[...] str_slice = "IAMA string slice!" { [0] = 'I' [1] = 'A' [2] = 'M' [3] = 'A' [4] = ' ' [5] = 's' [6] = 't' [7] = 'r' [8] = 'i' [9] = 'n' [10] = 'g' [11] = ' ' [12] = 's' [13] = 'l' [14] = 'i' [15] = 'c' [16] = 'e' [17] = '!' }
5554

5655
// lldb-command:v string
57-
// lldb-check:[...] string = "IAMA string!"
56+
// lldb-check:[...] string = "IAMA string!" { vec = size=12 { [0] = 'I' [1] = 'A' [2] = 'M' [3] = 'A' [4] = ' ' [5] = 's' [6] = 't' [7] = 'r' [8] = 'i' [9] = 'n' [10] = 'g' [11] = '!' } }
5857

5958
// lldb-command:v some
6059
// lldb-check:[...] some = Some(8)
@@ -63,7 +62,7 @@
6362
// lldb-check:[...] none = None
6463

6564
// lldb-command:v os_string
66-
// lldb-check:[...] os_string = "IAMA OS string 😃"[...]
65+
// lldb-check:[...] os_string = "IAMA OS string 😃" { inner = { inner = size=19 { [0] = 'I' [1] = 'A' [2] = 'M' [3] = 'A' [4] = ' ' [5] = 'O' [6] = 'S' [7] = ' ' [8] = 's' [9] = 't' [10] = 'r' [11] = 'i' [12] = 'n' [13] = 'g' [14] = ' ' [15] = '\xf0' [16] = '\x9f' [17] = '\x98' [18] = '\x83' } } }
6766

6867
// === CDB TESTS ==================================================================================
6968

tests/debuginfo/simple-struct.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ min-lldb-version: 310
2-
//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
32

43
//@ compile-flags: -g -Zmir-enable-passes=-CheckAlignment
54

tests/debuginfo/simple-tuple.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ min-lldb-version: 310
2-
//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
32

43
//@ compile-flags:-g
54

tests/debuginfo/struct-in-enum.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
//@ min-lldb-version: 310
1+
//@ min-lldb-version: 1800
22
//@ ignore-gdb-version: 7.11.90 - 7.12.9
3-
//@ ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
43

54
//@ compile-flags:-g
65

tests/debuginfo/union-smoke.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ min-lldb-version: 310
2-
//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
32

43
//@ ignore-gdb-version: 7.11.90 - 7.12.9
54

tests/debuginfo/vec.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ min-lldb-version: 310
2-
//@ ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
32

43
//@ compile-flags:-g
54

0 commit comments

Comments
 (0)