diff options
author | Daniel Xu <dxu@dxuuu.xyz> | 2020-07-03 20:59:53 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-07-11 16:08:28 -0600 |
commit | 0ed35c9ae0434dcda2d5d3e3f0be77fa1f323283 (patch) | |
tree | 09201e2d9fbc53f00bfc056ba356c1eac3258ae8 /gdb | |
parent | 0a278aa7552de49be4816409a793c2403f6e87be (diff) | |
download | gdb-0ed35c9ae0434dcda2d5d3e3f0be77fa1f323283.zip gdb-0ed35c9ae0434dcda2d5d3e3f0be77fa1f323283.tar.gz gdb-0ed35c9ae0434dcda2d5d3e3f0be77fa1f323283.tar.bz2 |
rust: Fix rust modules test
I noticed that the modules test was failing. Some choice use of `nm`
revealed `TWENTY_THREE` was not in the final binary. Fix by taking a
pointer to the global, forcing the linker to keep the symbol in.
gdb/testsuite/ChangeLog
2020-07-11 Daniel Xu <dxu@dxuuu.xyz>
PR rust/26121
* gdb.rust/modules.rs: Prevent linker from discarding test
symbol.
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.rust/modules.rs | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c0f1f1c..ec0f832 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2020-07-11 Daniel Xu <dxu@dxuuu.xyz> + + PR rust/26121 + * gdb.rust/modules.rs: Prevent linker from discarding test + symbol. + 2020-07-10 Pedro Alves <pedro@palves.net> PR gdb/26199 diff --git a/gdb/testsuite/gdb.rust/modules.rs b/gdb/testsuite/gdb.rust/modules.rs index 6db0828..479e652 100644 --- a/gdb/testsuite/gdb.rust/modules.rs +++ b/gdb/testsuite/gdb.rust/modules.rs @@ -60,7 +60,8 @@ pub mod mod1 { let f2 = || println!("lambda f2"); - let copy = ::TWENTY_THREE; + // Prevent linker from discarding symbol + let ptr: *const u16 = &::TWENTY_THREE; f2(); // set breakpoint here f3(); |