Go to file
Tom de Vries a1aaf801d5 [gdb/testsuite] Fix gdb.cp/casts.exp with -m32
When running test-case gdb.cp/casts.exp with target board unix/-m32, I run
into:
...
(gdb) print (unsigned long long) &gd == gd_value^M
$31 = false^M
(gdb) FAIL: gdb.cp/casts.exp: print (unsigned long long) &gd == gd_value
...

With some additional printing, we can see in more detail why the comparison
fails:
...
(gdb) print /x &gd^M
$31 = 0xffffc5c8^M
(gdb) PASS: gdb.cp/casts.exp: print /x &gd
print /x (unsigned long long)&gd^M
$32 = 0xffffc5c8^M
(gdb) PASS: gdb.cp/casts.exp: print /x (unsigned long long)&gd
print /x gd_value^M
$33 = 0xffffffffffffc5c8^M
(gdb) PASS: gdb.cp/casts.exp: print /x gd_value
print (unsigned long long) &gd == gd_value^M
$34 = false^M
(gdb) FAIL: gdb.cp/casts.exp: print (unsigned long long) &gd == gd_value
...

The gd_value is set by this assignment:
...
  unsigned long long gd_value = (unsigned long long) &gd;
...

The problem here is directly casting from a pointer to a non-pointer-sized
integer.

Fix this by adding an intermediate cast to std::uintptr_t.

Tested on x86_64-linux with native and target board unix/-m32.
2022-05-08 19:38:13 +02:00
bfd Automatic date update in version.in 2022-05-08 00:00:21 +00:00
binutils Dwarf: rename yet another instance of "index" 2022-05-04 08:36:14 +02:00
config
contrib
cpu opcodes: don't assume ELF in riscv, csky, rl78, mep disassemblers 2022-04-30 19:21:11 +09:30
elfcpp
etc
gas x86: Disable 2 tests with large memory requirement 2022-04-27 11:51:35 -07:00
gdb [gdb/testsuite] Fix gdb.cp/casts.exp with -m32 2022-05-08 19:38:13 +02:00
gdbserver Fix build failure for aarch64 gdbserver 2022-05-04 15:36:47 +01:00
gdbsupport gdbsupport/pathstuff.h: #include <array> explicitly for std::array<> 2022-04-25 17:06:09 -07:00
gnulib gnulib: update to bd11400942d6 2022-05-02 10:54:19 -04:00
gold
gprof
gprofng gprofng: use $host instead $target 2022-05-05 10:12:12 -07:00
include LTO: Handle __real_SYM reference in IR 2022-05-04 16:26:51 -07:00
intl
ld Re: Fix new linker testsuite failures due to rwx segment test problems 2022-05-07 15:15:20 +09:30
libbacktrace
libctf libctf: impose an ordering on conflicting types 2022-04-28 11:47:12 +01:00
libdecnumber
libiberty
opcodes Fix multiple ubsan warnings in i386-dis.c 2022-05-07 17:32:25 +09:30
readline gdb/readline: fix extra 'quit' message problem 2022-05-07 10:49:27 +01:00
sim
texinfo
zlib
.cvsignore
.editorconfig
.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.