aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-os9k.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/remote-os9k.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/remote-os9k.c')
-rw-r--r--gdb/remote-os9k.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/gdb/remote-os9k.c b/gdb/remote-os9k.c
index cf4cd9b..a3f6774 100644
--- a/gdb/remote-os9k.c
+++ b/gdb/remote-os9k.c
@@ -270,13 +270,11 @@ get_hex_regs (n, regno)
val = 0;
for (j = 0; j < 4; j++)
{
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
- get_hex_byte(&b);
- val = (val << 8) + b;
-#else
- get_hex_byte(&b);
- val = val + (b << (j*8));
-#endif
+ get_hex_byte (&b);
+ if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ val = (val << 8) + b;
+ else
+ val = val + (b << (j*8));
}
supply_register (regno++, (char *) &val);
}
@@ -577,13 +575,11 @@ rombug_fetch_registers ()
val = 0;
for (j = 0; j < 2; j++)
{
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
- get_hex_byte(&b);
- val = (val << 8) + b;
-#else
- get_hex_byte(&b);
- val = val + (b << (j*8));
-#endif
+ get_hex_byte (&b);
+ if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ val = (val << 8) + b;
+ else
+ val = val + (b << (j*8));
}
if (regno == 8) i = 10;
@@ -640,13 +636,11 @@ rombug_fetch_register (regno)
val = 0;
for (j = 0; j < 2; j++)
{
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
- get_hex_byte(&b);
- val = (val << 8) + b;
-#else
- get_hex_byte(&b);
- val = val + (b << (j*8));
-#endif
+ get_hex_byte (&b);
+ if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ val = (val << 8) + b;
+ else
+ val = val + (b << (j*8));
}
supply_register (regno, (char *) &val);
}