From: Michael Snyder Date: Fri, 23 Oct 2009 23:42:25 +0000 (+0000) Subject: 2009-10-23 Michael Snyder X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6aa96d0323ef70bdc80e08022abf2fe32cef5eee;p=binutils-gdb.git 2009-10-23 Michael Snyder * record.c (top level): Don't include byteswap.h. (netorder64): Use store_unsigned_integer instead of bswap_64. (netorder32): Use store_unsigned_integer instead of bswap_32. (netorder16): Use store_unsigned_integer instead of bswap_16. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 76935ca048a..46196b8988d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -7,6 +7,13 @@ * record.c (record_core_xfer_partial): Pass correct offset to record_beneath_to_xfer_partial. +2009-10-23 Michael Snyder + + * record.c (top level): Don't include byteswap.h. + (netorder64): Use store_unsigned_integer instead of bswap_64. + (netorder32): Use store_unsigned_integer instead of bswap_32. + (netorder16): Use store_unsigned_integer instead of bswap_16. + 2009-10-23 Michael Snyder * record.c (netorder64): Use BFD_ENDIAN_LITTLE not LITTLE_ENDIAN. diff --git a/gdb/record.c b/gdb/record.c index 946ebf1108d..808a3597c81 100644 --- a/gdb/record.c +++ b/gdb/record.c @@ -31,7 +31,6 @@ #include "elf-bfd.h" #include "gcore.h" -#include #include /* This module implements "target record", also known as "process @@ -1956,27 +1955,33 @@ bfdcore_read (bfd *obfd, asection *osec, void *buf, int len, int *offset) } static inline uint64_t -netorder64 (uint64_t fromfile) +netorder64 (uint64_t input) { - return (BYTE_ORDER == BFD_ENDIAN_LITTLE) - ? bswap_64 (fromfile) - : fromfile; + uint64_t ret; + + store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret), + BFD_ENDIAN_BIG, input); + return ret; } static inline uint32_t -netorder32 (uint32_t fromfile) +netorder32 (uint32_t input) { - return (BYTE_ORDER == BFD_ENDIAN_LITTLE) - ? bswap_32 (fromfile) - : fromfile; + uint32_t ret; + + store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret), + BFD_ENDIAN_BIG, input); + return ret; } static inline uint16_t -netorder16 (uint16_t fromfile) +netorder16 (uint16_t input) { - return (BYTE_ORDER == BFD_ENDIAN_LITTLE) - ? bswap_16 (fromfile) - : fromfile; + uint16_t ret; + + store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret), + BFD_ENDIAN_BIG, input); + return ret; } /* Restore the execution log from a core_bfd file. */