* defs.h (SWAP_TARGET_AND_HOST): check endianess at runtime not
compile time.
This commit is contained in:
parent
abed6bc2e1
commit
66aa7cf935
2 changed files with 19 additions and 15 deletions
|
@ -1,5 +1,8 @@
|
||||||
Tue Feb 28 14:38:39 1995 Kung Hsu <kung@mexican.cygnus.com>
|
Tue Feb 28 14:38:39 1995 Kung Hsu <kung@mexican.cygnus.com>
|
||||||
|
|
||||||
|
* defs.h (SWAP_TARGET_AND_HOST): check endianess at runtime not
|
||||||
|
compile time.
|
||||||
|
|
||||||
* arc-tdep.c (_initialize_arc_tdep): set tm_print_insn according to
|
* arc-tdep.c (_initialize_arc_tdep): set tm_print_insn according to
|
||||||
processor.
|
processor.
|
||||||
* remote-arc.c (arc_wait): when a processor stops, stop other two
|
* remote-arc.c (arc_wait): when a processor stops, stop other two
|
||||||
|
|
17
gdb/defs.h
17
gdb/defs.h
|
@ -741,22 +741,23 @@ extern void set_endian_from_file PARAMS ((bfd *));
|
||||||
#endif /* BITS_BIG_ENDIAN not defined. */
|
#endif /* BITS_BIG_ENDIAN not defined. */
|
||||||
|
|
||||||
/* Swap LEN bytes at BUFFER between target and host byte-order. */
|
/* Swap LEN bytes at BUFFER between target and host byte-order. */
|
||||||
#if TARGET_BYTE_ORDER == HOST_BYTE_ORDER
|
|
||||||
#define SWAP_TARGET_AND_HOST(buffer,len)
|
|
||||||
#else /* Target and host byte order differ. */
|
|
||||||
#define SWAP_TARGET_AND_HOST(buffer,len) \
|
#define SWAP_TARGET_AND_HOST(buffer,len) \
|
||||||
|
do \
|
||||||
{ \
|
{ \
|
||||||
char __tmp_; \
|
if (TARGET_BYTE_ORDER != HOST_BYTE_ORDER) \
|
||||||
|
{ \
|
||||||
|
char tmp; \
|
||||||
char *p = (char *)(buffer); \
|
char *p = (char *)(buffer); \
|
||||||
char *q = ((char *)(buffer)) + len - 1; \
|
char *q = ((char *)(buffer)) + len - 1; \
|
||||||
for (; p < q; p++, q--) \
|
for (; p < q; p++, q--) \
|
||||||
{ \
|
{ \
|
||||||
__tmp_ = *q; \
|
tmp = *q; \
|
||||||
*q = *p; \
|
*q = *p; \
|
||||||
*p = __tmp_; \
|
*p = tmp; \
|
||||||
} \
|
} \
|
||||||
}
|
} \
|
||||||
#endif /* Target and host byte order differ. */
|
} \
|
||||||
|
while (0)
|
||||||
|
|
||||||
/* In findvar.c. */
|
/* In findvar.c. */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue