This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Fix qualified name lookup for Rust
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Fri, 19 Jan 2018 17:47:02 -0500
- Subject: [binutils-gdb] Fix qualified name lookup for Rust
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT fcfcc376969c4d7a6d20827c47b584db389a32b9 ***
Author: Tom Tromey <tom@tromey.com>
Branch: master
Commit: fcfcc376969c4d7a6d20827c47b584db389a32b9
Fix qualified name lookup for Rust
In https://github.com/rust-lang/rust/pull/46457, "m4b" pointed out
that the Rust support in gdb doesn't properly handle the lookup of
qualified names.
In particular, as shown in the test case in this patch, something like
"::NAME" should be found in the global scope, but is not.
This turns out to happen because rust_lookup_symbol_nonlocal does not
search the global scope unless the name in question is unqualified.
However, lookup_symbol_aux does not search the global scope, and
appears to search the static scope only as a fallback (I wonder if
this is needed?).
This patch fixes the problem by changing rust_lookup_symbol_nonlocal
to search the static and global blocks in more cases.
Regression tested against various versions of the rust compiler on
Fedora 26 x86-64. (Note that there are unrelated failures with newer
versions of rustc; I will be addressing those separately.)
2018-01-19 Tom Tromey <tom@tromey.com>
* rust-lang.c (rust_lookup_symbol_nonlocal): Look up qualified
symbols in the static and global blocks.
2018-01-19 Tom Tromey <tom@tromey.com>
* gdb.rust/modules.rs (TWENTY_THREE): New global.
* gdb.rust/modules.exp: Add ::-qualified lookup test.
- Follow-Ups:
- Failures on RHEL-s390x-m64, branch master
- Failures on Debian-s390x-m64, branch master
- Failures on Fedora-x86_64-m32, branch master
- Failures on Debian-s390x-native-extended-gdbserver-m64, branch master
- Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master
- Failures on Fedora-i686, branch master
- Failures on Debian-s390x-native-gdbserver-m64, branch master
- Failures on Fedora-x86_64-cc-with-index, branch master
- Failures on Fedora-x86_64-native-gdbserver-m64, branch master
- Failures on Fedora-s390x-m64, branch master
- Failures on Ubuntu-AArch64-native-gdbserver-m64, branch master
- Failures on Ubuntu-AArch32-native-extended-gdbserver-m32, branch master
- Failures on Ubuntu-AArch32-native-gdbserver-m32, branch master
- Failures on Ubuntu-AArch32-m32, branch master