aboutsummaryrefslogtreecommitdiff
path: root/gdb/values.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-10-06 16:47:32 +0000
committerIan Lance Taylor <ian@airs.com>1994-10-06 16:47:32 +0000
commitb8176214a5bb9810bf6d5244815e9a49c5055dce (patch)
treef85f7b264d7a3748cde6bdf99d131edcaa13da36 /gdb/values.c
parent97d3151a59022d8d76fd29100052645bd8d99c6b (diff)
downloadgdb-b8176214a5bb9810bf6d5244815e9a49c5055dce.zip
gdb-b8176214a5bb9810bf6d5244815e9a49c5055dce.tar.gz
gdb-b8176214a5bb9810bf6d5244815e9a49c5055dce.tar.bz2
* defs.h: If TARGET_BYTE_ORDER_SELECTABLE is defined by tm.h,
define TARGET_BYTE_ORDER as target_byte_order, and declare target_byte_order as an extern int, and define BITS_BIG_ENDIAN as a test of TARGET_BYTE_ORDER. * top.c: Several additions if TARGET_BYTE_ORDER_SELECTABLE is defined: (endianlist, target_byte_order): New variables. (set_endian, set_endian_big, set_endian_little): New functions. (show_endian): New function. (init_cmd_lists): Initialize endianlist. (init_main): Add commands ``set endian big'', ``set endian little'', and ``show endian''. * a29k-pinsn.c: Rewrite uses of TARGET_BYTE_ORDER and BITS_BIG_ENDIAN to switch at run time rather than at compile time. * coffread.c, dwarfread.c, findvar.c, mips-tdep.c: Likewise. * remote-os9k.c, stabsread.c, valarith.c, valprint.c: Likewise. * values.c: Likewise. * mips-tdep.c: Rewrite uses of GDB_TARGET_IS_MIPS64 to switch at run time rather than at compile time.
Diffstat (limited to 'gdb/values.c')
-rw-r--r--gdb/values.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gdb/values.c b/gdb/values.c
index 81fa4e7..916bf6f 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -1249,11 +1249,10 @@ unpack_field_as_long (type, valaddr, fieldno)
/* Extract bits. See comment above. */
-#if BITS_BIG_ENDIAN
- lsbcount = (sizeof val * 8 - bitpos % 8 - bitsize);
-#else
- lsbcount = (bitpos % 8);
-#endif
+ if (BITS_BIG_ENDIAN)
+ lsbcount = (sizeof val * 8 - bitpos % 8 - bitsize);
+ else
+ lsbcount = (bitpos % 8);
val >>= lsbcount;
/* If the field does not entirely fill a LONGEST, then zero the sign bits.
@@ -1300,9 +1299,8 @@ modify_field (addr, fieldval, bitpos, bitsize)
oword = extract_signed_integer (addr, sizeof oword);
/* Shifting for bit field depends on endianness of the target machine. */
-#if BITS_BIG_ENDIAN
- bitpos = sizeof (oword) * 8 - bitpos - bitsize;
-#endif
+ if (BITS_BIG_ENDIAN)
+ bitpos = sizeof (oword) * 8 - bitpos - bitsize;
/* Mask out old value, while avoiding shifts >= size of oword */
if (bitsize < 8 * sizeof (oword))