3 // We only test Rust-aware versions of GDB:
4 // min-gdb-version: 8.2
6 // === GDB TESTS ===================================================================================
10 // gdb-command: print _ref
11 // gdb-check: $1 = (*mut ()) 0x[...]
13 // gdb-command: print _ptr
14 // gdb-check: $2 = (*mut ()) 0x[...]
16 // gdb-command: print _local
19 // gdb-command: print _field
20 // gdb-check: $4 = unit_type::_TypeContainingUnitField {_a: 123, _unit: (), _b: 456}
22 // Check that we can cast "void pointers" to their actual type in the debugger
23 // gdb-command: print /x *(_ptr as *const u64)
24 // gdb-check: $5 = 0x1122334455667788
26 // === CDB TESTS ===================================================================================
29 // cdb-check: Breakpoint 0 hit
31 // cdb-command: dx _ref
32 // cdb-check: _ref : 0x[...] : () [Type: tuple$<> *]
34 // cdb-command: dx _ptr
35 // cdb-check: _ptr : 0x[...] : () [Type: tuple$<> *]
37 // cdb-command: dx _local
38 // cdb-check: _local : () [Type: tuple$<>]
40 // cdb-command: dx _field,d
41 // cdb-check: _field,d [Type: unit_type::_TypeContainingUnitField]
42 // cdb-check: [+0x[...]] _a : 123 [Type: unsigned int]
43 // cdb-check: [+0x[...]] _unit : () [Type: tuple$<>]
44 // cdb-check: [+0x[...]] _b : 456 [Type: unsigned __int64]
46 // Check that we can cast "void pointers" to their actual type in the debugger
47 // cdb-command: dx ((__int64 *)_ptr),x
48 // cdb-check: ((__int64 *)_ptr),x : 0x[...] : 0x1122334455667788 [Type: __int64 *]
49 // cdb-check: 0x1122334455667788 [Type: __int64]
51 struct _TypeContainingUnitField {
57 fn foo(_ref: &(), _ptr: *const ()) {
59 let _field = _TypeContainingUnitField { _a: 123, _unit: (), _b: 456 };
65 let pointee = 0x1122_3344_5566_7788i64;
67 foo(&(), &pointee as *const i64 as *const ());