Skip to content

Commit ebdc0e3

Browse files
authoredJun 24, 2022
Rollup merge of rust-lang#97085 - rylev:test-issue-33172, r=wesleywiser
Add a test for issue rust-lang#33172 Adds a test confirming that rust-lang#33172 has been fixed. CDB has some surprising results as it looks like the supposedly unmangled static's symbol name is prefixed when it shouldn't be. r? `@wesleywiser` Closes rust-lang#33172
2 parents 7036449 + 23d325e commit ebdc0e3

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
 

‎src/test/debuginfo/no_mangle-info.rs

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// compile-flags:-g
2+
3+
// === GDB TESTS ===================================================================================
4+
// gdb-command:run
5+
// gdb-command:p TEST
6+
// gdb-check:$1 = 3735928559
7+
// gdb-command:p no_mangle_info::namespace::OTHER_TEST
8+
// gdb-check:$2 = 42
9+
10+
// === LLDB TESTS ==================================================================================
11+
// lldb-command:run
12+
// lldb-command:p TEST
13+
// lldb-check: (unsigned long) $0 = 3735928559
14+
// lldb-command:p OTHER_TEST
15+
// lldb-check: (unsigned long) $1 = 42
16+
17+
// === CDB TESTS ==================================================================================
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]
26+
27+
#[no_mangle]
28+
pub static TEST: u64 = 0xdeadbeef;
29+
30+
// FIXME(rylev, wesleywiser): uncommenting this item breaks the test, and we're not sure why
31+
// pub static OTHER_TEST: u64 = 43;
32+
pub mod namespace {
33+
pub static OTHER_TEST: u64 = 42;
34+
}
35+
36+
pub fn main() {
37+
println!("TEST: {}", TEST);
38+
println!("OTHER TEST: {}", namespace::OTHER_TEST); // #break
39+
}

0 commit comments

Comments
 (0)