2021-03-30 12:43:39 -05:00
|
|
|
// Testing the display of Mutex and MutexGuard in cdb.
|
|
|
|
|
|
|
|
// cdb-only
|
|
|
|
//@ min-cdb-version: 10.0.21287.1005
|
|
|
|
//@ compile-flags:-g
|
|
|
|
|
|
|
|
// === CDB TESTS ==================================================================================
|
|
|
|
//
|
|
|
|
// cdb-command:g
|
|
|
|
//
|
|
|
|
// cdb-command:dx m,d
|
|
|
|
// cdb-check:m,d [Type: std::sync::mutex::Mutex<i32>]
|
2024-03-12 08:55:06 -05:00
|
|
|
// cdb-check: [...] inner [Type: std::sys::sync::mutex::futex::Mutex]
|
2021-03-30 12:43:39 -05:00
|
|
|
// cdb-check: [...] poison [Type: std::sync::poison::Flag]
|
2021-09-20 14:26:56 -05:00
|
|
|
// cdb-check: [...] data : 0 [Type: core::cell::UnsafeCell<i32>]
|
2021-03-30 12:43:39 -05:00
|
|
|
|
|
|
|
//
|
|
|
|
// cdb-command:dx m.data,d
|
2021-09-20 14:26:56 -05:00
|
|
|
// cdb-check:m.data,d : 0 [Type: core::cell::UnsafeCell<i32>]
|
|
|
|
// cdb-check: [<Raw View>] [Type: core::cell::UnsafeCell<i32>]
|
2021-03-30 12:43:39 -05:00
|
|
|
|
|
|
|
//
|
2022-08-12 10:16:55 -05:00
|
|
|
// cdb-command:dx _lock,d
|
|
|
|
// cdb-check:_lock,d : Ok [Type: enum2$<core::result::Result<std::sync::mutex::MutexGuard<i32>,enum2$<std::sync::poison::TryLockError<std::sync::mutex::MutexGuard<i32> > > > >]
|
2021-03-30 12:43:39 -05:00
|
|
|
// cdb-check: [...] __0 [Type: std::sync::mutex::MutexGuard<i32>]
|
|
|
|
|
|
|
|
use std::sync::Mutex;
|
|
|
|
|
2022-07-07 08:01:43 -05:00
|
|
|
fn main() {
|
2021-03-30 12:43:39 -05:00
|
|
|
let m = Mutex::new(0);
|
2022-08-12 10:16:55 -05:00
|
|
|
let _lock = m.try_lock();
|
|
|
|
|
|
|
|
println!("this line avoids an `Ambiguous symbol error` while setting the breakpoint");
|
|
|
|
|
2021-03-30 12:43:39 -05:00
|
|
|
zzz(); // #break
|
|
|
|
}
|
|
|
|
|
2022-08-12 10:16:55 -05:00
|
|
|
#[inline(never)]
|
2021-03-30 12:43:39 -05:00
|
|
|
fn zzz() {}
|