From: Daniel Xu <dxu@dxuuu.xyz>
To: gdb-patches@sourceware.org, tom@tromey.com
Subject: [PATCH] rust: Fix rust modules test
Date: Fri, 3 Jul 2020 20:27:41 -0700 [thread overview]
Message-ID: <20200704032741.835663-1-dxu@dxuuu.xyz> (raw)
I noticed that the modules test was failing. Some choice use of `nm`
revealed `TWENTY_THREE` was not in the final binary. Rather than trying
to trick the compiler/linker by using magic flags, simply `println!()`
the global.
gdb/testsuite/
* gdb.rust/modules.rs: Prevent linker from discarding test
symbol
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
---
gdb/testsuite/gdb.rust/modules.rs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gdb/testsuite/gdb.rust/modules.rs b/gdb/testsuite/gdb.rust/modules.rs
index 6db082817b..dc2a469b2f 100644
--- a/gdb/testsuite/gdb.rust/modules.rs
+++ b/gdb/testsuite/gdb.rust/modules.rs
@@ -93,4 +93,7 @@ pub mod mod1 {
fn main () {
mod1::inner::innest::f1();
+
+ // Prevent linker from discarding `TWENTY_THREE`
+ println!("{}", TWENTY_THREE);
}
--
2.27.0
next reply other threads:[~2020-07-04 3:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-04 3:27 Daniel Xu [this message]
2020-07-06 9:32 ` Tom de Vries
2020-07-07 5:16 ` Daniel Xu
2020-07-04 3:59 Daniel Xu
2020-07-04 6:44 ` Daniel Xu
2020-07-11 22:14 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200704032741.835663-1-dxu@dxuuu.xyz \
--to=dxu@dxuuu.xyz \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox