Binutils with MCST patches
08f49010a1
There was a difference between C++ dispatch table and Ada's in the way the Offset_To_Top field is used to determined the base address of an object: * in C++ it is a negative offset, so converting abstract interface to deriving object requires adding this offset to “this”; * in Ada, it was a positive offset, so the same conversion required subtracting the offset value. So in ada, the base address for a tagged type was computed using this formula: base_address = value_address (obj) - offset_to_top; The offset_to_top value was previously set to 0 or a positive value. With recent version of AdaCore's GNAT compiler, the offset has been changed to match C++, which means it's set to zero or a negative value As a result, the new formula has to be: base_address = value_address (obj) + offset_to_top; Because we want to support old code compiled before GNAT compiler change done in 19.0w (20171023-64) with this version and future versions of gdb, then we change the sign of the offset_to_top if required. Required here means if offset_to_top is positive since it indicates that the code has been compiled with an old GNAT compiler. This patch changes the formula as described above. Also, one side-effect of offset_to_top now being negative is that we now have to worry about the sign when we read its value from the inferior. Up to now, we have been reading its value using the data address builtin type. But since addresses are not always signed, we now need to make sure we use the proper type (type Storage_Offset from System.Storage_Elements). Ideally, we would be looking this type up from the inferior, and then use that type. However, it is not guaranteed that this type always be described in the debugging information, so this patch just builds our own, adding it to Ada's list of primitive types. gdb/ChangeLog: * ada-lang.c (ada_tag_value_at_base_address): Change the way tagged type base address is computed. (enum ada_primitive_types) <ada_primitive_type_storage_offset>: New enumerate. (ada_language_arch_info): Set the ada_primitive_type_storage_offset element of lai->primitive_type_vector. Tested on x86_64-linux. Fixes the following tests when using the newer version of the compiler. gdb.ada/iwide.exp: print My_Drawable gdb.ada/iwide.exp: print d_access.all gdb.ada/iwide.exp: print dp_access.all gdb.ada/mi_interface.exp: create ggg1 varobj (unexpected output) gdb.ada/mi_interface.exp: list ggg1's children (unexpected output) gdb.mi/mi-var-rtti.exp: run to mi-var-rtti.cc:63 (set breakpoint) (unexpected output) gdb.mi/mi-var-rtti.exp: run to mi-var-rtti.cc:63 (set breakpoint) |
||
---|---|---|
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 | ||
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 | ||
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.