No description
e98c9e7ce1
PR rust/20162 started life as a reminder to test gdb with versions of rust after 1.8; but now concerns some gdb regressions seen with rust 1.10 ("beta") and 1.11 ("nightly"). The failures turn out to be a discrepancy between how rustc emits DWARF and how gdb interprets it. In particular, rustc will emit DWARF like: <2><bc>: Abbrev Number: 9 (DW_TAG_structure_type) <bd> DW_AT_name : (indirect string, offset: 0x46a): HasMethods <c1> DW_AT_byte_size : 4 ... <3><cc>: Abbrev Number: 11 (DW_TAG_subprogram) ... <df> DW_AT_name : (indirect string, offset: 0x514f): new gdb wants to see a separate top-level DW_TAG_subprogram that refers to this one via DW_AT_specification; but rustc doesn't emit one. By my reading of DWARF 4 5.5.7, this is ok, and gdb is incorrect here. Fixing this involved a new case in scan_partial_symbols, and then a further change in process_structure_scope to account for the fact that, in Rust, such functions are not methods and should not be attached to the structure type. Next, it turns out that rust is emitting bad values for DW_AT_linkage_name, e.g.: <db> DW_AT_linkage_name: (indirect string, offset: 0x422): _ZN7methods8{{impl}}3newE The the "{{impl}}" stuff is apparently some side effect of a change to the compiler's internal representation. Oops! This also had a simple fix -- disregard these mangled names. With these changes, there are no regressions in the gdb Rust tests with either 1.10 or 1.11. 1.9, the stable release, is still pretty broken, but I think there's nothing much to do about that. These changes are a bit hackish, but no worse, I think, than other kinds of quirk handling already done in the DWARF parser. I have reported all the rustc bugs upstream. I plan to remove these hacks from gdb some suitable time after they have been fixed in released versions of Rust. 2016-07-22 Tom Tromey <tom@tromey.com> PR rust/20162: * dwarf2read.c (scan_partial_symbols) <DW_TAG_structure_type>: Call scan_partial_symbols for children when reading a Rust CU. (dwarf2_physname): Ignore invalid DW_AT_linkage_name generated by rustc. (process_structure_scope) <DW_TAG_subprogram>: Call read_func_scope for Rust. |
||
---|---|---|
bfd | ||
binutils | ||
config | ||
cpu | ||
elfcpp | ||
etc | ||
gas | ||
gdb | ||
gold | ||
gprof | ||
include | ||
intl | ||
ld | ||
libdecnumber | ||
libiberty | ||
opcodes | ||
readline | ||
sim | ||
texinfo | ||
zlib | ||
.cvsignore | ||
.gitattributes | ||
.gitignore | ||
ChangeLog | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING.LIB | ||
COPYING.LIBGLOSS | ||
COPYING.NEWLIB | ||
COPYING3 | ||
COPYING3.LIB | ||
depcomp | ||
djunpack.bat | ||
install-sh | ||
libtool.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
lt~obsolete.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
makefile.vms | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
README | ||
README-maintainer-mode | ||
setup.com | ||
src-release.sh | ||
symlink-tree | ||
ylwrap |
README for GNU development tools This directory contains various GNU compilers, assemblers, linkers, debuggers, etc., plus their support routines, definitions, and documentation. If you are receiving this as part of a GDB release, see the file gdb/README. If with a binutils release, see binutils/README; if with a libg++ release, see libg++/README, etc. That'll give you info about this package -- supported targets, how to use it, how to report bugs, etc. It is now possible to automatically configure and build a variety of tools with one command. To build all of the tools contained herein, run the ``configure'' script here, e.g.: ./configure make To install them (by default in /usr/local/bin, /usr/local/lib, etc), then do: make install (If the configure script can't determine your type of computer, give it the name as an argument, for instance ``./configure sun4''. You can use the script ``config.sub'' to test whether a name is recognized; if it is, config.sub translates it to a triplet specifying CPU, vendor, and OS.) If you have more than one compiler on your system, it is often best to explicitly set CC in the environment before running configure, and to also set CC when running make. For example (assuming sh/bash/ksh): CC=gcc ./configure make A similar example using csh: setenv CC gcc ./configure make Much of the code and documentation enclosed is copyright by the Free Software Foundation, Inc. See the file COPYING or COPYING.LIB in the various directories, for a description of the GNU General Public License terms under which you can copy the files. REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info on where and how to report problems.