gnu /
binutils-gdb /
refs/heads/users/palves/gdbserver-extract-unsigned-integer Fix gdbserver's regcache_raw_read_unsigned on big endian hosts
The regcache_raw_read_unsigned function is memcpy'ing a 32-bit value
directly into a 64-bit variable, which doesn't work on big endian
targets.
Fix this by memcpy'ing to a buffer, and then using
extract_unsigned_integer, just like gdb's version.
gdb/gdbserver/ChangeLog:
2016-02-11 Pedro Alves <palves@redhat.com>
* Makefile.in (SFILES): Add $(srcdir)/common/gdb-byteswap.c.
(gdb-byteswap.o): New rule.
* regcache.c: Include "gdb-byteswap.h".
(host_bfd_endian): New function.
(regcache_raw_read_unsigned): Use extract_unsigned_integer and
host_bfd_endian.
2 files changed