From 17c079625c1f8ccd91a9a810e3bd8af73e67ebe8 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sat, 14 Mar 2026 00:03:43 +0100 Subject: [PATCH] tests/debuginfo/basic-stepping.rs: Add cdb test --- tests/debuginfo/basic-stepping.rs | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/debuginfo/basic-stepping.rs b/tests/debuginfo/basic-stepping.rs index 6aa8aeceb1e69..c82120e8a426a 100644 --- a/tests/debuginfo/basic-stepping.rs +++ b/tests/debuginfo/basic-stepping.rs @@ -88,6 +88,45 @@ //@ lldb-command: frame select //@ lldb-check: [...]let m: *const() = &a;[...] +// === CDB TESTS =================================================================================== + +// Enable source line support. See +// https://learn.microsoft.com/en-us/windows-hardware/drivers/debuggercmds/-lines--toggle-source-line-support-. +//@ cdb-command: .lines -e +// Display source lines and source line numbers at the command prompt. See +// https://learn.microsoft.com/en-us/windows-hardware/drivers/debuggercmds/l---l---set-source-options-. +//@ cdb-command: l+s +// Enter "source mode" so `p` steps source lines and not assembly instructions. +//@ cdb-command: l+t + +// `g` means "go". See +// https://learn.microsoft.com/en-us/windows-hardware/drivers/debuggercmds/g--go-. +//@ cdb-command: g +// `p` means "step". See +// https://learn.microsoft.com/en-us/windows-hardware/drivers/debuggercmds/p--step-. +//@ cdb-command: p +//@ cdb-check: [...]: let mut c = 27; +//@ cdb-command: p +//@ cdb-check: [...]: let d = c = 99; +//@ [no-SingleUseConsts-mir-pass] cdb-command: p +//@ [no-SingleUseConsts-mir-pass] cdb-check: [...]: let e = "hi bob"; +//@ [no-SingleUseConsts-mir-pass] cdb-command: p +//@ [no-SingleUseConsts-mir-pass] cdb-check: [...]: let f = b"hi bob"; +//@ [no-SingleUseConsts-mir-pass] cdb-command: p +//@ [no-SingleUseConsts-mir-pass] cdb-check: [...]: let g = b'9'; +//@ cdb-command: p +//@ cdb-check: [...]: let h = ["whatever"; 8]; +//@ cdb-command: p +//@ cdb-check: [...]: let i = [1,2,3,4]; +//@ cdb-command: p +//@ cdb-check: [...]: let j = (23, "hi"); +//@ cdb-command: p +//@ cdb-check: [...]: let k = 2..3; +//@ cdb-command: p +//@ cdb-check: [...]: let l = &i[k]; +//@ cdb-command: p +//@ cdb-check: [...]: let m: *const() = &a; + #![allow(unused_assignments, unused_variables)] fn main () {