+2002-01-04 Andrew Cagney <ac131313@redhat.com>
+
+ * defs.h (BIG_ENDIAN): Delete macro definition.
+ * a29k-tdep.c, arch-utils.c, arm-tdep.c, ax-gdb.c, ch-exp.c,
+ coffread.c, cris-tdep.c, d10v-tdep.c, d30v-tdep.c, defs.h,
+ findvar.c, infcmd.c, mem-break.c, mips-tdep.c, mn10300-tdep.c,
+ printcmd.c, remote-os9k.c, remote-rdi.c, remote-rdp.c,
+ remote-sim.c, remote.c, rs6000-tdep.c, sh-tdep.c, sparcl-tdep.c,
+ stabsread.c, valops.c, valprint.c, config/a29k/tm-a29k.h,
+ config/a29k/tm-vx29k.h, config/arm/tm-arm.h,
+ config/d30v/tm-d30v.h, config/fr30/tm-fr30.h,
+ config/h8300/tm-h8300.h, config/h8500/tm-h8500.h,
+ config/m32r/tm-m32r.h, config/m68k/tm-m68k.h,
+ config/m88k/tm-m88k.h, config/mips/tm-mips.h, config/pa/tm-hppa.h,
+ config/sparc/tm-sparc.h, config/z8k/tm-z8k.h, mi/mi-cmd-disas.c,
+ mi/mi-main.c: Replace BIG_ENDIAN with BFD_ENDIAN_BIG.
+ * gdbarch.sh: Replace BIG_ENDIAN with BFD_ENDIAN_BIG.
+ * gdbarch.c: Re-generate.
+
2002-01-04 Daniel Jacobowitz <drow@mvista.com>
* thread-db.c (thread_db_new_objfile): Do not enable thread_db
int
gdb_print_insn_a29k (bfd_vma memaddr, disassemble_info *info)
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
return print_insn_big_a29k (memaddr, info);
else
return print_insn_little_a29k (memaddr, info);
breakpoint. On some machines, breakpoints are handled by the
target environment and we don't have to worry about them here. */
#ifdef BIG_BREAKPOINT
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
static unsigned char big_break_insn[] = BIG_BREAKPOINT;
*lenptr = sizeof (big_break_insn);
}
#endif
#ifdef LITTLE_BREAKPOINT
- if (TARGET_BYTE_ORDER != BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG)
{
static unsigned char little_break_insn[] = LITTLE_BREAKPOINT;
*lenptr = sizeof (little_break_insn);
#endif
switch (byte_order)
{
- case BIG_ENDIAN:
+ case BFD_ENDIAN_BIG:
return &floatformat_ieee_single_big;
case BFD_ENDIAN_LITTLE:
return &floatformat_ieee_single_little;
#endif
switch (byte_order)
{
- case BIG_ENDIAN:
+ case BFD_ENDIAN_BIG:
return &floatformat_ieee_double_big;
case BFD_ENDIAN_LITTLE:
return &floatformat_ieee_double_little;
#ifdef TARGET_BYTE_ORDER_SELECTABLE
/* compat - Catch old targets that expect a selectable byte-order to
- default to BIG_ENDIAN */
+ default to BFD_ENDIAN_BIG */
#ifndef TARGET_BYTE_ORDER_DEFAULT
-#define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
+#define TARGET_BYTE_ORDER_DEFAULT BFD_ENDIAN_BIG
#endif
#endif
#if !TARGET_BYTE_ORDER_SELECTABLE_P
#endif
#endif
#ifndef TARGET_BYTE_ORDER_DEFAULT
-#define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
+#define TARGET_BYTE_ORDER_DEFAULT BFD_ENDIAN_BIG /* arbitrary */
#endif
/* ``target_byte_order'' is only used when non- multi-arch.
Multi-arch targets obtain the current byte order using
{
if (TARGET_BYTE_ORDER_AUTO)
printf_unfiltered ("The target endianness is set automatically (currently %s endian)\n",
- (TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little"));
+ (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "big" : "little"));
else
printf_unfiltered ("The target is assumed to be %s endian\n",
- (TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little"));
+ (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "big" : "little"));
}
static void
{
struct gdbarch_info info;
gdbarch_info_init (&info);
- info.byte_order = BIG_ENDIAN;
+ info.byte_order = BFD_ENDIAN_BIG;
if (! gdbarch_update_p (info))
{
printf_unfiltered ("Big endian target not supported by GDB\n");
}
else
{
- target_byte_order = BIG_ENDIAN;
+ target_byte_order = BFD_ENDIAN_BIG;
}
}
else
int want;
if (bfd_big_endian (abfd))
- want = BIG_ENDIAN;
+ want = BFD_ENDIAN_BIG;
else
want = BFD_ENDIAN_LITTLE;
if (TARGET_BYTE_ORDER_AUTO)
target_byte_order = want;
else if (TARGET_BYTE_ORDER != want)
warning ("%s endian file does not match %s endian target.",
- want == BIG_ENDIAN ? "big" : "little",
- TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little");
+ want == BFD_ENDIAN_BIG ? "big" : "little",
+ TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "big" : "little");
}
else
{
if (bfd_big_endian (abfd)
- ? TARGET_BYTE_ORDER != BIG_ENDIAN
- : TARGET_BYTE_ORDER == BIG_ENDIAN)
+ ? TARGET_BYTE_ORDER != BFD_ENDIAN_BIG
+ : TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
warning ("%s endian file does not match %s endian target.",
bfd_big_endian (abfd) ? "big" : "little",
- TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little");
+ TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "big" : "little");
}
}
switch (default_bfd_vec->byteorder)
{
case BFD_ENDIAN_BIG:
- info.byte_order = BIG_ENDIAN;
+ info.byte_order = BFD_ENDIAN_BIG;
break;
case BFD_ENDIAN_LITTLE:
info.byte_order = BFD_ENDIAN_LITTLE;
if (info.byte_order == BFD_ENDIAN_UNKNOWN)
{
/* Wire it to big-endian!!! */
- info.byte_order = BIG_ENDIAN;
+ info.byte_order = BFD_ENDIAN_BIG;
}
if (GDB_MULTI_ARCH)
{
if (regnum >= F0_REGNUM && regnum < F0_REGNUM + NUM_FREGS)
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
return builtin_type_arm_ext_big;
else
return builtin_type_arm_ext_littlebyte_bigword;
convert_from_extended (void *ptr, void *dbl)
{
DOUBLEST d;
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
floatformat_to_doublest (&floatformat_arm_ext_big, ptr, &d);
else
floatformat_to_doublest (&floatformat_arm_ext_littlebyte_bigword,
{
DOUBLEST d;
floatformat_to_doublest (TARGET_DOUBLE_FORMAT, ptr, &d);
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
floatformat_from_doublest (&floatformat_arm_ext_big, &d, dbl);
else
floatformat_from_doublest (&floatformat_arm_ext_littlebyte_bigword,
else
info->symbols = NULL;
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
return print_insn_big_arm (memaddr, info);
else
return print_insn_little_arm (memaddr, info);
{
if (arm_pc_is_thumb (*pcptr) || arm_pc_is_thumb_dummy (*pcptr))
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
static char thumb_breakpoint[] = THUMB_BE_BREAKPOINT;
*pcptr = UNMAKE_THUMB_ADDR (*pcptr);
}
else
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
static char arm_breakpoint[] = ARM_BE_BREAKPOINT;
*lenptr = sizeof (arm_breakpoint);
the sign/zero extension will wipe them out.
- If we're in the interior of the word, then there is no garbage
on either end, because the ref operators zero-extend. */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
gen_left_shift (ax, end - (offset + op_size));
else
gen_left_shift (ax, offset - start);
else
{
/* Extract bits from digit, packing them into the bitstring byte. */
- int k = TARGET_BYTE_ORDER == BIG_ENDIAN ? bits_per_char - 1 : 0;
- for (; TARGET_BYTE_ORDER == BIG_ENDIAN ? k >= 0 : k < bits_per_char;
- TARGET_BYTE_ORDER == BIG_ENDIAN ? k-- : k++)
+ int k = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? bits_per_char - 1 : 0;
+ for (; TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? k >= 0 : k < bits_per_char;
+ TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? k-- : k++)
{
bitcount++;
if (digit & (1 << k))
{
tempbuf[tempbufindex] |=
- (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
? (1 << (HOST_CHAR_BIT - 1 - bitoffset))
: (1 << bitoffset);
}
SYMBOL_CLASS (sym) = LOC_ARG;
add_symbol_to_list (sym, &local_symbols);
#if !defined (BELIEVE_PCC_PROMOTION)
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
/* If PCC says a parameter is a short or a char,
aligned on an int boundary, realign it to the
la tm-m68k.h). */
/* Byte order is configurable, but this machine runs big-endian. */
-#define TARGET_BYTE_ORDER BIG_ENDIAN
+#define TARGET_BYTE_ORDER BFD_ENDIAN_BIG
/* Floating point uses IEEE representations. */
#define IEEE_FLOAT (1)
We let the command line (or previously included files) override this
setting. */
#ifndef BREAKPOINT
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
+#if TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
#define BREAKPOINT {0x72, 0x50, 0x01, 0x01}
#else /* Target is little-endian. */
#define BREAKPOINT {0x01, 0x01, 0x50, 0x72}
word in target byte order; bits 0-7 and 16-23 of *WORDP are replaced with
bits 0-7 and 8-15 of DATA (which is in host byte order). */
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
+#if TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
#define STUFF_I16(WORDP, DATA) \
{ \
*((char *)(WORDP) + 3) = ((DATA) & 0xff);\
from the msp in the memory stack. If msp is set higher than the dummy code,
an ESF may clobber this code. */
-#if TARGET_BYTE_ORDER == BIG_ENDIAN
+#if TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
#define NOP_INSTR 0x70400101
#else /* Target is little endian */
#define NOP_INSTR 0x01014070
/* IEEE format floating point. */
#define IEEE_FLOAT (1)
-#define TARGET_DOUBLE_FORMAT (target_byte_order == BIG_ENDIAN \
+#define TARGET_DOUBLE_FORMAT (target_byte_order == BFD_ENDIAN_BIG \
? &floatformat_ieee_double_big \
: &floatformat_ieee_double_littlebyte_bigword)
/* Define the bit, byte, and word ordering of the machine. */
-#define TARGET_BYTE_ORDER BIG_ENDIAN
+#define TARGET_BYTE_ORDER BFD_ENDIAN_BIG
/* Offset from address of function to start of its code.
Zero on most machines. */
#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
-#define TARGET_BYTE_ORDER BIG_ENDIAN
+#define TARGET_BYTE_ORDER BFD_ENDIAN_BIG
#define R0_REGNUM 0
#define R1_REGNUM 1
#define IEEE_FLOAT (1)
/* Define the bit, byte, and word ordering of the machine. */
-#define TARGET_BYTE_ORDER BIG_ENDIAN
+#define TARGET_BYTE_ORDER BFD_ENDIAN_BIG
#undef TARGET_INT_BIT
#define TARGET_INT_BIT 16
#undef TARGET_LONG_BIT
/* Define the bit, byte, and word ordering of the machine. */
-#define TARGET_BYTE_ORDER BIG_ENDIAN
+#define TARGET_BYTE_ORDER BFD_ENDIAN_BIG
/* Define the sizes of integers and pointers. */
/* Used by mswin. */
#define TARGET_M32R 1
-/* mvs_check TARGET_BYTE_ORDER BIG_ENDIAN */
-#define TARGET_BYTE_ORDER BIG_ENDIAN
+/* mvs_check TARGET_BYTE_ORDER BFD_ENDIAN_BIG */
+#define TARGET_BYTE_ORDER BFD_ENDIAN_BIG
/* mvs_check REGISTER_NAMES */
#define REGISTER_NAMES \
#define IEEE_FLOAT (1)
/* Define the bit, byte, and word ordering of the machine. */
-#define TARGET_BYTE_ORDER BIG_ENDIAN
+#define TARGET_BYTE_ORDER BFD_ENDIAN_BIG
#define TARGET_LONG_DOUBLE_FORMAT &floatformat_m68881_ext
/* g++ support is not yet included. */
/* Define the bit, byte, and word ordering of the machine. */
-#define TARGET_BYTE_ORDER BIG_ENDIAN
+#define TARGET_BYTE_ORDER BFD_ENDIAN_BIG
/* We cache information about saved registers in the frame structure,
to save us from having to re-scan function prologues every time
between memory and register formats. */
#define REGISTER_CONVERT_TO_TYPE(n, type, buffer) \
- do {if (TARGET_BYTE_ORDER == BIG_ENDIAN \
+ do {if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG \
&& REGISTER_RAW_SIZE (n) == 4 \
&& (n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 \
&& TYPE_CODE(type) == TYPE_CODE_FLT \
memcpy (((char *)(buffer)), __temp, 4); }} while (0)
#define REGISTER_CONVERT_FROM_TYPE(n, type, buffer) \
- do {if (TARGET_BYTE_ORDER == BIG_ENDIAN \
+ do {if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG \
&& REGISTER_RAW_SIZE (n) == 4 \
&& (n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 \
&& TYPE_CODE(type) == TYPE_CODE_FLT \
/* Target system byte order. */
-#define TARGET_BYTE_ORDER BIG_ENDIAN
+#define TARGET_BYTE_ORDER BFD_ENDIAN_BIG
/* By default assume we don't have to worry about software floating point. */
#ifndef SOFT_FLOAT
"y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr" \
}
-#define TARGET_BYTE_ORDER BIG_ENDIAN
+#define TARGET_BYTE_ORDER BFD_ENDIAN_BIG
/* Offset from address of function to start of its code.
Zero on most machines. */
#define TARGET_PTR_BIT (BIG ? 32: 16)
/* Define the bit, byte, and word ordering of the machine. */
-#define TARGET_BYTE_ORDER BIG_ENDIAN
+#define TARGET_BYTE_ORDER BFD_ENDIAN_BIG
/* Offset from address of function to start of its code.
Zero on most machines. */
/* Ok. */
break;
- case BIG_ENDIAN:
+ case BFD_ENDIAN_BIG:
internal_error (__FILE__, __LINE__, "cris_gdbarch_init: big endian byte order in info");
break;
internal_error (__FILE__, __LINE__,
"print_insn: no disassembler");
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
tm_print_insn_info.endian = BFD_ENDIAN_BIG;
else
tm_print_insn_info.endian = BFD_ENDIAN_LITTLE;
set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
switch (info.byte_order)
{
- case BIG_ENDIAN:
+ case BFD_ENDIAN_BIG:
set_gdbarch_float_format (gdbarch, &floatformat_ieee_single_big);
set_gdbarch_double_format (gdbarch, &floatformat_ieee_single_big);
set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big);
internal_error (__FILE__, __LINE__,
"print_insn: no disassembler");
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
tm_print_insn_info.endian = BFD_ENDIAN_BIG;
else
tm_print_insn_info.endian = BFD_ENDIAN_LITTLE;
#endif /* Not GNU C */
#endif /* alloca not defined */
-/* Get a definition of BIG_ENDIAN and BFD_ENDIAN_LITTLE. */
+/* Get a definition of BFD_ENDIAN_BIG and BFD_ENDIAN_LITTLE. */
/* FIXME: cagney/2001-10-31: GDB should just use BFD's definitions. */
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#endif
-#if !defined (BIG_ENDIAN)
-#define BIG_ENDIAN 4321
-#endif
-
/* Dynamic target-system-dependent parameters for GDB. */
#include "gdbarch.h"
#if (GDB_MULTI_ARCH == 0)
from byte/word byte order. */
#if !defined (BITS_BIG_ENDIAN)
-#define BITS_BIG_ENDIAN (TARGET_BYTE_ORDER == BIG_ENDIAN)
+#define BITS_BIG_ENDIAN (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
#endif
/* In findvar.c. */
+2002-01-04 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Replace
+ BIG_ENDIAN with BFD_ENDIAN_BIG.
+
2002-01-03 Andrew Cagney <ac131313@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Replace
@item TARGET_BYTE_ORDER_DEFAULT
@findex TARGET_BYTE_ORDER_DEFAULT
The ordering of bytes in the target. This must be either
-@code{BIG_ENDIAN} or @code{BFD_ENDIAN_LITTLE}. This macro replaces
+@code{BFD_ENDIAN_BIG} or @code{BFD_ENDIAN_LITTLE}. This macro replaces
@code{TARGET_BYTE_ORDER} which is deprecated.
@item TARGET_BYTE_ORDER_SELECTABLE_P
/* Start at the most significant end of the integer, and work towards
the least significant. */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
p = startaddr;
/* Do the sign extension once at the start. */
/* Start at the most significant end of the integer, and work towards
the least significant. */
retval = 0;
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = startaddr; p < endaddr; ++p)
retval = (retval << 8) | *p;
int len;
len = orig_len;
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = (char *) addr;
len > (int) sizeof (LONGEST) && p < (char *) addr + orig_len;
/* Start at the least significant end of the integer, and work towards
the most significant. */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = endaddr - 1; p >= startaddr; --p)
{
/* Start at the least significant end of the integer, and work towards
the most significant. */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = endaddr - 1; p >= startaddr; --p)
{
{
/* Raw and virtual formats are the same for this register. */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN && len < REGISTER_RAW_SIZE (regnum))
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && len < REGISTER_RAW_SIZE (regnum))
{
/* Big-endian, and we want less than full size. */
VALUE_OFFSET (v) = REGISTER_RAW_SIZE (regnum) - len;
{
/* basic architecture information */
&bfd_default_arch_struct,
- BIG_ENDIAN,
+ BFD_ENDIAN_BIG,
/* target specific vector and its dump routine */
NULL, NULL,
/*per-architecture data-pointers and swap regions */
/* From the INFO struct. */
if (info.byte_order == BFD_ENDIAN_UNKNOWN
&& info.abfd != NULL)
- info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN
+ info.byte_order = (bfd_big_endian (info.abfd) ? BFD_ENDIAN_BIG
: bfd_little_endian (info.abfd) ? BFD_ENDIAN_LITTLE
: BFD_ENDIAN_UNKNOWN);
/* From the current target. */
fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: info.byte_order %d (%s)\n",
info.byte_order,
- (info.byte_order == BIG_ENDIAN ? "big"
+ (info.byte_order == BFD_ENDIAN_BIG ? "big"
: info.byte_order == BFD_ENDIAN_LITTLE ? "little"
: "default"));
fprintf_unfiltered (gdb_stdlog,
cat <<EOF
i:2:TARGET_ARCHITECTURE:const struct bfd_arch_info *:bfd_arch_info::::&bfd_default_arch_struct::::%s:TARGET_ARCHITECTURE->printable_name:TARGET_ARCHITECTURE != NULL
#
-i:2:TARGET_BYTE_ORDER:int:byte_order::::BIG_ENDIAN
+i:2:TARGET_BYTE_ORDER:int:byte_order::::BFD_ENDIAN_BIG
# Number of bits in a char or unsigned char for the target machine.
# Just like CHAR_BIT in <limits.h> but describes the target machine.
# v::TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
/* From the INFO struct. */
if (info.byte_order == BFD_ENDIAN_UNKNOWN
&& info.abfd != NULL)
- info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN
+ info.byte_order = (bfd_big_endian (info.abfd) ? BFD_ENDIAN_BIG
: bfd_little_endian (info.abfd) ? BFD_ENDIAN_LITTLE
: BFD_ENDIAN_UNKNOWN);
/* From the current target. */
fprintf_unfiltered (gdb_stdlog,
"gdbarch_update: info.byte_order %d (%s)\n",
info.byte_order,
- (info.byte_order == BIG_ENDIAN ? "big"
+ (info.byte_order == BFD_ENDIAN_BIG ? "big"
: info.byte_order == BFD_ENDIAN_LITTLE ? "little"
: "default"));
fprintf_unfiltered (gdb_stdlog,
printf_filtered ("\t(raw 0x");
for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
{
- register int idx = TARGET_BYTE_ORDER == BIG_ENDIAN ? j
+ register int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j
: REGISTER_RAW_SIZE (i) - 1 - j;
printf_filtered ("%02x", (unsigned char) raw_buffer[idx]);
}
breakpoint. On some machines, breakpoints are handled by the
target environment and we don't have to worry about them here. */
#ifdef BIG_BREAKPOINT
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
static unsigned char big_break_insn[] = BIG_BREAKPOINT;
*lenptr = sizeof (big_break_insn);
}
#endif
#ifdef LITTLE_BREAKPOINT
- if (TARGET_BYTE_ORDER != BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG)
{
static unsigned char little_break_insn[] = LITTLE_BREAKPOINT;
*lenptr = sizeof (little_break_insn);
}
di.mach = TARGET_PRINT_INSN_INFO->mach;
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
di.endian = BFD_ENDIAN_BIG;
else
di.endian = BFD_ENDIAN_LITTLE;
ptr = buf + 2;
for (j = 0; j < REGISTER_RAW_SIZE (regnum); j++)
{
- register int idx = TARGET_BYTE_ORDER == BIG_ENDIAN ? j
+ register int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j
: REGISTER_RAW_SIZE (regnum) - 1 - j;
sprintf (ptr, "%02x", (unsigned char) raw_buffer[idx]);
ptr += 2;
mips_register_convert_to_virtual (int n, struct type *virtual_type,
char *raw_buf, char *virt_buf)
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
memcpy (virt_buf,
raw_buf + (REGISTER_RAW_SIZE (n) - TYPE_LENGTH (virtual_type)),
TYPE_LENGTH (virtual_type));
char *virt_buf, char *raw_buf)
{
memset (raw_buf, 0, REGISTER_RAW_SIZE (n));
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
memcpy (raw_buf + (REGISTER_RAW_SIZE (n) - TYPE_LENGTH (virtual_type)),
virt_buf,
TYPE_LENGTH (virtual_type));
{
if (!FP_REGISTER_DOUBLE && len == 8)
{
- int low_offset = TARGET_BYTE_ORDER == BIG_ENDIAN ? 4 : 0;
+ int low_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0;
unsigned long regval;
/* Write the low word of the double to the even register(s). */
int longword_offset = 0;
CORE_ADDR addr;
stack_used_p = 1;
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
if (MIPS_STACK_ARGSIZE == 8 &&
(typecode == TYPE_CODE_INT ||
if (!MIPS_EABI
&& MIPS_SAVED_REGSIZE < 8
- && TARGET_BYTE_ORDER == BIG_ENDIAN
+ && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
&& partial_len < MIPS_SAVED_REGSIZE
&& (typecode == TYPE_CODE_STRUCT ||
typecode == TYPE_CODE_UNION))
if (MIPS_SAVED_REGSIZE < REGISTER_RAW_SIZE (regno))
{
regsize = MIPS_SAVED_REGSIZE;
- offset = (TARGET_BYTE_ORDER == BIG_ENDIAN
+ offset = (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
? REGISTER_RAW_SIZE (regno) - MIPS_SAVED_REGSIZE
: 0);
}
if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
if (FP_REGISTER_DOUBLE)
{ /* show 8-byte floats as float AND double: */
- int offset = 4 * (TARGET_BYTE_ORDER == BIG_ENDIAN);
+ int offset = 4 * (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG);
printf_filtered (" (float) ");
val_print (builtin_type_float, raw_buffer + offset, 0, 0,
{
int offset;
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
offset = REGISTER_RAW_SIZE (regnum) - REGISTER_VIRTUAL_SIZE (regnum);
else
offset = 0;
char *raw_buffer[2];
char *dbl_buffer;
/* use HI and LO to control the order of combining two flt regs */
- int HI = (TARGET_BYTE_ORDER == BIG_ENDIAN);
- int LO = (TARGET_BYTE_ORDER != BIG_ENDIAN);
+ int HI = (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG);
+ int LO = (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG);
double doub, flt1, flt2; /* doubles extracted from raw hex data */
int inv1, inv2, inv3;
}
else
{ /* eight byte registers: print each one as float AND as double. */
- int offset = 4 * (TARGET_BYTE_ORDER == BIG_ENDIAN);
+ int offset = 4 * (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG);
memcpy (dbl_buffer, raw_buffer[HI], 2 * REGISTER_RAW_SIZE (FP0_REGNUM));
flt1 = unpack_double (builtin_type_float,
for (byte = 0; byte < (MIPS_REGSIZE - REGISTER_VIRTUAL_SIZE (regnum)); byte++)
printf_filtered (" ");
/* Now print the register value in hex, endian order. */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
for (byte = REGISTER_RAW_SIZE (regnum) - REGISTER_VIRTUAL_SIZE (regnum);
byte < REGISTER_RAW_SIZE (regnum);
byte++)
{
/* We need to break a 64bit float in two 32 bit halves and
spread them across a floating-point register pair. */
- lo->buf_offset = TARGET_BYTE_ORDER == BIG_ENDIAN ? 4 : 0;
- hi->buf_offset = TARGET_BYTE_ORDER == BIG_ENDIAN ? 0 : 4;
- lo->reg_offset = ((TARGET_BYTE_ORDER == BIG_ENDIAN
+ lo->buf_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0;
+ hi->buf_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 0 : 4;
+ lo->reg_offset = ((TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
&& REGISTER_RAW_SIZE (FP0_REGNUM) == 8)
? 4 : 0);
hi->reg_offset = lo->reg_offset;
{
/* The floating point value fits in a single floating-point
register. */
- lo->reg_offset = ((TARGET_BYTE_ORDER == BIG_ENDIAN
+ lo->reg_offset = ((TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
&& REGISTER_RAW_SIZE (FP0_REGNUM) == 8
&& len == 4)
? 4 : 0);
int regnum = 2;
lo->reg = regnum + 0;
hi->reg = regnum + 1;
- if (TARGET_BYTE_ORDER == BIG_ENDIAN
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
&& len < MIPS_SAVED_REGSIZE)
{
/* "un-left-justify" the value in the low register */
hi->reg_offset = 0;
hi->len = 0;
}
- else if (TARGET_BYTE_ORDER == BIG_ENDIAN
+ else if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
&& len > MIPS_SAVED_REGSIZE /* odd-size structs */
&& len < MIPS_SAVED_REGSIZE * 2
&& (TYPE_CODE (valtype) == TYPE_CODE_STRUCT ||
hi->len = 0;
}
}
- if (TARGET_BYTE_ORDER == BIG_ENDIAN
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
&& REGISTER_RAW_SIZE (regnum) == 8
&& MIPS_SAVED_REGSIZE == 4)
{
memaddr &= (info->mach == bfd_mach_mips16 ? ~1 : ~3);
/* Call the appropriate disassembler based on the target endian-ness. */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
return print_insn_big_mips (memaddr, info);
else
return print_insn_little_mips (memaddr, info);
unsigned char *
mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
if (pc_is_mips16 (*pcptr))
{
else
{
int byte;
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (byte = REGISTER_RAW_SIZE (regnum) - REGISTER_VIRTUAL_SIZE (regnum);
byte < REGISTER_RAW_SIZE (regnum);
static int
print_insn (CORE_ADDR memaddr, struct ui_file *stream)
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
TARGET_PRINT_INSN_INFO->endian = BFD_ENDIAN_BIG;
else
TARGET_PRINT_INSN_INFO->endian = BFD_ENDIAN_LITTLE;
for (j = 0; j < 4; j++)
{
get_hex_byte (&b);
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
val = (val << 8) + b;
else
val = val + (b << (j * 8));
for (j = 0; j < 2; j++)
{
get_hex_byte (&b);
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
val = (val << 8) + b;
else
val = val + (b << (j * 8));
for (j = 0; j < 2; j++)
{
get_hex_byte (&b);
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
val = (val << 8) + b;
else
val = val + (b << (j * 8));
if (rslt != adp_ok)
error ("Could not open device \"%s\"", name);
- gdb_config.bytesex = 2 | (TARGET_BYTE_ORDER == BIG_ENDIAN ? 1 : 0);
+ gdb_config.bytesex = 2 | (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 1 : 0);
gdb_config.fpe = 1;
gdb_config.rditype = 2;
gdb_config.heartbeat_on = 1;
sync = 1;
break;
case RDP_RES_VALUE_BIG_ENDIAN:
- target_byte_order = BIG_ENDIAN;
+ target_byte_order = BFD_ENDIAN_BIG;
sync = 1;
break;
default:
{
switch (TARGET_BYTE_ORDER)
{
- case BIG_ENDIAN:
+ case BFD_ENDIAN_BIG:
strcat (arg_buf, " -E big");
break;
case BFD_ENDIAN_LITTLE:
if (val == 0)
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
val = target_write_memory (addr, (char *) big_break_insn,
sizeof big_break_insn);
else
static unsigned char big_breakpoint[] = BIG_BREAKPOINT;
static unsigned char little_breakpoint[] = LITTLE_BREAKPOINT;
*bp_size = 4;
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
return big_breakpoint;
else
return little_breakpoint;
static char le_breakp[] = LITTLE_BREAKPOINT;
static char be_breakp[] = BIG_BREAKPOINT;
- char *breakp = TARGET_BYTE_ORDER == BIG_ENDIAN ? be_breakp : le_breakp;
+ char *breakp = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? be_breakp : le_breakp;
int ii, insn;
CORE_ADDR loc;
CORE_ADDR breaks[2];
}
else
{ /* Argument can fit in one register. No problem. */
- int adj = TARGET_BYTE_ORDER == BIG_ENDIAN ? reg_size - len : 0;
+ int adj = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? reg_size - len : 0;
memset (®isters[REGISTER_BYTE (ii + 3)], 0, reg_size);
memcpy ((char *)®isters[REGISTER_BYTE (ii + 3)] + adj,
VALUE_CONTENTS (arg), len);
else
{
/* return value is copied starting from r3. */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
&& TYPE_LENGTH (valtype) < REGISTER_RAW_SIZE (3))
offset = REGISTER_RAW_SIZE (3) - TYPE_LENGTH (valtype);
/* Select instruction printer. */
tm_print_insn = arch == power ? print_insn_rs6000 :
- info.byte_order == BIG_ENDIAN ? print_insn_big_powerpc :
+ info.byte_order == BFD_ENDIAN_BIG ? print_insn_big_powerpc :
print_insn_little_powerpc;
/* Choose variant. */
static int
gdb_print_insn_sh (bfd_vma memaddr, disassemble_info *info)
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
return print_insn_sh (memaddr, info);
else
return print_insn_shl (memaddr, info);
if (len <= 4)
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
offset = REGISTER_BYTE (return_register) + 4 - len;
else
offset = REGISTER_BYTE (return_register);
}
else if (len <= 8)
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
offset = REGISTER_BYTE (return_register) + 8 - len;
else
offset = REGISTER_BYTE (return_register);
}
else if (len <= 4)
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
offset = REGISTER_BYTE (return_register) + 4 - len;
else
offset = REGISTER_BYTE (return_register);
}
else if (len <= 8)
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
offset = REGISTER_BYTE (return_register) + 8 - len;
else
offset = REGISTER_BYTE (return_register);
printf_filtered ("\t(raw 0x");
for (j = 0; j < REGISTER_RAW_SIZE (regnum); j++)
{
- register int idx = TARGET_BYTE_ORDER == BIG_ENDIAN ? j
+ register int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j
: REGISTER_RAW_SIZE (regnum) - 1 - j;
printf_filtered ("%02x", (unsigned char) raw_buffer[idx]);
}
sizeof (marker));
if (strncmp (marker.signature, "DaTa", 4) == 0)
{
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
section_address = bfd_getb32 (marker.sdata);
else
section_address = bfd_getl32 (marker.sdata);
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
add_symbol_to_list (sym, &local_symbols);
- if (TARGET_BYTE_ORDER != BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG)
{
/* On little-endian machines, this crud is never necessary,
and, if the extra bytes contain garbage, is harmful. */
& ~(PARM_BOUNDARY / TARGET_CHAR_BIT - 1));
/* Are we going to put it at the high or low end of the container? */
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
offset = container_len - len;
else
offset = 0;
/* FIXME: We should be not printing leading zeroes in most cases. */
fprintf_filtered (stream, local_binary_format_prefix ());
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = valaddr;
p < valaddr + len;
carry = 0;
fprintf_filtered (stream, local_octal_format_prefix ());
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = valaddr;
p < valaddr + len;
#define CARRY_LEFT( x ) ((x) % TEN)
#define SHIFT( x ) ((x) << 4)
#define START_P \
- ((TARGET_BYTE_ORDER == BIG_ENDIAN) ? valaddr : valaddr + len - 1)
+ ((TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) ? valaddr : valaddr + len - 1)
#define NOT_END_P \
- ((TARGET_BYTE_ORDER == BIG_ENDIAN) ? (p < valaddr + len) : (p >= valaddr))
+ ((TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) ? (p < valaddr + len) : (p >= valaddr))
#define NEXT_P \
- ((TARGET_BYTE_ORDER == BIG_ENDIAN) ? p++ : p-- )
+ ((TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) ? p++ : p-- )
#define LOW_NIBBLE( x ) ( (x) & 0x00F)
#define HIGH_NIBBLE( x ) (((x) & 0x0F0) >> 4)
/* FIXME: We should be not printing leading zeroes in most cases. */
fprintf_filtered (stream, local_hex_format_prefix ());
- if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = valaddr;
p < valaddr + len;