Skip to content

Commit dcb0139

Browse files
authored
Unrolled build for #144497
Rollup merge of #144497 - Enselic:basic-stepping, r=Mark-Simulacrum tests: Add test for basic line-by-line stepping in a debugger Let's wait with lldb testing until the test works properly with gdb. This is a regression test to prevent further regressions of #33013 which unfortunately regressed in **nightly-2023-04-24**. See #33013 (comment).
2 parents 383b9c4 + 534b135 commit dcb0139

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

tests/debuginfo/basic-stepping.rs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
//! Test that stepping through a simple program with a debugger one line at a
2+
//! time works intuitively, e.g. that `next` takes you to the next source line.
3+
//! Regression test for <https://github.com/rust-lang/rust/issues/33013>.
4+
5+
//@ ignore-aarch64: Doesn't work yet.
6+
//@ compile-flags: -g
7+
8+
// gdb-command: run
9+
// FIXME(#97083): Should we be able to break on initialization of zero-sized types?
10+
// FIXME(#97083): Right now the first breakable line is:
11+
// gdb-check: let mut c = 27;
12+
// gdb-command: next
13+
// gdb-check: let d = c = 99;
14+
// gdb-command: next
15+
// FIXME(#33013): gdb-check: let e = "hi bob";
16+
// FIXME(#33013): gdb-command: next
17+
// FIXME(#33013): gdb-check: let f = b"hi bob";
18+
// FIXME(#33013): gdb-command: next
19+
// FIXME(#33013): gdb-check: let g = b'9';
20+
// FIXME(#33013): gdb-command: next
21+
// FIXME(#33013): gdb-check: let h = ["whatever"; 8];
22+
// FIXME(#33013): gdb-command: next
23+
// gdb-check: let i = [1,2,3,4];
24+
// gdb-command: next
25+
// gdb-check: let j = (23, "hi");
26+
// gdb-command: next
27+
// gdb-check: let k = 2..3;
28+
// gdb-command: next
29+
// gdb-check: let l = &i[k];
30+
// gdb-command: next
31+
// gdb-check: let m: *const() = &a;
32+
33+
fn main () {
34+
let a = (); // #break
35+
let b : [i32; 0] = [];
36+
let mut c = 27;
37+
let d = c = 99;
38+
let e = "hi bob";
39+
let f = b"hi bob";
40+
let g = b'9';
41+
let h = ["whatever"; 8];
42+
let i = [1,2,3,4];
43+
let j = (23, "hi");
44+
let k = 2..3;
45+
let l = &i[k];
46+
let m: *const() = &a;
47+
}

0 commit comments

Comments
 (0)