mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
1b00ef063f
On openSUSE Leap 15.2, I run into this FAIL with target board readnow and test-case gdb.dwarf2/dw2-align.exp: ... (gdb) set lang c++^M Warning: the current language does not match this frame.^M (gdb) FAIL: gdb.dwarf2/dw2-align.exp: set lang c++ ... Adding some extra debugging shows that the current language differs without and with readnow: ... Breakpoint 1, 0x00000000004004ab in main ()^M (gdb) show lang^M -The current source language is "auto; currently c".^M +The current source language is "auto; currently asm".^M ... This is explained by find_pc_compunit_symtab (0x4004ab) called from select_frame, which: - without readnow: returns NULL, and - with readnow: returns the symtab for the CU crtn.S, wich has language "MIPS assembler". In the former case, the symtab for crtn.S is not expanded, and find_pc_compunit_symtab hits the default NULL return. In the latter case, the symtab for crtn.S is expanded, and the "best match" loop in find_pc_compunit_symtab returns that symtab as its best match. The GLOBAL_BLOCK for crtn.S has these outer limits of the address range: ... (gdb) p /x b.startaddr $6 = 0x4003c2 (gdb) p /x b.endaddr $7 = 0x40053d ... and 0x4004ab indeed fits in that range, which explains why the CU is considered a match. However, the actual address ranges for the CU are: ... 00000040 ffffffffffffffff 0000000000000000 (base address) 00000040 00000000004003c2 00000000004003c7 00000040 0000000000400538 000000000040053d 00000040 <End of list> ... which confirms that the CU should not be considered a match. The problem is that the "best match" loop is based on the assumption that a symtab with a better match will be found, but in this case we don't find a better match because there's no debug info describing main. Fix this by preferring to use the addres map in the "best match" loop, which will accurately tell us that addrmap_find (bv.map, 0x4004ab) == NULL. Tested on x86_64-linux (that is, openSUSE Leap 15.2), with and without readnow. In the case of a readnow run, brings down the number of unexpected failures from 66 to 38. The FAIL does not reproduce on f.i. Ubuntu 18.04.5, because there the exec does not contain debug info for crtn.S. The dwarf assembly test-case mimics the scenario described above, and reproduces the FAIL with and without -readnow, for both mentioned OS configurations. Also fixes PR25980 - "Overlapping Dwarf Compile Units with non-overlapping subranges gives incorrect line information". gdb/ChangeLog: 2020-10-28 Tom de Vries <tdevries@suse.de> PR symtab/26772 * symtab.c (find_pc_sect_compunit_symtab): In case there's an address map, check it in the "best match" loop. gdb/testsuite/ChangeLog: 2020-10-28 Tom de Vries <tdevries@suse.de> PR symtab/26772 * gdb.dwarf2/dw2-ranges-overlap.c: New test. * gdb.dwarf2/dw2-ranges-overlap.exp: New file. |
||
---|---|---|
bfd | ||
binutils | ||
config | ||
contrib | ||
cpu | ||
elfcpp | ||
etc | ||
gas | ||
gdb | ||
gdbserver | ||
gdbsupport | ||
gnulib | ||
gold | ||
gprof | ||
include | ||
intl | ||
ld | ||
libctf | ||
libdecnumber | ||
libiberty | ||
opcodes | ||
readline | ||
sim | ||
texinfo | ||
zlib | ||
.cvsignore | ||
.gitattributes | ||
.gitignore | ||
ar-lib | ||
ChangeLog | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING3 | ||
COPYING3.LIB | ||
COPYING.LIB | ||
COPYING.LIBGLOSS | ||
COPYING.NEWLIB | ||
depcomp | ||
djunpack.bat | ||
install-sh | ||
libtool.m4 | ||
lt~obsolete.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
makefile.vms | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
README | ||
README-maintainer-mode | ||
setup.com | ||
src-release.sh | ||
symlink-tree | ||
test-driver | ||
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.