From: Jim Kingdon Date: Mon, 29 Apr 1991 05:27:04 +0000 (+0000) Subject: * param-no-tm.h: Make BITS_BIG_ENDIAN defined to 0/1, not defined X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=122ad9abf278d8b86f00d33ff6c1c2e450d4ffc3;p=binutils-gdb.git * param-no-tm.h: Make BITS_BIG_ENDIAN defined to 0/1, not defined or not defined. Don't define it based on TARGET_BYTE_ORDER if it's already defined (in the tm.h file). mips-opcode.h (BIT_FIELDS_*), values.c (modify_field, unpack_field_as_long): Use #if BITS_BIG_ENDIAN not #ifdef BITS_BIG_ENDIAN. --- diff --git a/gdb/mips-opcode.h b/gdb/mips-opcode.h index fd92c78f9a1..a65678a941d 100755 --- a/gdb/mips-opcode.h +++ b/gdb/mips-opcode.h @@ -21,7 +21,7 @@ You should have received a copy of the GNU General Public License along with GDB; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef BITS_BIG_ENDIAN +#if BITS_BIG_ENDIAN #define BIT_FIELDS_2(a,b) a;b; #define BIT_FIELDS_4(a,b,c,d) a;b;c;d; #define BIT_FIELDS_6(a,b,c,d,e,f) a;b;c;d;e;f; diff --git a/gdb/param-no-tm.h b/gdb/param-no-tm.h index 1a35e529e55..f0a897be440 100755 --- a/gdb/param-no-tm.h +++ b/gdb/param-no-tm.h @@ -36,13 +36,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ debugging symbols and such. Conceptually, it's quite separate from byte/word byte order. */ +#if !defined (BITS_BIG_ENDIAN) #if TARGET_BYTE_ORDER == BIG_ENDIAN #define BITS_BIG_ENDIAN 1 -#endif +#endif /* Big endian. */ #if TARGET_BYTE_ORDER == LITTLE_ENDIAN -/*#define BITS_BIG_ENDIAN */ -#endif +#define BITS_BIG_ENDIAN 0 +#endif /* Little endian. */ +#endif /* BITS_BIG_ENDIAN not defined. */ /* Swap LEN bytes at BUFFER between target and host byte-order. */ #if TARGET_BYTE_ORDER == HOST_BYTE_ORDER diff --git a/gdb/values.c b/gdb/values.c index e4578a0cd5f..2981265b571 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -1277,7 +1277,7 @@ unpack_field_as_long (type, valaddr, fieldno) SWAP_TARGET_AND_HOST (&val, sizeof val); /* Extracting bits depends on endianness of the machine. */ -#ifdef BITS_BIG_ENDIAN +#if BITS_BIG_ENDIAN val = val >> (sizeof val * 8 - bitpos % 8 - bitsize); #else val = val >> (bitpos % 8); @@ -1309,7 +1309,7 @@ modify_field (addr, fieldval, bitpos, bitsize) SWAP_TARGET_AND_HOST (&oword, sizeof oword); /* To host format */ /* Shifting for bit field depends on endianness of the target machine. */ -#ifdef BITS_BIG_ENDIAN +#if BITS_BIG_ENDIAN bitpos = sizeof (oword) * 8 - bitpos - bitsize; #endif