|
4 | 4 | // gdb-command:run |
5 | 5 | // gdb-command:whatis TEST |
6 | 6 | // gdb-check:type = u64 |
| 7 | +// gdb-command:whatis no_mangle_info::namespace::OTHER_TEST |
| 8 | +// gdb-check:type = u64 |
7 | 9 |
|
8 | 10 | // === LLDB TESTS ================================================================================== |
9 | 11 | // lldb-command:run |
10 | 12 | // lldb-command:expr TEST |
11 | 13 | // lldb-check: (unsigned long) $0 = 3735928559 |
| 14 | +// lldb-command:expr no_mangle_test::namespace::OTHER_TEST |
| 15 | +// lldb-check: (unsigned long) $0 = 42 |
12 | 16 |
|
13 | 17 | // === CDB TESTS ================================================================================== |
14 | | -// FIXME: This does not currently work due to a bug in LLVM |
15 | | -// The fix for this is being tracked in rust-lang/rust#98295 |
16 | | -// // cdb-command: g |
17 | | -// // cdb-command: dx a!no_mangle_info::TEST |
18 | | -// // cdb-check: a!no_mangle_info::TEST : 0xdeadbeef [Type: unsigned __int64] |
| 18 | +// cdb-command: g |
| 19 | +// Note: LLDB and GDB allow referring to items that are in the same namespace of the symbol |
| 20 | +// we currently have a breakpoint on in an unqualified way. CDB does not, and thus we need to |
| 21 | +// refer to it in a fully qualified way. |
| 22 | +// cdb-command: dx a!no_mangle_info::TEST |
| 23 | +// cdb-check: a!no_mangle_info::TEST : 0xdeadbeef [Type: unsigned __int64] |
| 24 | +// cdb-command: dx a!no_mangle_info::namespace::OTHER_TEST |
| 25 | +// cdb-check: a!no_mangle_info::namespace::OTHER_TEST : 0x2a [Type: unsigned __int64] |
19 | 26 |
|
20 | 27 | #[no_mangle] |
21 | 28 | pub static TEST: u64 = 0xdeadbeef; |
22 | 29 |
|
| 30 | +pub mod namespace { |
| 31 | + pub static OTHER_TEST: u64 = 42; |
| 32 | +} |
| 33 | + |
23 | 34 | pub fn main() { |
24 | | - println!("TEST: {}", TEST); // #break |
| 35 | + println!("TEST: {}", TEST); |
| 36 | + println!("OTHER TEST: {}", namespace::OTHER_TEST); // #break |
25 | 37 | } |
0 commit comments