static void set_verbose PARAMS ((char *, int, struct cmd_list_element *));
-#ifdef TARGET_BYTE_ORDER_SELECTABLE
-
static void set_endian PARAMS ((char *, int));
static void set_endian_big PARAMS ((char *, int));
static void show_endian PARAMS ((char *, int));
-#endif
-
static void show_history PARAMS ((char *, int));
static void set_history PARAMS ((char *, int));
struct cmd_list_element *showlist;
-#ifdef TARGET_BYTE_ORDER_SELECTABLE
/* Chain containing the \"set endian\" commands. */
struct cmd_list_element *endianlist;
-#endif
/* Chain containing all defined \"set history\". */
necessarily reading from stdin. */
}
\f
-#ifdef TARGET_BYTE_ORDER_SELECTABLE
-
/* Functions to manipulate the endianness of the target. */
+#ifdef TARGET_BYTE_ORDER_SELECTABLE
#ifndef TARGET_BYTE_ORDER_DEFAULT
#define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
#endif
-
int target_byte_order = TARGET_BYTE_ORDER_DEFAULT;
-
static int target_byte_order_auto = 1;
+#else
+static int target_byte_order_auto = 0;
+#endif
/* Called if the user enters ``set endian'' without an argument. */
static void
char *args;
int from_tty;
{
+#ifdef TARGET_BYTE_ORDER_SELECTABLE
target_byte_order = BIG_ENDIAN;
target_byte_order_auto = 0;
+#else
+ printf_unfiltered ("Byte order is not selectable.");
+ show_endian (args, from_tty);
+#endif
}
/* Called by ``set endian little''. */
char *args;
int from_tty;
{
+#ifdef TARGET_BYTE_ORDER_SELECTABLE
target_byte_order = LITTLE_ENDIAN;
target_byte_order_auto = 0;
+#else
+ printf_unfiltered ("Byte order is not selectable.");
+ show_endian (args, from_tty);
+#endif
}
/* Called by ``set endian auto''. */
char *args;
int from_tty;
{
+#ifdef TARGET_BYTE_ORDER_SELECTABLE
target_byte_order_auto = 1;
+#else
+ printf_unfiltered ("Byte order is not selectable.");
+ show_endian (args, from_tty);
+#endif
}
/* Called by ``show endian''. */
printf_unfiltered ((char *) msg, TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little");
}
-#endif /* defined (TARGET_BYTE_ORDER_SELECTABLE) */
-
/* Set the endianness from a BFD. */
void
set_endian_from_file (abfd)
setlist = NULL;
unsetlist = NULL;
showlist = NULL;
-#ifdef TARGET_BYTE_ORDER_SELECTABLE
endianlist = NULL;
-#endif
sethistlist = NULL;
showhistlist = NULL;
unsethistlist = NULL;
{
struct cmd_list_element *c;
-#ifdef TARGET_BYTE_ORDER_SELECTABLE
-
add_prefix_cmd ("endian", class_support, set_endian,
"Set endianness of target.",
&endianlist, "set endian ", 0, &setlist);
add_cmd ("endian", class_support, show_endian,
"Show endianness of target.", &showlist);
-#endif /* defined (TARGET_BYTE_ORDER_SELECTABLE) */
-
#ifdef DEFAULT_PROMPT
prompt = savestring (DEFAULT_PROMPT, strlen(DEFAULT_PROMPT));
#else